LLVMFuzzerTestOneInput:
    8|  39.3k|{
    9|       |   // The YAML reader is bounded by `end` and never consults a trailing sentinel, so it must
   10|       |   // parse a buffer that has no '\0' after it. An exact-size heap buffer puts the ASAN
   11|       |   // redzone immediately after the last byte, so any read past the end fails here.
   12|  39.3k|   {
   13|  39.3k|      const std::vector<char> buffer{Data, Data + Size};
   14|       |
   15|  39.3k|      static constexpr glz::opts opts{.format = glz::YAML, .null_terminated = false};
   16|  39.3k|      glz::generic yaml{};
   17|  39.3k|      auto ec = glz::read<opts>(yaml, buffer);
   18|  39.3k|      if (!ec) {
  ------------------
  |  Branch (18:11): [True: 7.60k, False: 31.7k]
  ------------------
   19|  7.60k|         [[maybe_unused]] auto s = yaml.size();
   20|  7.60k|      }
   21|  39.3k|   }
   22|       |
   23|       |   // glz::yaml_opts has no null_terminated member at all, so this covers the default
   24|       |   // read_yaml path, where check_null_terminated falls back to false.
   25|  39.3k|   {
   26|  39.3k|      const std::vector<char> buffer{Data, Data + Size};
   27|       |
   28|  39.3k|      glz::generic yaml{};
   29|  39.3k|      auto ec = glz::read_yaml(yaml, buffer);
   30|  39.3k|      if (!ec) {
  ------------------
  |  Branch (30:11): [True: 7.60k, False: 31.7k]
  ------------------
   31|  7.60k|         [[maybe_unused]] auto s = yaml.size();
   32|  7.60k|      }
   33|  39.3k|   }
   34|       |
   35|       |   // use a vector with null termination instead of a std::string to avoid
   36|       |   // small string optimization to hide bounds problems
   37|  39.3k|   std::vector<char> buffer{Data, Data + Size};
   38|  39.3k|   buffer.push_back('\0');
   39|       |
   40|       |   // const qualified input buffer
   41|  39.3k|   {
   42|  39.3k|      const auto& input = buffer;
   43|  39.3k|      glz::generic yaml{};
   44|  39.3k|      auto ec = glz::read_yaml(yaml, input);
   45|  39.3k|      if (!ec) {
  ------------------
  |  Branch (45:11): [True: 851, False: 38.4k]
  ------------------
   46|    851|         [[maybe_unused]] auto s = yaml.size();
   47|    851|      }
   48|  39.3k|   }
   49|       |
   50|       |   // non-const input buffer
   51|  39.3k|   {
   52|  39.3k|      glz::generic yaml{};
   53|  39.3k|      auto ec = glz::read_yaml(yaml, buffer);
   54|  39.3k|      if (!ec) {
  ------------------
  |  Branch (54:11): [True: 851, False: 38.4k]
  ------------------
   55|    851|         [[maybe_unused]] auto s = yaml.size();
   56|    851|      }
   57|  39.3k|   }
   58|       |
   59|  39.3k|   return 0;
   60|  39.3k|}

_ZN3glz11empty_rangeITkNS_5rangeERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEEEbOT_:
  304|  1.01M|   {
  305|  1.01M|#ifdef __cpp_lib_ranges
  306|  1.01M|      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|  1.01M|   }
_ZN3glz11empty_rangeITkNS_5rangeERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEEEbOT_:
  304|  6.27M|   {
  305|  6.27M|#ifdef __cpp_lib_ranges
  306|  6.27M|      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|  6.27M|   }

_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEED2Ev:
  569|  27.5M|      {
  570|  27.5M|         free_data();
  571|  27.5M|         free_index();
  572|  27.5M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE9free_dataEv:
  266|  27.5M|      {
  267|  27.5M|         destroy_all();
  268|  27.5M|         ::operator delete(data_);
  269|  27.5M|         data_ = nullptr;
  270|  27.5M|         size_ = 0;
  271|  27.5M|         capacity_ = 0;
  272|  27.5M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11destroy_allEv:
  259|  35.4M|      {
  260|  53.4M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (260:31): [True: 17.9M, False: 35.4M]
  ------------------
  261|  17.9M|            std::destroy_at(data_ + i);
  262|  17.9M|         }
  263|  35.4M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE10free_indexEv:
  308|  27.5M|      {
  309|  27.5M|         std::free(index_);
  310|  27.5M|         index_ = nullptr;
  311|  27.5M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEC2Ev:
  566|  15.8M|      ordered_small_map() = default;
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEaSEOS4_:
  628|  2.21k|      {
  629|  2.21k|         if (this != &other) {
  ------------------
  |  Branch (629:14): [True: 2.21k, False: 0]
  ------------------
  630|  2.21k|            free_data();
  631|  2.21k|            free_index();
  632|  2.21k|            data_ = other.data_;
  633|  2.21k|            size_ = other.size_;
  634|  2.21k|            capacity_ = other.capacity_;
  635|  2.21k|            index_ = other.index_;
  636|  2.21k|            other.data_ = nullptr;
  637|  2.21k|            other.size_ = 0;
  638|  2.21k|            other.capacity_ = 0;
  639|  2.21k|            other.index_ = nullptr;
  640|  2.21k|         }
  641|  2.21k|         return *this;
  642|  2.21k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEC2EOS4_:
  610|  11.6M|         : data_(other.data_), size_(other.size_), capacity_(other.capacity_), index_(other.index_)
  611|  11.6M|      {
  612|  11.6M|         other.data_ = nullptr;
  613|  11.6M|         other.size_ = 0;
  614|  11.6M|         other.capacity_ = 0;
  615|  11.6M|         other.index_ = nullptr;
  616|  11.6M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE5emptyEv:
  662|  14.1M|      [[nodiscard]] bool empty() const noexcept { return size_ == 0; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE5beginEv:
  645|  14.0M|      iterator begin() noexcept { return data_; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE3endEv:
  649|  29.9M|      iterator end() noexcept { return data_ + size_; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11linear_findINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEPNS6_4pairISC_S3_EERKT_:
  421|  14.5M|      {
  422|  26.0M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (422:31): [True: 13.3M, False: 12.6M]
  ------------------
  423|  13.3M|            if (data_[i].first == key) return data_ + i;
  ------------------
  |  Branch (423:17): [True: 1.84M, False: 11.5M]
  ------------------
  424|  13.3M|         }
  425|  12.6M|         return data_ + size_;
  426|  14.5M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE14grow_if_neededEv:
  217|  14.1M|      {
  218|  14.1M|         if (size_ == capacity_) {
  ------------------
  |  Branch (218:14): [True: 7.94M, False: 6.23M]
  ------------------
  219|  7.94M|            if (size_ == max_u32) {
  ------------------
  |  Branch (219:17): [True: 0, False: 7.94M]
  ------------------
  220|      0|               throw_capacity_overflow();
  221|      0|            }
  222|  7.94M|            const uint32_t new_cap = next_data_capacity(capacity_);
  223|  7.94M|            reallocate_data(new_cap);
  224|  7.94M|         }
  225|  14.1M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE18next_data_capacityEj:
  120|  7.94M|      {
  121|  7.94M|         if (current == 0) return 4;
  ------------------
  |  Branch (121:14): [True: 7.58M, False: 355k]
  ------------------
  122|   355k|         if (current > (max_u32 / 2)) return max_u32;
  ------------------
  |  Branch (122:14): [True: 0, False: 355k]
  ------------------
  123|   355k|         return current * 2;
  124|   355k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE15reallocate_dataEj:
  205|  7.94M|      {
  206|  7.94M|         if (new_cap < size_) {
  ------------------
  |  Branch (206:14): [True: 0, False: 7.94M]
  ------------------
  207|      0|            throw_capacity_overflow();
  208|      0|         }
  209|  7.94M|         auto* new_data = allocate_and_relocate(new_cap);
  210|  7.94M|         destroy_all();
  211|  7.94M|         ::operator delete(data_);
  212|  7.94M|         data_ = new_data;
  213|  7.94M|         capacity_ = new_cap;
  214|  7.94M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE21allocate_and_relocateEj:
  159|  7.94M|      {
  160|  7.94M|         auto* new_data = static_cast<value_type*>(::operator new(checked_data_allocation_bytes(new_cap)));
  161|  7.94M|#if __cpp_exceptions
  162|  7.94M|         uint32_t constructed = 0;
  163|  7.94M|         try {
  164|  11.7M|            for (; constructed < size_; ++constructed) {
  ------------------
  |  Branch (164:20): [True: 3.79M, False: 7.94M]
  ------------------
  165|  3.79M|               std::construct_at(new_data + constructed, std::move_if_noexcept(data_[constructed]));
  166|  3.79M|            }
  167|  7.94M|         }
  168|  7.94M|         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|  7.94M|         return new_data;
  179|  7.94M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE29checked_data_allocation_bytesEj:
  134|  7.94M|      {
  135|  7.94M|         if (count > ((std::numeric_limits<size_t>::max)() / sizeof(value_type))) {
  ------------------
  |  Branch (135:14): [True: 0, False: 7.94M]
  ------------------
  136|      0|            GLZ_THROW_OR_ABORT(std::bad_alloc{});
  ------------------
  |  |    8|      0|#define GLZ_THROW_OR_ABORT(EXC) (throw(EXC))
  ------------------
  137|      0|         }
  138|  7.94M|         return static_cast<size_t>(count) * sizeof(value_type);
  139|  7.94M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE8hash_keyENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEE:
   97|  5.82M|      static uint32_t hash_key(std::string_view key) noexcept { return sweethash::sweet32(key); }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE20bloom_maybe_containsEj:
  285|  2.51M|      {
  286|  2.51M|         const uint32_t a = h & bloom_mask;
  287|  2.51M|         const uint32_t b = (h >> 10) & bloom_mask;
  288|  2.51M|         return (index_->bloom[a >> 3] & (uint8_t(1) << (a & 7))) && (index_->bloom[b >> 3] & (uint8_t(1) << (b & 7)));
  ------------------
  |  Branch (288:17): [True: 1.33M, False: 1.17M]
  |  Branch (288:70): [True: 1.19M, False: 136k]
  ------------------
  289|  2.51M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE17index_find_or_posINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEENS4_17index_find_resultERKT_j:
  400|  1.34M|      {
  401|  1.34M|         ensure_index();
  402|       |
  403|  1.34M|         const auto* base = index_entries();
  404|  1.34M|         const auto* idx_end = base + index_->size;
  405|  1.34M|         const auto* p = branchless_lower_bound(base, index_->size, h);
  406|  1.34M|         const size_t pos = static_cast<size_t>(p - base);
  407|       |
  408|       |         // Scan adjacent entries with matching hash
  409|  1.34M|         for (auto* scan = p; scan != idx_end && scan->key_hash == h; ++scan) {
  ------------------
  |  Branch (409:31): [True: 1.34M, False: 2.91k]
  |  Branch (409:50): [True: 1.09M, False: 252k]
  ------------------
  410|  1.09M|            if (data_[scan->index].first == key) {
  ------------------
  |  Branch (410:17): [True: 1.09M, False: 1.68k]
  ------------------
  411|  1.09M|               return {data_ + scan->index, pos, h};
  412|  1.09M|            }
  413|  1.09M|         }
  414|       |
  415|   254k|         return {data_ + size_, pos, h};
  416|  1.34M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE12ensure_indexEv:
  360|  1.34M|      {
  361|  1.34M|         if (size_ <= linear_search_threshold) return;
  ------------------
  |  Branch (361:14): [True: 0, False: 1.34M]
  ------------------
  362|  1.34M|         const auto current = index_size();
  363|  1.34M|         if (current == size_) return; // fully current
  ------------------
  |  Branch (363:14): [True: 960k, False: 386k]
  ------------------
  364|       |
  365|   386k|         if (current == 0 || (size_ - current) > linear_search_threshold) {
  ------------------
  |  Branch (365:14): [True: 60.7k, False: 325k]
  |  Branch (365:30): [True: 41.2k, False: 284k]
  ------------------
  366|   101k|            rebuild_index(); // full rebuild
  367|   101k|            return;
  368|   101k|         }
  369|       |
  370|       |         // Incrementally insert-sort the few new entries
  371|   954k|         for (uint32_t i = current; i < size_; ++i) {
  ------------------
  |  Branch (371:37): [True: 669k, False: 284k]
  ------------------
  372|   669k|            const hash_index_entry entry{hash_key(data_[i].first), i};
  373|   669k|            const auto* base = index_entries();
  374|   669k|            const auto* p = branchless_lower_bound(base, index_->size, entry.key_hash);
  375|   669k|            auto pos = static_cast<size_t>(p - base);
  376|       |
  377|   669k|            const uint32_t m = index_->size;
  378|   669k|            ensure_index_capacity(static_cast<size_type>(m) + 1);
  379|   669k|            auto* entries = index_entries();
  380|   669k|            if (pos < m) {
  ------------------
  |  Branch (380:17): [True: 640k, False: 29.2k]
  ------------------
  381|   640k|               std::memmove(entries + pos + 1, entries + pos, (m - pos) * sizeof(hash_index_entry));
  382|   640k|            }
  383|   669k|            entries[pos] = entry;
  384|   669k|            index_->size = i + 1;
  385|   669k|         }
  386|   284k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE13rebuild_indexEv:
  343|   101k|      {
  344|   101k|         ensure_index_capacity(static_cast<size_type>(size_));
  345|   101k|         bloom_clear();
  346|   101k|         auto* entries = index_entries();
  347|  2.59M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (347:31): [True: 2.49M, False: 101k]
  ------------------
  348|  2.49M|            const uint32_t h = hash_key(data_[i].first);
  349|  2.49M|            entries[i] = {h, i};
  350|  2.49M|            bloom_set(h);
  351|  2.49M|         }
  352|   101k|         std::sort(entries, entries + size_, [](const auto& a, const auto& b) { return a.key_hash < b.key_hash; });
  353|   101k|         index_->size = size_;
  354|   101k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11bloom_clearEv:
  291|   101k|      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|  15.0M|         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.01M|      {
  441|  13.7M|         while (len > 1) {
  ------------------
  |  Branch (441:17): [True: 11.7M, False: 2.01M]
  ------------------
  442|  11.7M|            size_t half = len / 2;
  443|  11.7M|            p += (p[half - 1].key_hash < target) * half;
  444|  11.7M|            len -= half;
  445|  11.7M|         }
  446|       |         // Final element check: advance past it if it's less than target
  447|  2.01M|         p += (len == 1 && p->key_hash < target);
  ------------------
  |  Branch (447:16): [True: 2.01M, False: 0]
  |  Branch (447:28): [True: 32.1k, False: 1.98M]
  ------------------
  448|  2.01M|         return p;
  449|  2.01M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE9bloom_setEj:
  277|  4.06M|      {
  278|  4.06M|         const uint32_t a = h & bloom_mask;
  279|  4.06M|         const uint32_t b = (h >> 10) & bloom_mask;
  280|  4.06M|         index_->bloom[a >> 3] |= uint8_t(1) << (a & 7);
  281|  4.06M|         index_->bloom[b >> 3] |= uint8_t(1) << (b & 7);
  282|  4.06M|      }
_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.54M, False: 60.7k]
  ------------------
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE21ensure_index_capacityEm:
  314|  1.02M|      {
  315|  1.02M|         if (needed == 0) return;
  ------------------
  |  Branch (315:14): [True: 0, False: 1.02M]
  ------------------
  316|  1.02M|         if (needed > static_cast<size_type>(max_u32)) {
  ------------------
  |  Branch (316:14): [True: 0, False: 1.02M]
  ------------------
  317|      0|            throw_index_overflow();
  318|      0|         }
  319|  1.02M|         const auto needed_u32 = static_cast<uint32_t>(needed);
  320|  1.02M|         if (index_ && index_->capacity >= needed_u32) return;
  ------------------
  |  Branch (320:14): [True: 965k, False: 60.7k]
  |  Branch (320:24): [True: 909k, False: 56.4k]
  ------------------
  321|   117k|         uint32_t cap = index_ ? index_->capacity : 0;
  ------------------
  |  Branch (321:25): [True: 56.4k, False: 60.7k]
  ------------------
  322|   240k|         while (cap < needed_u32) {
  ------------------
  |  Branch (322:17): [True: 122k, False: 117k]
  ------------------
  323|   122k|            const uint32_t next = next_index_capacity(cap);
  324|   122k|            if (next <= cap) {
  ------------------
  |  Branch (324:17): [True: 0, False: 122k]
  ------------------
  325|      0|               throw_index_overflow();
  326|      0|            }
  327|   122k|            cap = next;
  328|   122k|         }
  329|   117k|         auto* block = static_cast<index_header*>(std::realloc(index_, checked_index_allocation_bytes(cap)));
  330|   117k|         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: 117k]
  ------------------
  331|   117k|         if (!index_) {
  ------------------
  |  Branch (331:14): [True: 60.7k, False: 56.4k]
  ------------------
  332|  60.7k|            block->size = 0;
  333|  60.7k|            std::memset(block->bloom, 0, bloom_bytes);
  334|  60.7k|         }
  335|   117k|         block->capacity = cap;
  336|   117k|         index_ = block;
  337|   117k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE19next_index_capacityEj:
  127|   122k|      {
  128|   122k|         if (current == 0) return 16;
  ------------------
  |  Branch (128:14): [True: 60.7k, False: 62.1k]
  ------------------
  129|  62.1k|         if (current > (max_u32 / 2)) return max_u32;
  ------------------
  |  Branch (129:14): [True: 0, False: 62.1k]
  ------------------
  130|  62.1k|         return current * 2;
  131|  62.1k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE30checked_index_allocation_bytesEj:
  142|   117k|      {
  143|   117k|         constexpr size_t header = sizeof(index_header);
  144|   117k|         constexpr size_t entry = sizeof(hash_index_entry);
  145|   117k|         if (count > (((std::numeric_limits<size_t>::max)() - header) / entry)) {
  ------------------
  |  Branch (145:14): [True: 0, False: 117k]
  ------------------
  146|      0|            GLZ_THROW_OR_ABORT(std::bad_alloc{});
  ------------------
  |  |    8|      0|#define GLZ_THROW_OR_ABORT(EXC) (throw(EXC))
  ------------------
  147|      0|         }
  148|   117k|         return header + static_cast<size_t>(count) * entry;
  149|   117k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE13index_entriesEv:
  296|  3.04M|      {
  297|  3.04M|         return static_cast<hash_index_entry*>(static_cast<void*>(index_ + 1));
  298|  3.04M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE4findINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEPNS6_4pairISC_S3_EERKT_:
  902|  53.8k|      {
  903|  53.8k|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (903:14): [True: 53.8k, False: 0]
  ------------------
  904|  53.8k|            return linear_find(key);
  905|  53.8k|         }
  906|      0|         return index_find(key);
  907|  53.8k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE6insertEONSt3__14pairINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEES3_EE:
  719|  53.8k|      {
  720|  53.8k|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (720:14): [True: 53.8k, False: 0]
  ------------------
  721|  53.8k|            auto it = linear_find(value.first);
  722|  53.8k|            if (it != end()) return {it, false};
  ------------------
  |  Branch (722:17): [True: 0, False: 53.8k]
  ------------------
  723|  53.8k|            push_back_impl(std::move(value));
  724|  53.8k|            return {data_ + size_ - 1, true};
  725|  53.8k|         }
  726|      0|         const uint32_t h = hash_key(value.first);
  727|      0|         if (try_bloom_insert(h, [&] { push_back_impl(std::move(value)); })) {
  ------------------
  |  Branch (727:14): [True: 0, False: 0]
  ------------------
  728|      0|            return {data_ + size_ - 1, true};
  729|      0|         }
  730|       |         // try_bloom_insert returned false without calling the lambda, so value is still valid
  731|      0|         return indexed_insert(value.first, h, [&] { push_back_impl(std::move(value)); });
  732|      0|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE14push_back_implEONSt3__14pairINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEES3_EE:
  235|  53.8k|      {
  236|  53.8k|         grow_if_needed();
  237|  53.8k|         std::construct_at(data_ + size_, std::move(val));
  238|  53.8k|         ++size_;
  239|  53.8k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE7emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_:
  746|  17.0M|      {
  747|  17.0M|         return try_emplace(std::forward<K>(key), std::forward<Args>(args)...);
  748|  17.0M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11try_emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_:
  752|  17.0M|      {
  753|  17.0M|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (753:14): [True: 14.3M, False: 2.66M]
  ------------------
  754|  14.3M|            auto it = linear_find(key);
  755|  14.3M|            if (it != end()) return {it, false};
  ------------------
  |  Branch (755:17): [True: 1.84M, False: 12.5M]
  ------------------
  756|  12.5M|            emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...);
  757|  12.5M|            return {data_ + size_ - 1, true};
  758|  14.3M|         }
  759|  2.66M|         const uint32_t h = hash_key(key);
  760|  2.66M|         if (try_bloom_insert(h, [&] { emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...); })) {
  ------------------
  |  Branch (760:14): [True: 1.31M, False: 1.34M]
  ------------------
  761|  1.31M|            return {data_ + size_ - 1, true};
  762|  1.31M|         }
  763|  1.34M|         auto [it, pos, _] = index_find_or_pos(key, h);
  764|  1.34M|         if (it != end()) return {it, false};
  ------------------
  |  Branch (764:14): [True: 1.09M, False: 254k]
  ------------------
  765|   254k|         emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...);
  766|   254k|         bloom_set(h);
  767|   254k|         if (index_size() > 0) {
  ------------------
  |  Branch (767:14): [True: 254k, False: 0]
  ------------------
  768|   254k|            const uint32_t n = index_->size;
  769|   254k|            ensure_index_capacity(static_cast<size_type>(n) + 1);
  770|   254k|            auto* entries = index_entries();
  771|   254k|            if (pos < n) {
  ------------------
  |  Branch (771:17): [True: 252k, False: 2.90k]
  ------------------
  772|   252k|               std::memmove(entries + pos + 1, entries + pos, (n - pos) * sizeof(hash_index_entry));
  773|   252k|            }
  774|   254k|            entries[pos] = {h, static_cast<uint32_t>(size_ - 1)};
  775|   254k|            index_->size = size_;
  776|   254k|         }
  777|   254k|         return {data_ + size_ - 1, true};
  778|  1.34M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE15emplace_back_kvINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEEvOT_DpOT0_:
  251|  14.1M|      {
  252|  14.1M|         grow_if_needed();
  253|  14.1M|         std::construct_at(data_ + size_, std::piecewise_construct, std::forward_as_tuple(std::forward<K>(key)),
  254|  14.1M|                           std::forward_as_tuple(std::forward<Args>(args)...));
  255|  14.1M|         ++size_;
  256|  14.1M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE16try_bloom_insertIZNS4_11try_emplaceINSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEJS3_EEENS7_4pairIPNSE_ISD_S3_EEbEEOT_DpOT0_EUlvE_EEbjSJ_:
  529|  2.66M|      {
  530|  2.66M|         if (index_ && size_ <= bloom_threshold && !bloom_maybe_contains(h)) {
  ------------------
  |  Branch (530:14): [True: 2.60M, False: 60.7k]
  |  Branch (530:24): [True: 2.51M, False: 91.6k]
  |  Branch (530:52): [True: 1.31M, False: 1.19M]
  ------------------
  531|       |            // Definitely not present — skip the search
  532|  1.31M|            append_fn();
  533|  1.31M|            bloom_set(h);
  534|       |            // Index is now stale (index_->size < size_), will rebuild on next lookup or false positive
  535|  1.31M|            return true;
  536|  1.31M|         }
  537|  1.34M|         return false;
  538|  2.66M|      }
_ZZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11try_emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_ENKUlvE_clEv:
  760|  1.31M|         if (try_bloom_insert(h, [&] { emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...); })) {
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE4sizeEv:
  663|  8.84k|      size_type size() const noexcept { return size_; }

_ZN3glz15resize_unfilledINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRT_m:
   63|  4.45M|   {
   64|  4.45M|      if constexpr (requires { b.resize_and_overwrite(n, [](auto*, size_t written) { return written; }); }) {
   65|  4.45M|         b.resize_and_overwrite(n, [](auto*, size_t written) noexcept { return written; });
   66|       |      }
   67|       |      else {
   68|       |         b.resize(n);
   69|       |      }
   70|  4.45M|   }
_ZZN3glz15resize_unfilledINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRT_mENKUlPS8_mE_clIcEEDaSA_m:
   65|  4.45M|         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|  28.8M|   {
  266|  28.8M|      using Buffer = std::remove_cvref_t<B>;
  267|       |
  268|  28.8M|      if constexpr (vector_like<Buffer>) {
  269|  28.8M|         if (required > b.size()) [[unlikely]] {
  ------------------
  |  Branch (269:14): [True: 437k, False: 28.3M]
  ------------------
  270|   437k|            grow_buffer(b, required);
  271|   437k|         }
  272|  28.8M|         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|  28.8M|   }
_ZN3glz11grow_bufferINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRT_m:
  143|   438k|   {
  144|   438k|      using traits = buffer_traits<std::remove_cvref_t<B>>;
  145|   438k|      if constexpr (requires { traits::grow(b, required); }) {
  146|   438k|         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|   438k|   }
_ZN3glz13buffer_traitsINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE4growERS7_mQL_ZNS_13buffer_traits12is_resizableEE:
  118|   438k|      {
  119|   438k|         resize_unfilled(b, 2 * required);
  120|   438k|      }
_ZN3glz13buffer_traitsINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE8finalizeERS7_m:
  124|  4.01M|      {
  125|  4.01M|         if constexpr (is_resizable) {
  126|  4.01M|            b.resize(written);
  127|  4.01M|         }
  128|       |         // For fixed buffers: no-op, count is returned in result
  129|  4.01M|      }

_ZN3glz8str_viewINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7_EENS1_17basic_string_viewIcS4_EEOT0_:
  341|  1.70M|   {
  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.70M|      else if constexpr (has_data<T> && has_size<T>) {
  349|  1.70M|         return std::string_view{value.data(), value.size()};
  350|       |      }
  351|       |      else {
  352|       |         return std::string_view{value};
  353|       |      }
  354|  1.70M|   }
_ZN3glz8str_viewINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKS7_EENS1_17basic_string_viewIcS4_EEOT0_:
  341|  11.8M|   {
  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|  11.8M|      else if constexpr (has_data<T> && has_size<T>) {
  349|  11.8M|         return std::string_view{value.data(), value.size()};
  350|       |      }
  351|       |      else {
  352|       |         return std::string_view{value};
  353|       |      }
  354|  11.8M|   }
_ZN3glz10get_memberIRNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERKMS4_NSt3__17variantIJDndNS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEbNS6_6vectorIS4_NSB_IS4_EEEENS3_IS4_EEEEEEEDcOT_OT0_:
  677|  35.0M|   {
  678|  35.0M|      using V = std::decay_t<decltype(element)>;
  679|  35.0M|      if constexpr (std::is_member_object_pointer_v<V>) {
  680|  35.0M|         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|  35.0M|   }

_ZNK3glz9error_ctxcvbEv:
  148|   157k|      operator bool() const noexcept { return ec != error_code::none; }
_ZN3glz10call_scopeINS_4yaml12yaml_contextEEC2ERS2_:
  272|   157k|      explicit call_scope(Ctx& c) noexcept : ctx(c), depth(c.depth)
  273|   157k|      {
  274|   157k|         ctx.error = error_code::none;
  275|   157k|         ctx.custom_error_message = {};
  276|   157k|      }
_ZN3glz11depth_guardINS_4yaml12yaml_contextEEC2ERS2_m:
  215|  26.3M|      depth_guard(Ctx& c, const size_t limit = max_recursive_depth_limit) noexcept : ctx(c)
  216|  26.3M|      {
  217|  26.3M|         if (ctx.depth >= limit) [[unlikely]] {
  ------------------
  |  Branch (217:14): [True: 5.42k, False: 26.3M]
  ------------------
  218|  5.42k|            ctx.error = error_code::exceeded_max_recursive_depth;
  219|  5.42k|            return;
  220|  5.42k|         }
  221|  26.3M|         ++ctx.depth;
  222|  26.3M|         entered = true;
  223|  26.3M|      }
_ZNK3glz11depth_guardINS_4yaml12yaml_contextEEcvbEv:
  228|  26.3M|      explicit operator bool() const noexcept { return entered; }
_ZN3glz10call_scopeINS_7contextEEC2ERS1_:
  272|  4.01M|      explicit call_scope(Ctx& c) noexcept : ctx(c), depth(c.depth)
  273|  4.01M|      {
  274|  4.01M|         ctx.error = error_code::none;
  275|  4.01M|         ctx.custom_error_message = {};
  276|  4.01M|      }
_ZN3glz10call_scopeINS_7contextEED2Ev:
  277|  4.01M|      ~call_scope() { ctx.depth = depth; }
_ZN3glz11depth_guardINS_4yaml12yaml_contextEED2Ev:
  225|  26.3M|      {
  226|  26.3M|         if (entered) --ctx.depth;
  ------------------
  |  Branch (226:14): [True: 26.3M, False: 5.42k]
  ------------------
  227|  26.3M|      }
_ZN3glz10call_scopeINS_4yaml12yaml_contextEED2Ev:
  277|   157k|      ~call_scope() { ctx.depth = depth; }

_ZN3glz4readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERKNSt3__16vectorIcNS6_9allocatorIcEEEEQaa14read_supportedIT0_XdtT_6formatEEnt18is_input_streamingIT1_EEENS_9error_ctxERSD_OSE_:
  232|  39.3k|   {
  233|  39.3k|      format_context_t<Opts.format> ctx{};
  234|  39.3k|      return read<Opts>(value, buffer, ctx);
  235|  39.3k|   }
_ZN3glz4readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERKNSt3__16vectorIcNS6_9allocatorIcEEEETkNS_10is_contextERNS_4yaml12yaml_contextEQaa14read_supportedIT0_XdtT_6formatEEnt18is_input_streamingIT1_EEENS_9error_ctxERSG_OSH_OT2_:
  152|  39.3k|   {
  153|  39.3k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  154|       |
  155|  39.3k|      call_scope scope{ctx};
  156|       |
  157|  39.3k|      if constexpr (Opts.format != NDJSON) {
  158|  39.3k|         if (buffer.size() == 0) [[unlikely]] {
  ------------------
  |  Branch (158:14): [True: 0, False: 39.3k]
  ------------------
  159|      0|            ctx.error = error_code::no_read_input;
  160|      0|            return {0, ctx.error, ctx.custom_error_message};
  161|      0|         }
  162|  39.3k|      }
  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|  39.3k|      ctx.padded_input = check_is_padded(Opts);
  174|       |
  175|  39.3k|      static constexpr auto ParseOpts = parse_opts_for<Opts, Buf>();
  176|       |
  177|  39.3k|      auto [it, end] = read_iterators<ParseOpts>(buffer);
  178|  39.3k|      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|  39.3k|      if constexpr (requires { ctx.speculation_budget; }) {
  183|  39.3k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  184|  39.3k|         ctx.speculation_budget =
  185|  39.3k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (185:14): [True: 293, False: 39.0k]
  ------------------
  186|  39.3k|      }
  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|  39.3k|      if constexpr (requires { ctx.stream_begin; }) {
  194|  39.3k|         ctx.stream_begin = nullptr;
  195|  39.3k|      }
  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|  39.3k|      parse<Opts.format>::template op<ParseOpts>(value, ctx, it, end);
  201|       |
  202|  39.3k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (202:11): [True: 31.7k, False: 7.60k]
  ------------------
  203|  31.7k|         goto finish;
  204|  31.7k|      }
  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|  39.3k|   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|  39.3k|      finalize_top_level_read<ParseOpts>(ctx, start, it, end);
  225|       |
  226|  39.3k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  227|  7.60k|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEETkNS_10contiguousERKNSt3__16vectorIcNS2_9allocatorIcEEEEEEDaOT0_:
   40|  39.3k|   {
   41|  39.3k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  39.3k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  39.3k|      auto end = it + buffer.size();
   45|       |
   46|  39.3k|      return std::pair{it, end};
   47|  39.3k|   }
_ZN3glz23finalize_top_level_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEETkNS_10is_contextERNS_4yaml12yaml_contextEEEvOT0_PKcS8_S8_:
  131|  39.3k|   {
  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|  39.3k|      finalize_read_context(ctx);
  147|  39.3k|   }
_ZN3glz21finalize_read_contextITkNS_10is_contextERNS_4yaml12yaml_contextEEEvOT_:
  109|   157k|   {
  110|   157k|      settle_partial_read_complete(ctx);
  111|   157k|      settle_end_reached(ctx);
  112|   157k|   }
_ZN3glz28settle_partial_read_completeITkNS_10is_contextERNS_4yaml12yaml_contextEEEvOT_:
  102|   157k|   {
  103|   157k|      if (ctx.error == error_code::partial_read_complete) {
  ------------------
  |  Branch (103:11): [True: 0, False: 157k]
  ------------------
  104|      0|         ctx.error = error_code::none;
  105|      0|      }
  106|   157k|   }
_ZN3glz18settle_end_reachedITkNS_10is_contextERNS_4yaml12yaml_contextEEEvOT_:
   88|   157k|   {
   89|   157k|      if (ctx.error == error_code::end_reached) {
  ------------------
  |  Branch (89:11): [True: 0, False: 157k]
  ------------------
   90|      0|         ctx.error = (ctx.depth == 0) ? error_code::none : error_code::unexpected_end;
  ------------------
  |  Branch (90:22): [True: 0, False: 0]
  ------------------
   91|      0|      }
   92|   157k|   }
_ZN3glz4readITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERKNSt3__16vectorIcNS7_9allocatorIcEEEETkNS_10is_contextERNS1_12yaml_contextEQaa14read_supportedIT0_XdtT_6formatEEnt18is_input_streamingIT1_EEENS_9error_ctxERSG_OSH_OT2_:
  152|  78.6k|   {
  153|  78.6k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  154|       |
  155|  78.6k|      call_scope scope{ctx};
  156|       |
  157|  78.6k|      if constexpr (Opts.format != NDJSON) {
  158|  78.6k|         if (buffer.size() == 0) [[unlikely]] {
  ------------------
  |  Branch (158:14): [True: 0, False: 78.6k]
  ------------------
  159|      0|            ctx.error = error_code::no_read_input;
  160|      0|            return {0, ctx.error, ctx.custom_error_message};
  161|      0|         }
  162|  78.6k|      }
  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|  78.6k|      ctx.padded_input = check_is_padded(Opts);
  174|       |
  175|  78.6k|      static constexpr auto ParseOpts = parse_opts_for<Opts, Buf>();
  176|       |
  177|  78.6k|      auto [it, end] = read_iterators<ParseOpts>(buffer);
  178|  78.6k|      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|  78.6k|      if constexpr (requires { ctx.speculation_budget; }) {
  183|  78.6k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  184|  78.6k|         ctx.speculation_budget =
  185|  78.6k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (185:14): [True: 588, False: 78.0k]
  ------------------
  186|  78.6k|      }
  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|  78.6k|      if constexpr (requires { ctx.stream_begin; }) {
  194|  78.6k|         ctx.stream_begin = nullptr;
  195|  78.6k|      }
  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|  78.6k|      parse<Opts.format>::template op<ParseOpts>(value, ctx, it, end);
  201|       |
  202|  78.6k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (202:11): [True: 70.1k, False: 8.45k]
  ------------------
  203|  70.1k|         goto finish;
  204|  70.1k|      }
  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|  78.6k|   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|  78.6k|      finalize_top_level_read<ParseOpts>(ctx, start, it, end);
  225|       |
  226|  78.6k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  227|  8.45k|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEETkNS_10contiguousERKNSt3__16vectorIcNS3_9allocatorIcEEEEEEDaOT0_:
   40|  78.6k|   {
   41|  78.6k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  78.6k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  78.6k|      auto end = it + buffer.size();
   45|       |
   46|  78.6k|      return std::pair{it, end};
   47|  78.6k|   }
_ZN3glz23finalize_top_level_readITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEETkNS_10is_contextERNS1_12yaml_contextEEEvOT0_PKcS8_S8_:
  131|   117k|   {
  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|   117k|      finalize_read_context(ctx);
  147|   117k|   }
_ZN3glz4readITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERNSt3__16vectorIcNS7_9allocatorIcEEEETkNS_10is_contextERNS1_12yaml_contextEQaa14read_supportedIT0_XdtT_6formatEEnt18is_input_streamingIT1_EEENS_9error_ctxERSF_OSG_OT2_:
  152|  39.3k|   {
  153|  39.3k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  154|       |
  155|  39.3k|      call_scope scope{ctx};
  156|       |
  157|  39.3k|      if constexpr (Opts.format != NDJSON) {
  158|  39.3k|         if (buffer.size() == 0) [[unlikely]] {
  ------------------
  |  Branch (158:14): [True: 0, False: 39.3k]
  ------------------
  159|      0|            ctx.error = error_code::no_read_input;
  160|      0|            return {0, ctx.error, ctx.custom_error_message};
  161|      0|         }
  162|  39.3k|      }
  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|  39.3k|      ctx.padded_input = check_is_padded(Opts);
  174|       |
  175|  39.3k|      static constexpr auto ParseOpts = parse_opts_for<Opts, Buf>();
  176|       |
  177|  39.3k|      auto [it, end] = read_iterators<ParseOpts>(buffer);
  178|  39.3k|      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|  39.3k|      if constexpr (requires { ctx.speculation_budget; }) {
  183|  39.3k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  184|  39.3k|         ctx.speculation_budget =
  185|  39.3k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (185:14): [True: 295, False: 39.0k]
  ------------------
  186|  39.3k|      }
  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|  39.3k|      if constexpr (requires { ctx.stream_begin; }) {
  194|  39.3k|         ctx.stream_begin = nullptr;
  195|  39.3k|      }
  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|  39.3k|      parse<Opts.format>::template op<ParseOpts>(value, ctx, it, end);
  201|       |
  202|  39.3k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (202:11): [True: 38.4k, False: 851]
  ------------------
  203|  38.4k|         goto finish;
  204|  38.4k|      }
  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|  39.3k|   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|  39.3k|      finalize_top_level_read<ParseOpts>(ctx, start, it, end);
  225|       |
  226|  39.3k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  227|    851|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEETkNS_10contiguousERNSt3__16vectorIcNS3_9allocatorIcEEEEEEDaOT0_:
   40|  39.3k|   {
   41|  39.3k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  39.3k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  39.3k|      auto end = it + buffer.size();
   45|       |
   46|  39.3k|      return std::pair{it, end};
   47|  39.3k|   }

_ZN3glz5writeITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_13output_bufferENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEQ15write_supportedIT0_XdtT_6formatEEEENS_9error_ctxEOSE_RT1_:
   93|  4.01M|   {
   94|  4.01M|      context ctx{};
   95|  4.01M|      return write<Opts>(std::forward<T>(value), buffer, ctx);
   96|  4.01M|   }
_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|  4.01M|   {
   19|  4.01M|      using traits = buffer_traits<std::remove_cvref_t<Buffer>>;
   20|  4.01M|      call_scope scope{ctx};
   21|       |
   22|  4.01M|      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|  4.01M|         if (buffer.size() < 2 * write_padding_bytes) {
  ------------------
  |  Branch (24:14): [True: 4.01M, False: 0]
  ------------------
   25|  4.01M|            resize_unfilled(buffer, 2 * write_padding_bytes);
   26|  4.01M|         }
   27|  4.01M|      }
   28|  4.01M|      size_t ix = 0; // overwrite index
   29|  4.01M|      to<Opts.format, std::remove_cvref_t<T>>::template op<Opts>(std::forward<T>(value), ctx, buffer, ix);
   30|       |
   31|  4.01M|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (31:11): [True: 0, False: 4.01M]
  ------------------
   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|  4.01M|      traits::finalize(buffer, ix);
   43|  4.01M|      return {ix, error_code::none, ctx.custom_error_message};
   44|  4.01M|   }

_ZN3glz11write_chars2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj128EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEETkNS_5num_tERdTkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
  205|   937k|      {
  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|   937k|         using V = std::decay_t<decltype(value)>;
  220|       |
  221|   937k|         if constexpr (std::floating_point<V>) {
  222|   937k|            using opts_type = std::decay_t<decltype(Opts)>;
  223|   937k|            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|   937k|            else if constexpr (is_any_of<V, float, double>) {
  319|   937k|               const auto start = reinterpret_cast<char*>(&b[ix]);
  320|   937k|               const auto end = glz::to_chars(start, value);
  321|   937k|               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|   937k|      }

_ZN3glz9sweethash7sweet32ITkNS0_16contiguous_rangeENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEEjRKT_j:
  270|  5.82M|   {
  271|  5.82M|      return sweet32(static_cast<const void*>(s.data()), s.size(), seed);
  272|  5.82M|   }
_ZN3glz9sweethash7sweet32EPKvmj:
  154|  5.82M|   {
  155|  5.82M|      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|  5.82M|      if (len <= 8) {
  ------------------
  |  Branch (158:11): [True: 5.02M, False: 802k]
  ------------------
  159|  5.02M|         uint64_t v = 0;
  160|  5.02M|         switch (len) {
  161|  75.7k|         case 8:
  ------------------
  |  Branch (161:10): [True: 75.7k, False: 4.94M]
  ------------------
  162|  75.7k|            std::memcpy(&v, p, 8);
  163|  75.7k|            break;
  164|   162k|         case 7:
  ------------------
  |  Branch (164:10): [True: 162k, False: 4.86M]
  ------------------
  165|   162k|            std::memcpy(&v, p, 7);
  166|   162k|            break;
  167|   125k|         case 6:
  ------------------
  |  Branch (167:10): [True: 125k, False: 4.89M]
  ------------------
  168|   125k|            std::memcpy(&v, p, 6);
  169|   125k|            break;
  170|   230k|         case 5:
  ------------------
  |  Branch (170:10): [True: 230k, False: 4.79M]
  ------------------
  171|   230k|            std::memcpy(&v, p, 5);
  172|   230k|            break;
  173|   509k|         case 4:
  ------------------
  |  Branch (173:10): [True: 509k, False: 4.51M]
  ------------------
  174|   509k|            std::memcpy(&v, p, 4);
  175|   509k|            break;
  176|   805k|         case 3:
  ------------------
  |  Branch (176:10): [True: 805k, False: 4.21M]
  ------------------
  177|   805k|            std::memcpy(&v, p, 3);
  178|   805k|            break;
  179|  1.43M|         case 2:
  ------------------
  |  Branch (179:10): [True: 1.43M, False: 3.59M]
  ------------------
  180|  1.43M|            std::memcpy(&v, p, 2);
  181|  1.43M|            break;
  182|  1.32M|         case 1:
  ------------------
  |  Branch (182:10): [True: 1.32M, False: 3.70M]
  ------------------
  183|  1.32M|            v = p[0];
  184|  1.32M|            break;
  185|   362k|         default:
  ------------------
  |  Branch (185:10): [True: 362k, False: 4.66M]
  ------------------
  186|   362k|            break;
  187|  5.02M|         }
  188|  5.02M|         v = v ^ seed ^ (len + 1);
  189|  5.02M|         return static_cast<uint32_t>(v) ^ static_cast<uint32_t>(v >> 32);
  190|  5.02M|      }
  191|       |
  192|       |      // Full hash for inputs > 8 bytes
  193|   802k|      uint64_t seed64 = (static_cast<uint64_t>(seed) << 32) | static_cast<uint64_t>(seed);
  194|   802k|      uint64_t h = (seed64 ^ prime4) + (len * prime1);
  195|   802k|      const uint8_t* const end = p + len;
  196|       |
  197|   802k|      if (len >= 32) {
  ------------------
  |  Branch (197:11): [True: 252k, False: 549k]
  ------------------
  198|   252k|         uint64_t h1 = h;
  199|   252k|         uint64_t h2 = (seed64 * prime2) ^ prime3;
  200|   252k|         uint64_t h3 = (seed64 * prime3) ^ prime4;
  201|   252k|         uint64_t h4 = (seed64 * prime4) ^ prime5;
  202|       |
  203|  1.98M|         do {
  204|  1.98M|            uint64_t k1, k2, k3, k4;
  205|  1.98M|            std::memcpy(&k1, p, 8);
  206|  1.98M|            std::memcpy(&k2, p + 8, 8);
  207|  1.98M|            std::memcpy(&k3, p + 16, 8);
  208|  1.98M|            std::memcpy(&k4, p + 24, 8);
  209|       |
  210|  1.98M|            k1 = k1 * prime2;
  211|  1.98M|            k1 = k1 ^ (k1 >> 47);
  212|  1.98M|            h1 = h1 ^ k1;
  213|  1.98M|            h1 = h1 * prime1;
  214|       |
  215|  1.98M|            k2 = k2 * prime3;
  216|  1.98M|            k2 = k2 ^ (k2 >> 47);
  217|  1.98M|            h2 = h2 ^ k2;
  218|  1.98M|            h2 = h2 * prime2;
  219|       |
  220|  1.98M|            k3 = k3 * prime4;
  221|  1.98M|            k3 = k3 ^ (k3 >> 47);
  222|  1.98M|            h3 = h3 ^ k3;
  223|  1.98M|            h3 = h3 * prime3;
  224|       |
  225|  1.98M|            k4 = k4 * prime5;
  226|  1.98M|            k4 = k4 ^ (k4 >> 47);
  227|  1.98M|            h4 = h4 ^ k4;
  228|  1.98M|            h4 = h4 * prime4;
  229|       |
  230|  1.98M|            p = p + 32;
  231|  1.98M|            len = len - 32;
  232|  1.98M|         } while (len >= 32);
  ------------------
  |  Branch (232:19): [True: 1.72M, False: 252k]
  ------------------
  233|       |
  234|   252k|         h = h1 + h2 + h3 + h4;
  235|   252k|      }
  236|       |
  237|  1.94M|      while (len >= 8) {
  ------------------
  |  Branch (237:14): [True: 1.14M, False: 802k]
  ------------------
  238|  1.14M|         uint64_t k;
  239|  1.14M|         std::memcpy(&k, p, 8);
  240|  1.14M|         k = k * prime2;
  241|  1.14M|         k = k ^ (k >> 47);
  242|  1.14M|         h = h ^ k;
  243|  1.14M|         h = h * prime1;
  244|  1.14M|         p = p + 8;
  245|  1.14M|         len = len - 8;
  246|  1.14M|      }
  247|       |
  248|   802k|      if (len > 0) {
  ------------------
  |  Branch (248:11): [True: 713k, False: 88.2k]
  ------------------
  249|   713k|         uint64_t k;
  250|   713k|         std::memcpy(&k, end - 8, 8);
  251|   713k|         k = k * prime2;
  252|   713k|         k = k ^ (k >> 47);
  253|   713k|         k = k * prime3;
  254|   713k|         h = h ^ k;
  255|   713k|      }
  256|       |
  257|   802k|      h = mix64(h);
  258|   802k|      return static_cast<uint32_t>(h) ^ static_cast<uint32_t>(h >> 32);
  259|  5.82M|   }
_ZN3glz9sweethash5mix64Em:
   33|   802k|   {
   34|   802k|      v = v ^ (v >> 33);
   35|   802k|      v = v * prime2;
   36|   802k|      v = v ^ (v >> 29);
   37|   802k|      v = v * prime3;
   38|   802k|      return v;
   39|   802k|   }

_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEC2Ev:
  379|  33.8M|      generic_json() = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEED2Ev:
  131|  59.9M|      ~generic_json() = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEaSEDn:
  272|    186|      {
  273|    186|         data = value;
  274|    186|         return *this;
  275|    186|      }
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEaSEOS3_:
  383|  6.60M|      generic_json& operator=(generic_json&&) = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEC2EOS3_:
  382|  26.0M|      generic_json(generic_json&& other) noexcept : data(std::move(other.data)) {}
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEixITkNSt3__114convertible_toINS5_17basic_string_viewIcNS5_11char_traitsIcEEEEEERNS5_12basic_stringIcS9_NS5_9allocatorIcEEEEEERS3_OT_:
  245|  53.8k|      {
  246|  53.8k|         if (holds<null_t>()) data = object_t{};
  ------------------
  |  Branch (246:14): [True: 53.8k, False: 0]
  ------------------
  247|  53.8k|         auto* object = std::get_if<object_t>(&data);
  248|  53.8k|         if (!object) [[unlikely]] {
  ------------------
  |  Branch (248:14): [True: 0, False: 53.8k]
  ------------------
  249|      0|            key_type_mismatch(key);
  250|      0|         }
  251|  53.8k|         auto iter = object->find(key);
  252|  53.8k|         if (iter == object->end()) {
  ------------------
  |  Branch (252:14): [True: 53.8k, False: 0]
  ------------------
  253|  53.8k|            iter = object->insert(std::make_pair(std::string(key), generic_json{})).first;
  254|  53.8k|         }
  255|  53.8k|         return iter->second;
  256|  53.8k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE5holdsIDnEEbv:
  224|  3.90M|      {
  225|  3.90M|         return std::holds_alternative<T>(data);
  226|  3.90M|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE7is_nullEv:
  459|  3.85M|      [[nodiscard]] bool is_null() const noexcept { return holds<std::nullptr_t>(); }
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEPT_v:
  176|  4.81M|      {
  177|  4.81M|         return std::get_if<T>(&data);
  178|  4.81M|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE4sizeEv:
  575|  16.9k|      {
  576|  16.9k|         if (auto* v = get_if<object_t>()) {
  ------------------
  |  Branch (576:20): [True: 8.84k, False: 8.07k]
  ------------------
  577|  8.84k|            return v->size();
  578|  8.84k|         }
  579|  8.07k|         else if (auto* v = get_if<array_t>()) {
  ------------------
  |  Branch (579:25): [True: 2.05k, False: 6.01k]
  ------------------
  580|  2.05k|            return v->size();
  581|  2.05k|         }
  582|  6.01k|         else if (auto* v = get_if<std::string>()) {
  ------------------
  |  Branch (582:25): [True: 3.24k, False: 2.77k]
  ------------------
  583|  3.24k|            return v->size();
  584|  3.24k|         }
  585|  2.77k|         else {
  586|  2.77k|            return 0;
  587|  2.77k|         }
  588|  16.9k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINS2_IS3_EEEEPKT_v:
  182|  16.9k|      {
  183|  16.9k|         return std::get_if<T>(&data);
  184|  16.9k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__16vectorIS3_NS5_9allocatorIS3_EEEEEEPKT_v:
  182|  8.07k|      {
  183|  8.07k|         return std::get_if<T>(&data);
  184|  8.07k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEPKT_v:
  182|  6.01k|      {
  183|  6.01k|         return std::get_if<T>(&data);
  184|  6.01k|      }

_ZN3glz10write_jsonITkNS_15write_supportedIL_ZNS_4JSONEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_13output_bufferERNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEENS_9error_ctxEOT_OT0_:
 2831|  4.01M|   {
 2832|  4.01M|      return write<opts{}>(std::forward<T>(value), std::forward<Buffer>(buffer));
 2833|  4.01M|   }
_ZN3glz2toILj10ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS4_TkNS_10is_contextERNS_7contextERNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERmEEvOT0_OT1_OT2_OT3_:
  525|  17.2M|      {
  526|  17.2M|         using V = std::remove_cvref_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  527|  17.2M|         to<JSON, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  528|  17.2M|                                        std::forward<Ctx>(ctx), std::forward<B>(b), std::forward<IX>(ix));
  529|  17.2M|      }
_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|  17.2M|      {
 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|  17.2M|         std::visit(
 1965|  17.2M|            [&](auto&& val) {
 1966|  17.2M|               using V = std::decay_t<decltype(val)>;
 1967|       |
 1968|  17.2M|               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1969|  17.2M|                             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|  17.2M|                  if (missing_id(value, ctx)) {
 1980|  17.2M|                     return;
 1981|  17.2M|                  }
 1982|  17.2M|                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1983|  17.2M|                  if constexpr (Opts.prettify) {
 1984|  17.2M|                     dump("{\n", b, ix);
 1985|  17.2M|                     ctx.depth += check_indentation_width(Opts);
 1986|  17.2M|                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1987|  17.2M|                     dump('"', b, ix);
 1988|  17.2M|                     dump_maybe_empty(tag_v<T>, b, ix);
 1989|  17.2M|                     if constexpr (std::integral<id_type>) {
 1990|  17.2M|                        dump("\": ", b, ix);
 1991|  17.2M|                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1992|  17.2M|                     }
 1993|  17.2M|                     else {
 1994|  17.2M|                        dump("\": \"", b, ix);
 1995|  17.2M|                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1996|  17.2M|                        dump('"', b, ix);
 1997|  17.2M|                     }
 1998|  17.2M|                     const auto pos_after_tag = ix;
 1999|  17.2M|                     dump(",\n", b, ix);
 2000|  17.2M|                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2001|  17.2M|                     const auto pos_body_start = ix;
 2002|  17.2M|                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2003|  17.2M|                     if (ix == pos_body_start) {
 2004|  17.2M|                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2005|  17.2M|                     }
 2006|  17.2M|                     ctx.depth -= check_indentation_width(Opts);
 2007|  17.2M|                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2008|  17.2M|                        return;
 2009|  17.2M|                     }
 2010|  17.2M|                     std::memcpy(&b[ix], "\n", 1);
 2011|  17.2M|                     ++ix;
 2012|  17.2M|                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2013|  17.2M|                     ix += ctx.depth;
 2014|  17.2M|                     std::memcpy(&b[ix], "}", 1);
 2015|  17.2M|                     ++ix;
 2016|  17.2M|                  }
 2017|  17.2M|                  else {
 2018|  17.2M|                     dump("{\"", b, ix);
 2019|  17.2M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2020|  17.2M|                     if constexpr (std::integral<id_type>) {
 2021|  17.2M|                        dump("\":", b, ix);
 2022|  17.2M|                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2023|  17.2M|                     }
 2024|  17.2M|                     else {
 2025|  17.2M|                        dump("\":\"", b, ix);
 2026|  17.2M|                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2027|  17.2M|                        dump('"', b, ix);
 2028|  17.2M|                     }
 2029|  17.2M|                     const auto pos_after_tag = ix;
 2030|  17.2M|                     dump(',', b, ix);
 2031|  17.2M|                     const auto pos_body_start = ix;
 2032|  17.2M|                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2033|  17.2M|                     if (ix == pos_body_start) {
 2034|  17.2M|                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2035|  17.2M|                     }
 2036|  17.2M|                     dump('}', b, ix);
 2037|  17.2M|                  }
 2038|  17.2M|               }
 2039|  17.2M|               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2040|  17.2M|                                  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|  17.2M|                  if (missing_id(value, ctx)) {
 2044|  17.2M|                     return;
 2045|  17.2M|                  }
 2046|  17.2M|                  if constexpr (Opts.prettify) {
 2047|  17.2M|                     dump("{\n", b, ix);
 2048|  17.2M|                     ctx.depth += check_indentation_width(Opts);
 2049|  17.2M|                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2050|  17.2M|                     dump('"', b, ix);
 2051|  17.2M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2052|  17.2M|                     dump("\": ", b, ix);
 2053|  17.2M|                     write_id<Opts>(value, ctx, b, ix);
 2054|  17.2M|                     ctx.depth -= check_indentation_width(Opts);
 2055|  17.2M|                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2056|  17.2M|                        return;
 2057|  17.2M|                     }
 2058|  17.2M|                     std::memcpy(&b[ix], "\n", 1);
 2059|  17.2M|                     ++ix;
 2060|  17.2M|                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2061|  17.2M|                     ix += ctx.depth;
 2062|  17.2M|                     std::memcpy(&b[ix], "}", 1);
 2063|  17.2M|                     ++ix;
 2064|  17.2M|                  }
 2065|  17.2M|                  else {
 2066|  17.2M|                     dump("{\"", b, ix);
 2067|  17.2M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2068|  17.2M|                     dump("\":", b, ix);
 2069|  17.2M|                     write_id<Opts>(value, ctx, b, ix);
 2070|  17.2M|                     dump('}', b, ix);
 2071|  17.2M|                  }
 2072|  17.2M|               }
 2073|  17.2M|               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2074|  17.2M|                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2075|  17.2M|                                  (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|  17.2M|                  if (missing_id(value, ctx)) {
 2081|  17.2M|                     return;
 2082|  17.2M|                  }
 2083|  17.2M|                  constexpr auto N = []() {
 2084|  17.2M|                     if constexpr (is_memory_object<V>) {
 2085|  17.2M|                        return reflect<memory_type<V>>::size;
 2086|  17.2M|                     }
 2087|  17.2M|                     else {
 2088|  17.2M|                        return reflect<V>::size;
 2089|  17.2M|                     }
 2090|  17.2M|                  }();
 2091|       |
 2092|       |                  // must first write out type
 2093|  17.2M|                  if constexpr (Opts.prettify) {
 2094|  17.2M|                     dump("{\n", b, ix);
 2095|  17.2M|                     ctx.depth += check_indentation_width(Opts);
 2096|  17.2M|                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2097|  17.2M|                     dump('"', b, ix);
 2098|  17.2M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2099|       |
 2100|  17.2M|                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2101|       |
 2102|  17.2M|                     if constexpr (std::integral<id_type>) {
 2103|  17.2M|                        dump("\": ", b, ix);
 2104|  17.2M|                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2105|  17.2M|                        if constexpr (N > 0) {
 2106|  17.2M|                           dump(",\n", b, ix);
 2107|  17.2M|                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2108|  17.2M|                        }
 2109|  17.2M|                     }
 2110|  17.2M|                     else {
 2111|  17.2M|                        dump("\": \"", b, ix);
 2112|  17.2M|                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2113|  17.2M|                        if constexpr (N == 0) {
 2114|  17.2M|                           dump('"', b, ix);
 2115|  17.2M|                        }
 2116|  17.2M|                        else {
 2117|  17.2M|                           dump("\",\n", b, ix);
 2118|  17.2M|                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2119|  17.2M|                        }
 2120|  17.2M|                     }
 2121|  17.2M|                  }
 2122|  17.2M|                  else {
 2123|  17.2M|                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2124|       |
 2125|  17.2M|                     dump("{\"", b, ix);
 2126|  17.2M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2127|       |
 2128|  17.2M|                     if constexpr (std::integral<id_type>) {
 2129|  17.2M|                        dump("\":", b, ix);
 2130|  17.2M|                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2131|  17.2M|                        if constexpr (N > 0) {
 2132|  17.2M|                           dump(',', b, ix);
 2133|  17.2M|                        }
 2134|  17.2M|                     }
 2135|  17.2M|                     else {
 2136|  17.2M|                        dump("\":\"", b, ix);
 2137|  17.2M|                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2138|  17.2M|                        if constexpr (N == 0) {
 2139|  17.2M|                           dump('"', b, ix);
 2140|  17.2M|                        }
 2141|  17.2M|                        else {
 2142|  17.2M|                           dump("\",", b, ix);
 2143|  17.2M|                        }
 2144|  17.2M|                     }
 2145|  17.2M|                  }
 2146|  17.2M|                  if constexpr (is_memory_object<V>) {
 2147|  17.2M|                     if (!val) [[unlikely]] {
 2148|  17.2M|                        ctx.error = error_code::invalid_variant_object;
 2149|  17.2M|                        return;
 2150|  17.2M|                     }
 2151|  17.2M|                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2152|  17.2M|                  }
 2153|  17.2M|                  else {
 2154|  17.2M|                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2155|  17.2M|                  }
 2156|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2157|  17.2M|                  if constexpr (Opts.skip_null_members) {
 2158|  17.2M|                     if (b[ix - 1] == ',') {
 2159|  17.2M|                        --ix;
 2160|  17.2M|                     }
 2161|  17.2M|                  }
 2162|       |
 2163|  17.2M|                  if constexpr (Opts.prettify) {
 2164|  17.2M|                     ctx.depth -= check_indentation_width(Opts);
 2165|  17.2M|                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2166|  17.2M|                        return;
 2167|  17.2M|                     }
 2168|  17.2M|                     std::memcpy(&b[ix], "\n", 1);
 2169|  17.2M|                     ++ix;
 2170|  17.2M|                     fill_bytes(&b[ix], check_indentation_char(Opts), ctx.depth);
 2171|  17.2M|                     ix += ctx.depth;
 2172|  17.2M|                     std::memcpy(&b[ix], "}", 1);
 2173|  17.2M|                     ++ix;
 2174|  17.2M|                  }
 2175|  17.2M|                  else {
 2176|  17.2M|                     dump('}', b, ix);
 2177|  17.2M|                  }
 2178|  17.2M|               }
 2179|  17.2M|               else {
 2180|  17.2M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|  17.2M|               }
 2182|  17.2M|            },
 2183|  17.2M|            value);
 2184|  17.2M|      }
_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|  7.13M|            [&](auto&& val) {
 1966|  7.13M|               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|  7.13M|               else {
 2180|  7.13M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|  7.13M|               }
 2182|  7.13M|            },
_ZN3glz2toILj10EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERDnTkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
 1849|  7.13M|      {
 1850|  7.13M|         if constexpr (not check_write_unchecked(Opts)) {
 1851|  7.13M|            if (!ensure_space(ctx, b, ix + 4)) [[unlikely]] {
  ------------------
  |  Branch (1851:17): [True: 0, False: 7.13M]
  ------------------
 1852|      0|               return;
 1853|      0|            }
 1854|  7.13M|         }
 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|  7.13M|         else {
 1860|  7.13M|            static constexpr uint32_t null_v = 1819047278;
 1861|  7.13M|            std::memcpy(&b[ix], &null_v, 4);
 1862|  7.13M|         }
 1863|  7.13M|         ix += 4;
 1864|  7.13M|      }
_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|   937k|            [&](auto&& val) {
 1966|   937k|               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|   937k|               else {
 2180|   937k|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|   937k|               }
 2182|   937k|            },
_ZN3glz2toILj10EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERdTkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
  814|   937k|      {
  815|   937k|         if constexpr (not check_write_unchecked(Opts)) {
  816|   937k|            static_assert(required_padding<T>());
  817|   937k|            if (!ensure_space(ctx, b, ix + required_padding<T>())) [[unlikely]] {
  ------------------
  |  Branch (817:17): [True: 0, False: 937k]
  ------------------
  818|      0|               return;
  819|      0|            }
  820|   937k|         }
  821|       |
  822|   937k|         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|   937k|         else {
  832|   937k|            write_chars::op<O>(value, ctx, b, ix);
  833|   937k|         }
  834|   937k|      }
_ZN3glz16required_paddingIdEEmv:
  538|   937k|   {
  539|   937k|      constexpr auto value = []() -> size_t {
  540|   937k|         if constexpr (boolean_like<T>) {
  541|   937k|            return 8;
  542|   937k|         }
  543|   937k|         else if constexpr (num_t<T>) {
  544|   937k|            if constexpr (std::floating_point<T>) {
  545|   937k|               if constexpr (sizeof(T) > 8) {
  546|   937k|                  return 64;
  547|   937k|               }
  548|   937k|               else if constexpr (sizeof(T) > 4) {
  549|       |                  // zmij scratch + 4 for optional quotes and trailing comma.
  550|   937k|                  return zmij::double_buffer_size + 4;
  551|   937k|               }
  552|   937k|               else {
  553|   937k|                  return zmij::float_buffer_size + 4;
  554|   937k|               }
  555|   937k|            }
  556|   937k|            else if constexpr (sizeof(T) > 4) {
  557|   937k|               return 24;
  558|   937k|            }
  559|   937k|            else if constexpr (sizeof(T) > 2) {
  560|   937k|               return 16;
  561|   937k|            }
  562|   937k|            else {
  563|   937k|               return 8;
  564|   937k|            }
  565|   937k|         }
  566|   937k|         else if constexpr (nullable_like<T>) {
  567|   937k|            if constexpr (has_value_type<T>) {
  568|   937k|               return required_padding<typename T::value_type>();
  569|   937k|            }
  570|   937k|            else if constexpr (has_element_type<T>) {
  571|   937k|               return required_padding<typename T::element_type>();
  572|   937k|            }
  573|   937k|            else {
  574|   937k|               return 0;
  575|   937k|            }
  576|   937k|         }
  577|   937k|         else if constexpr (always_null_t<T>) {
  578|   937k|            return 8;
  579|   937k|         }
  580|   937k|         else {
  581|   937k|            return 0;
  582|   937k|         }
  583|   937k|      }();
  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|   937k|      return value;
  591|   937k|   }
_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|  1.70M|            [&](auto&& val) {
 1966|  1.70M|               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.70M|               else {
 2180|  1.70M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|  1.70M|               }
 2182|  1.70M|            },
_ZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_SB_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
  845|  1.70M|      {
  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.70M|         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.70M|            else {
  945|  1.70M|               const sv str = [&]() -> const sv {
  946|  1.70M|                  if constexpr (array_char_t<T>) {
  947|  1.70M|                     return sv{value.data(), value.size()};
  948|  1.70M|                  }
  949|  1.70M|                  else if constexpr (u8str_t<T>) {
  950|  1.70M|                     return sv{reinterpret_cast<const char*>(value.data()), value.size()};
  951|  1.70M|                  }
  952|  1.70M|                  else {
  953|  1.70M|                     return str_view<T>(value);
  954|  1.70M|                  }
  955|  1.70M|               }();
  956|  1.70M|               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.70M|               else {
  988|       |                  // Using the original sizing
  989|  1.70M|                  if (!ensure_space(ctx, b, ix + 10 + 2 * n)) [[unlikely]] {
  ------------------
  |  Branch (989:23): [True: 0, False: 1.70M]
  ------------------
  990|      0|                     return;
  991|      0|                  }
  992|  1.70M|               }
  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.70M|               else {
 1002|  1.70M|                  std::memcpy(&b[ix], "\"", 1);
 1003|  1.70M|                  ++ix;
 1004|       |
 1005|  1.70M|                  const auto* c = str.data();
 1006|  1.70M|                  const auto* const e = c + n;
 1007|  1.70M|                  const auto start = &b[ix];
 1008|  1.70M|                  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.70M|                  auto write_escape = [&]() {
 1017|  1.70M|                     if constexpr (check_escape_control_characters(Opts)) {
 1018|  1.70M|                        if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
 1019|  1.70M|                           std::memcpy(data, &escaped, 2);
 1020|  1.70M|                           data += 2;
 1021|  1.70M|                        }
 1022|  1.70M|                        else {
 1023|  1.70M|                           char unicode_escape[6] = {'\\', 'u', '0', '0', '0', '0'};
 1024|  1.70M|                           constexpr char hex_digits[] = "0123456789ABCDEF";
 1025|  1.70M|                           unicode_escape[4] = hex_digits[(uint8_t(*c) >> 4) & 0xF];
 1026|  1.70M|                           unicode_escape[5] = hex_digits[uint8_t(*c) & 0xF];
 1027|  1.70M|                           std::memcpy(data, unicode_escape, 6);
 1028|  1.70M|                           data += 6;
 1029|  1.70M|                        }
 1030|  1.70M|                     }
 1031|  1.70M|                     else {
 1032|  1.70M|                        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.70M|                           if (char_escape_table[uint8_t(*c)] == 0) [[unlikely]] {
 1039|  1.70M|                              ctx.error = error_code::invalid_control_character;
 1040|  1.70M|                           }
 1041|  1.70M|                        }
 1042|  1.70M|                        std::memcpy(data, &char_escape_table[uint8_t(*c)], 2);
 1043|  1.70M|                        data += 2;
 1044|  1.70M|                     }
 1045|  1.70M|                     ++c;
 1046|  1.70M|                  };
 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.70M|#if defined(GLZ_USE_SSE2)
 1055|  1.70M|                  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.70M|                  if (n > 7) {
  ------------------
  |  Branch (1061:23): [True: 655k, False: 1.04M]
  ------------------
 1062|  1.23M|                     for (const auto end_m7 = e - 7; c < end_m7;) {
  ------------------
  |  Branch (1062:54): [True: 580k, False: 655k]
  ------------------
 1063|   580k|                        std::memcpy(data, c, 8);
 1064|   580k|                        uint64_t swar;
 1065|   580k|                        std::memcpy(&swar, c, 8);
 1066|       |                        if constexpr (std::endian::native == std::endian::big) {
 1067|       |                           swar = std::byteswap(swar);
 1068|       |                        }
 1069|       |
 1070|   580k|                        constexpr uint64_t lo7_mask = repeat_byte8(0b01111111);
 1071|   580k|                        const uint64_t lo7 = swar & lo7_mask;
 1072|   580k|                        const uint64_t quote = (lo7 ^ repeat_byte8('"')) + lo7_mask;
 1073|   580k|                        const uint64_t backslash = (lo7 ^ repeat_byte8('\\')) + lo7_mask;
 1074|   580k|                        const uint64_t less_32 = (swar & repeat_byte8(0b01100000)) + lo7_mask;
 1075|   580k|                        uint64_t next = ~((quote & backslash & less_32) | swar);
 1076|       |
 1077|   580k|                        next &= repeat_byte8(0b10000000);
 1078|   580k|                        if (next == 0) {
  ------------------
  |  Branch (1078:29): [True: 366k, False: 214k]
  ------------------
 1079|   366k|                           data += 8;
 1080|   366k|                           c += 8;
 1081|   366k|                           continue;
 1082|   366k|                        }
 1083|       |
 1084|   214k|                        const auto length = (countr_zero(next) >> 3);
 1085|   214k|                        c += length;
 1086|   214k|                        data += length;
 1087|   214k|                        write_escape();
 1088|   214k|                     }
 1089|   655k|                  }
 1090|       |
 1091|       |                  // Scalar tail
 1092|  5.78M|                  for (; c < e; ++c) {
  ------------------
  |  Branch (1092:26): [True: 4.08M, False: 1.70M]
  ------------------
 1093|  4.08M|                     if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
  ------------------
  |  Branch (1093:79): [True: 197k, False: 3.88M]
  ------------------
 1094|   197k|                        std::memcpy(data, &escaped, 2);
 1095|   197k|                        data += 2;
 1096|   197k|                     }
 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|  3.88M|                     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|  3.88M|                        std::memcpy(data, c, 1);
 1118|  3.88M|                        ++data;
 1119|  3.88M|                     }
 1120|  4.08M|                  }
 1121|       |
 1122|  1.70M|                  ix += size_t(data - start);
 1123|       |
 1124|  1.70M|                  std::memcpy(&b[ix], "\"", 1);
 1125|  1.70M|                  ++ix;
 1126|  1.70M|               }
 1127|  1.70M|            }
 1128|  1.70M|         }
 1129|  1.70M|      }
_ZZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_SB_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlvE_clEv:
  945|  1.70M|               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.70M|                  else {
  953|  1.70M|                     return str_view<T>(value);
  954|  1.70M|                  }
  955|  1.70M|               }();
_ZZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_SB_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlvE0_clEv:
 1016|   665k|                  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|   665k|                     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|   665k|                        std::memcpy(data, &char_escape_table[uint8_t(*c)], 2);
 1043|   665k|                        data += 2;
 1044|   665k|                     }
 1045|   665k|                     ++c;
 1046|   665k|                  };
_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|   162k|            [&](auto&& val) {
 1966|   162k|               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|   162k|               else {
 2180|   162k|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|   162k|               }
 2182|   162k|            },
_ZN3glz2toILj10EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEETkNS_10is_contextERNS_7contextEmEEvbOT1_OT0_RT2_:
  777|   162k|      {
  778|   162k|         static constexpr auto checked = not check_write_unchecked(Opts);
  779|   162k|         if constexpr (checked) {
  780|   162k|            if (!ensure_space(ctx, b, ix + 8)) [[unlikely]] {
  ------------------
  |  Branch (780:17): [True: 0, False: 162k]
  ------------------
  781|      0|               return;
  782|      0|            }
  783|   162k|         }
  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|   162k|         else {
  795|   162k|            if (value) {
  ------------------
  |  Branch (795:17): [True: 55.4k, False: 107k]
  ------------------
  796|  55.4k|               std::memcpy(&b[ix], "true", 4);
  797|  55.4k|               ix += 4;
  798|  55.4k|            }
  799|   107k|            else {
  800|   107k|               std::memcpy(&b[ix], "false", 5);
  801|   107k|               ix += 5;
  802|   107k|            }
  803|   162k|         }
  804|   162k|      }
_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|  1.01M|            [&](auto&& val) {
 1966|  1.01M|               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.01M|               else {
 2180|  1.01M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|  1.01M|               }
 2182|  1.01M|            },
_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|  1.01M|      {
 1436|  1.01M|         if (empty_range(value)) {
  ------------------
  |  Branch (1436:14): [True: 100k, False: 916k]
  ------------------
 1437|   100k|            dump("[]", b, ix);
 1438|   100k|         }
 1439|   916k|         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|   916k|            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|   916k|               else {
 1547|   916k|                  if (!ensure_space(ctx, b, ix + write_padding_bytes)) [[unlikely]] {
  ------------------
  |  Branch (1547:23): [True: 0, False: 916k]
  ------------------
 1548|      0|                     return;
 1549|      0|                  }
 1550|   916k|                  std::memcpy(&b[ix], "[", 1);
 1551|   916k|                  ++ix;
 1552|   916k|               }
 1553|       |
 1554|      0|               auto it = std::begin(value);
 1555|   916k|               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|   916k|               else {
 1560|   916k|                  to<JSON, val_t>::template op<Opts>(*it, ctx, b, ix);
 1561|   916k|                  if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1561:23): [True: 0, False: 916k]
  ------------------
 1562|      0|                     return;
 1563|      0|                  }
 1564|   916k|               }
 1565|       |
 1566|   916k|               ++it;
 1567|  1.38M|               for (const auto fin = std::end(value); it != fin; ++it) {
  ------------------
  |  Branch (1567:55): [True: 473k, False: 916k]
  ------------------
 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|   473k|                  else {
 1603|   473k|                     write_array_entry_separator<Opts>(ctx, b, ix);
 1604|   473k|                     to<JSON, val_t>::template op<Opts>(*it, ctx, b, ix);
 1605|   473k|                     if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1605:26): [True: 0, False: 473k]
  ------------------
 1606|      0|                        return;
 1607|      0|                     }
 1608|   473k|                  }
 1609|   473k|               }
 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|   916k|               dump(']', b, ix);
 1616|   916k|            }
 1617|   916k|         }
 1618|  1.01M|      }
_ZN3glz27write_array_entry_separatorITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEELb1ERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextERNS_7contextEmEEvOT2_OT1_RT3_:
 1362|   473k|   {
 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|   473k|      else {
 1379|   473k|         if constexpr (minified_check) {
 1380|   473k|            if (!ensure_space(ctx, b, ix + 1)) [[unlikely]] {
  ------------------
  |  Branch (1380:17): [True: 0, False: 473k]
  ------------------
 1381|      0|               return;
 1382|      0|            }
 1383|   473k|         }
 1384|   473k|         std::memcpy(&b[ix], ",", 1);
 1385|   473k|         ++ix;
 1386|   473k|      }
 1387|       |      if constexpr (is_output_streaming<B>) {
 1388|       |         flush_buffer(b, ix);
 1389|       |      }
 1390|   473k|   }
_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|  6.27M|            [&](auto&& val) {
 1966|  6.27M|               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|  6.27M|               else {
 2180|  6.27M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2181|  6.27M|               }
 2182|  6.27M|            },
_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|  6.27M|      {
 1624|  6.27M|         if constexpr (not check_opening_handled(Opts)) {
 1625|  6.27M|            dump('{', b, ix);
 1626|  6.27M|         }
 1627|       |
 1628|  6.27M|         if (!empty_range(value)) {
  ------------------
  |  Branch (1628:14): [True: 6.16M, False: 113k]
  ------------------
 1629|  6.16M|            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|  6.16M|            }
 1641|       |
 1642|  6.16M|            using val_t = detail::iterator_second_type<T>; // the type of value in each [key, value] pair
 1643|  6.16M|            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|  6.16M|               else {
 1682|  6.16M|                  auto write_first_entry = [&](auto&& it) {
 1683|  6.16M|                     auto&& [key, entry_val] = *it;
 1684|  6.16M|                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1685|  6.16M|                  };
 1686|       |
 1687|  6.16M|                  auto it = std::begin(value);
 1688|  6.16M|                  write_first_entry(it);
 1689|  6.16M|                  if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1689:23): [True: 0, False: 6.16M]
  ------------------
 1690|      0|                     return;
 1691|      0|                  }
 1692|  6.16M|                  ++it;
 1693|  11.8M|                  for (const auto end = std::end(value); it != end; ++it) {
  ------------------
  |  Branch (1693:58): [True: 5.66M, False: 6.16M]
  ------------------
 1694|  5.66M|                     auto&& [key, entry_val] = *it;
 1695|  5.66M|                     write_object_entry_separator<Opts>(ctx, b, ix);
 1696|  5.66M|                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1697|  5.66M|                     if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1697:26): [True: 0, False: 5.66M]
  ------------------
 1698|      0|                        return;
 1699|      0|                     }
 1700|  5.66M|                  }
 1701|  6.16M|               }
 1702|  6.16M|            }
 1703|       |
 1704|  6.16M|            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|  6.16M|            }
 1716|  6.16M|         }
 1717|       |
 1718|  6.27M|         if constexpr (!check_closing_handled(Opts)) {
 1719|  6.27M|            dump('}', b, ix);
 1720|  6.27M|         }
 1721|  6.27M|      }
_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|  6.16M|                  auto write_first_entry = [&](auto&& it) {
 1683|  6.16M|                     auto&& [key, entry_val] = *it;
 1684|  6.16M|                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1685|  6.16M|                  };
_ZN3glz28write_object_entry_separatorITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEELb1ERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextERNS_7contextEmQooeqdtT_6formatL_ZNS_4JSONEEeqdtT_6formatL_ZNS_6NDJSONEEEEvOT2_OT1_RT3_:
  158|  5.66M|   {
  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|  5.66M|      else {
  169|  5.66M|         if constexpr (minified_check) {
  170|  5.66M|            if (!ensure_space(ctx, b, ix + 1)) [[unlikely]] {
  ------------------
  |  Branch (170:17): [True: 0, False: 5.66M]
  ------------------
  171|      0|               return;
  172|      0|            }
  173|  5.66M|         }
  174|  5.66M|         std::memcpy(&b[ix], ",", 1);
  175|  5.66M|         ++ix;
  176|  5.66M|      }
  177|       |      if constexpr (is_output_streaming<B>) {
  178|       |         flush_buffer(b, ix);
  179|       |      }
  180|  5.66M|   }
_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|  11.8M|   {
 1396|       |      if constexpr (str_t<Key> || char_t<Key> || is_named_enum<Key> || mimics_str_t<Key> || custom_str_t<Key> ||
 1397|  11.8M|                    check_quoted_num(Opts)) {
 1398|  11.8M|         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|  11.8M|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1406:11): [True: 0, False: 11.8M]
  ------------------
 1407|      0|         return;
 1408|      0|      }
 1409|       |      if constexpr (Opts.prettify) {
 1410|       |         dump(": ", b, ix);
 1411|       |      }
 1412|  11.8M|      else {
 1413|  11.8M|         dump(':', b, ix);
 1414|  11.8M|      }
 1415|       |
 1416|  11.8M|      using V = core_t<decltype(value)>;
 1417|  11.8M|      to<JSON, V>::template op<opening_and_closing_handled_off<Opts>()>(value, ctx, b, ix);
 1418|  11.8M|   }
_ZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_RKS7_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
  845|  11.8M|      {
  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|  11.8M|         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|  11.8M|            else {
  945|  11.8M|               const sv str = [&]() -> const sv {
  946|  11.8M|                  if constexpr (array_char_t<T>) {
  947|  11.8M|                     return sv{value.data(), value.size()};
  948|  11.8M|                  }
  949|  11.8M|                  else if constexpr (u8str_t<T>) {
  950|  11.8M|                     return sv{reinterpret_cast<const char*>(value.data()), value.size()};
  951|  11.8M|                  }
  952|  11.8M|                  else {
  953|  11.8M|                     return str_view<T>(value);
  954|  11.8M|                  }
  955|  11.8M|               }();
  956|  11.8M|               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|  11.8M|               else {
  988|       |                  // Using the original sizing
  989|  11.8M|                  if (!ensure_space(ctx, b, ix + 10 + 2 * n)) [[unlikely]] {
  ------------------
  |  Branch (989:23): [True: 0, False: 11.8M]
  ------------------
  990|      0|                     return;
  991|      0|                  }
  992|  11.8M|               }
  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|  11.8M|               else {
 1002|  11.8M|                  std::memcpy(&b[ix], "\"", 1);
 1003|  11.8M|                  ++ix;
 1004|       |
 1005|  11.8M|                  const auto* c = str.data();
 1006|  11.8M|                  const auto* const e = c + n;
 1007|  11.8M|                  const auto start = &b[ix];
 1008|  11.8M|                  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|  11.8M|                  auto write_escape = [&]() {
 1017|  11.8M|                     if constexpr (check_escape_control_characters(Opts)) {
 1018|  11.8M|                        if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
 1019|  11.8M|                           std::memcpy(data, &escaped, 2);
 1020|  11.8M|                           data += 2;
 1021|  11.8M|                        }
 1022|  11.8M|                        else {
 1023|  11.8M|                           char unicode_escape[6] = {'\\', 'u', '0', '0', '0', '0'};
 1024|  11.8M|                           constexpr char hex_digits[] = "0123456789ABCDEF";
 1025|  11.8M|                           unicode_escape[4] = hex_digits[(uint8_t(*c) >> 4) & 0xF];
 1026|  11.8M|                           unicode_escape[5] = hex_digits[uint8_t(*c) & 0xF];
 1027|  11.8M|                           std::memcpy(data, unicode_escape, 6);
 1028|  11.8M|                           data += 6;
 1029|  11.8M|                        }
 1030|  11.8M|                     }
 1031|  11.8M|                     else {
 1032|  11.8M|                        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|  11.8M|                           if (char_escape_table[uint8_t(*c)] == 0) [[unlikely]] {
 1039|  11.8M|                              ctx.error = error_code::invalid_control_character;
 1040|  11.8M|                           }
 1041|  11.8M|                        }
 1042|  11.8M|                        std::memcpy(data, &char_escape_table[uint8_t(*c)], 2);
 1043|  11.8M|                        data += 2;
 1044|  11.8M|                     }
 1045|  11.8M|                     ++c;
 1046|  11.8M|                  };
 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|  11.8M|#if defined(GLZ_USE_SSE2)
 1055|  11.8M|                  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|  11.8M|                  if (n > 7) {
  ------------------
  |  Branch (1061:23): [True: 5.02M, False: 6.80M]
  ------------------
 1062|  11.2M|                     for (const auto end_m7 = e - 7; c < end_m7;) {
  ------------------
  |  Branch (1062:54): [True: 6.25M, False: 5.02M]
  ------------------
 1063|  6.25M|                        std::memcpy(data, c, 8);
 1064|  6.25M|                        uint64_t swar;
 1065|  6.25M|                        std::memcpy(&swar, c, 8);
 1066|       |                        if constexpr (std::endian::native == std::endian::big) {
 1067|       |                           swar = std::byteswap(swar);
 1068|       |                        }
 1069|       |
 1070|  6.25M|                        constexpr uint64_t lo7_mask = repeat_byte8(0b01111111);
 1071|  6.25M|                        const uint64_t lo7 = swar & lo7_mask;
 1072|  6.25M|                        const uint64_t quote = (lo7 ^ repeat_byte8('"')) + lo7_mask;
 1073|  6.25M|                        const uint64_t backslash = (lo7 ^ repeat_byte8('\\')) + lo7_mask;
 1074|  6.25M|                        const uint64_t less_32 = (swar & repeat_byte8(0b01100000)) + lo7_mask;
 1075|  6.25M|                        uint64_t next = ~((quote & backslash & less_32) | swar);
 1076|       |
 1077|  6.25M|                        next &= repeat_byte8(0b10000000);
 1078|  6.25M|                        if (next == 0) {
  ------------------
  |  Branch (1078:29): [True: 1.93M, False: 4.32M]
  ------------------
 1079|  1.93M|                           data += 8;
 1080|  1.93M|                           c += 8;
 1081|  1.93M|                           continue;
 1082|  1.93M|                        }
 1083|       |
 1084|  4.32M|                        const auto length = (countr_zero(next) >> 3);
 1085|  4.32M|                        c += length;
 1086|  4.32M|                        data += length;
 1087|  4.32M|                        write_escape();
 1088|  4.32M|                     }
 1089|  5.02M|                  }
 1090|       |
 1091|       |                  // Scalar tail
 1092|  48.0M|                  for (; c < e; ++c) {
  ------------------
  |  Branch (1092:26): [True: 36.2M, False: 11.8M]
  ------------------
 1093|  36.2M|                     if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
  ------------------
  |  Branch (1093:79): [True: 1.39M, False: 34.8M]
  ------------------
 1094|  1.39M|                        std::memcpy(data, &escaped, 2);
 1095|  1.39M|                        data += 2;
 1096|  1.39M|                     }
 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|  34.8M|                     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|  34.8M|                        std::memcpy(data, c, 1);
 1118|  34.8M|                        ++data;
 1119|  34.8M|                     }
 1120|  36.2M|                  }
 1121|       |
 1122|  11.8M|                  ix += size_t(data - start);
 1123|       |
 1124|  11.8M|                  std::memcpy(&b[ix], "\"", 1);
 1125|  11.8M|                  ++ix;
 1126|  11.8M|               }
 1127|  11.8M|            }
 1128|  11.8M|         }
 1129|  11.8M|      }
_ZZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_RKS7_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlvE_clEv:
  945|  11.8M|               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|  11.8M|                  else {
  953|  11.8M|                     return str_view<T>(value);
  954|  11.8M|                  }
  955|  11.8M|               }();
_ZZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_RKS7_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlvE0_clEv:
 1016|  3.52G|                  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|  3.52G|                     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|  3.52G|                        std::memcpy(data, &char_escape_table[uint8_t(*c)], 2);
 1043|  3.52G|                        data += 2;
 1044|  3.52G|                     }
 1045|  3.52G|                     ++c;
 1046|  3.52G|                  };

_ZN3glz6detail18sse2_string_escapeIcRZNS_2toILj10ENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS9_SD_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_EUlvE0_EEvRPKcSR_RPT_mSL_:
   20|  1.70M|   {
   21|       |      // SSE2: 16 bytes at a time with direct comparison instructions
   22|  1.70M|      if (n > 15) {
  ------------------
  |  Branch (22:11): [True: 271k, False: 1.43M]
  ------------------
   23|   271k|         const __m128i quote_vec = _mm_set1_epi8('"');
   24|   271k|         const __m128i bs_vec = _mm_set1_epi8('\\');
   25|   271k|         const __m128i ctrl_mask = _mm_set1_epi8(static_cast<int8_t>(0xE0));
   26|   271k|         const __m128i zero = _mm_setzero_si128();
   27|       |
   28|  2.41M|         for (const char* end_m15 = e - 15; c < end_m15;) {
  ------------------
  |  Branch (28:45): [True: 2.14M, False: 271k]
  ------------------
   29|  2.14M|            __m128i v = _mm_loadu_si128(reinterpret_cast<const __m128i*>(c));
   30|  2.14M|            _mm_storeu_si128(reinterpret_cast<__m128i*>(data), v);
   31|       |
   32|  2.14M|            const uint32_t mask = static_cast<uint32_t>(
   33|  2.14M|               _mm_movemask_epi8(_mm_or_si128(_mm_or_si128(_mm_cmpeq_epi8(v, quote_vec), _mm_cmpeq_epi8(v, bs_vec)),
   34|  2.14M|                                              _mm_cmpeq_epi8(_mm_and_si128(v, ctrl_mask), zero))));
   35|       |
   36|  2.14M|            if (mask == 0) {
  ------------------
  |  Branch (36:17): [True: 1.69M, False: 450k]
  ------------------
   37|  1.69M|               data += 16;
   38|  1.69M|               c += 16;
   39|  1.69M|               continue;
   40|  1.69M|            }
   41|       |
   42|   450k|            const uint32_t length = countr_zero(mask);
   43|   450k|            c += length;
   44|   450k|            data += length;
   45|   450k|            write_escape();
   46|   450k|         }
   47|   271k|      }
   48|  1.70M|   }
_ZN3glz6detail18sse2_string_escapeIcRZNS_2toILj10ENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS9_RKS9_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_EUlvE0_EEvRPKcST_RPT_mSN_:
   20|  11.8M|   {
   21|       |      // SSE2: 16 bytes at a time with direct comparison instructions
   22|  11.8M|      if (n > 15) {
  ------------------
  |  Branch (22:11): [True: 3.39M, False: 8.44M]
  ------------------
   23|  3.39M|         const __m128i quote_vec = _mm_set1_epi8('"');
   24|  3.39M|         const __m128i bs_vec = _mm_set1_epi8('\\');
   25|  3.39M|         const __m128i ctrl_mask = _mm_set1_epi8(static_cast<int8_t>(0xE0));
   26|  3.39M|         const __m128i zero = _mm_setzero_si128();
   27|       |
   28|  3.55G|         for (const char* end_m15 = e - 15; c < end_m15;) {
  ------------------
  |  Branch (28:45): [True: 3.54G, False: 3.39M]
  ------------------
   29|  3.54G|            __m128i v = _mm_loadu_si128(reinterpret_cast<const __m128i*>(c));
   30|  3.54G|            _mm_storeu_si128(reinterpret_cast<__m128i*>(data), v);
   31|       |
   32|  3.54G|            const uint32_t mask = static_cast<uint32_t>(
   33|  3.54G|               _mm_movemask_epi8(_mm_or_si128(_mm_or_si128(_mm_cmpeq_epi8(v, quote_vec), _mm_cmpeq_epi8(v, bs_vec)),
   34|  3.54G|                                              _mm_cmpeq_epi8(_mm_and_si128(v, ctrl_mask), zero))));
   35|       |
   36|  3.54G|            if (mask == 0) {
  ------------------
  |  Branch (36:17): [True: 29.1M, False: 3.52G]
  ------------------
   37|  29.1M|               data += 16;
   38|  29.1M|               c += 16;
   39|  29.1M|               continue;
   40|  29.1M|            }
   41|       |
   42|  3.52G|            const uint32_t length = countr_zero(mask);
   43|  3.52G|            c += length;
   44|  3.52G|            data += length;
   45|  3.52G|            write_escape();
   46|  3.52G|         }
   47|  3.39M|      }
   48|  11.8M|   }

_ZN3glz11countr_zeroEj:
   16|  3.52G|   {
   17|       |#ifdef _MSC_VER
   18|       |      return std::countr_zero(x);
   19|       |#else
   20|  3.52G|#if __has_builtin(__builtin_ctzl)
   21|  3.52G|      return __builtin_ctzl(x);
   22|       |#else
   23|       |      return std::countr_zero(x);
   24|       |#endif
   25|  3.52G|#endif
   26|  3.52G|   }
_ZN3glz11countr_zeroEm:
   29|  4.53M|   {
   30|       |#ifdef _MSC_VER
   31|       |      return std::countr_zero(x);
   32|       |#else
   33|  4.53M|#if __has_builtin(__builtin_ctzll)
   34|  4.53M|      return __builtin_ctzll(x);
   35|       |#else
   36|       |      return std::countr_zero(x);
   37|       |#endif
   38|  4.53M|#endif
   39|  4.53M|   }

_ZN3glz4dumpILb1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvNS1_17basic_string_viewIcS4_EERT0_Rm:
  192|   100k|   {
  193|   100k|      const auto n = str.size();
  194|   100k|      if constexpr (vector_like<B>) {
  195|   100k|         if constexpr (Checked) {
  196|   100k|            const auto k = ix + n;
  197|   100k|            if (ix + n > b.size()) [[unlikely]] {
  ------------------
  |  Branch (197:17): [True: 0, False: 100k]
  ------------------
  198|      0|               grow_buffer(b, k);
  199|      0|            }
  200|   100k|         }
  201|   100k|      }
  202|   100k|      std::memcpy(&b[ix], str.data(), n);
  203|   100k|      ix += n;
  204|   100k|   }
_ZN3glz4dumpILb1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEETkNS_10byte_sizedEcEEvT1_RT0_Rm:
  150|  25.3M|   {
  151|  25.3M|      if constexpr (Checked && vector_like<B>) {
  152|  25.3M|         if (ix == b.size()) [[unlikely]] {
  ------------------
  |  Branch (152:14): [True: 672, False: 25.3M]
  ------------------
  153|    672|            grow_buffer(b, b.size() == 0 ? 64 : ix + 1);
  ------------------
  |  Branch (153:28): [True: 0, False: 672]
  ------------------
  154|    672|         }
  155|  25.3M|      }
  156|  25.3M|      assign_maybe_cast(c, b, ix);
  157|  25.3M|      ++ix;
  158|  25.3M|   }
_ZN3glz17assign_maybe_castITkNS_10byte_sizedEcNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvT_RT0_Rm:
   95|  25.3M|   {
   96|  25.3M|      using V = std::decay_t<decltype(b[0])>;
   97|  25.3M|      using C = std::decay_t<decltype(c)>;
   98|  25.3M|      if constexpr (std::same_as<V, C>) {
   99|  25.3M|         b[ix] = c;
  100|       |      }
  101|       |      else {
  102|       |         b[ix] = static_cast<V>(c);
  103|       |      }
  104|  25.3M|   }

_ZN3glz10fast_float10from_charsIdciEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_12chars_formatE:
 4237|  4.20M|           chars_format fmt /*= chars_format::general*/) noexcept {
 4238|  4.20M|  return from_chars_caller<T>::call(first, last, value,
 4239|  4.20M|                                    parse_options_t<UC>(fmt));
 4240|  4.20M|}
_ZN3glz10fast_float17from_chars_callerIdE4callIcEENS0_19from_chars_result_tIT_EEPKS5_S8_RdNS0_15parse_options_tIS5_EE:
 4195|  4.20M|       parse_options_t<UC> options) noexcept {
 4196|  4.20M|    return from_chars_advanced(first, last, value, options);
 4197|  4.20M|  }
_ZN3glz10fast_float19from_chars_advancedIdcEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_15parse_options_tIS3_EE:
 4443|  4.20M|                    parse_options_t<UC> options) noexcept {
 4444|  4.20M|  return from_chars_advanced_caller<
 4445|  4.20M|      size_t(is_supported_float_type<T>::value) +
 4446|  4.20M|      2 * size_t(is_supported_integer_type<T>::value)>::call(first, last, value,
 4447|  4.20M|                                                             options);
 4448|  4.20M|}
_ZN3glz10fast_float26from_chars_advanced_callerILm1EE4callIdcEENS0_19from_chars_result_tIT0_EEPKS5_S8_RT_NS0_15parse_options_tIS5_EE:
 4426|  4.20M|       parse_options_t<UC> options) noexcept {
 4427|  4.20M|    return from_chars_float_advanced(first, last, value, options);
 4428|  4.20M|  }
_ZN3glz10fast_float25from_chars_float_advancedIdcEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_15parse_options_tIS3_EE:
 4338|  4.20M|                          parse_options_t<UC> options) noexcept {
 4339|       |
 4340|  4.20M|  static_assert(is_supported_float_type<T>::value,
 4341|  4.20M|                "only some floating-point types are supported");
 4342|  4.20M|  static_assert(is_supported_char_type<UC>::value,
 4343|  4.20M|                "only char, wchar_t, char16_t and char32_t are supported");
 4344|       |
 4345|  4.20M|  chars_format const fmt = detail::adjust_for_feature_macros(options.format);
 4346|       |
 4347|  4.20M|  from_chars_result_t<UC> answer;
 4348|  4.20M|  if (uint64_t(fmt & chars_format::skip_white_space)) {
  ------------------
  |  Branch (4348:7): [True: 0, False: 4.20M]
  ------------------
 4349|      0|    while ((first != last) && fast_float::is_space(*first)) {
  ------------------
  |  Branch (4349:12): [True: 0, False: 0]
  |  Branch (4349:31): [True: 0, False: 0]
  ------------------
 4350|      0|      first++;
 4351|      0|    }
 4352|      0|  }
 4353|  4.20M|  if (first == last) {
  ------------------
  |  Branch (4353:7): [True: 1.22k, False: 4.20M]
  ------------------
 4354|  1.22k|    answer.ec = std::errc::invalid_argument;
 4355|  1.22k|    answer.ptr = first;
 4356|  1.22k|    return answer;
 4357|  1.22k|  }
 4358|  4.20M|  parsed_number_string_t<UC> pns =
 4359|  4.20M|      uint64_t(fmt & detail::basic_json_fmt)
  ------------------
  |  Branch (4359:7): [True: 0, False: 4.20M]
  ------------------
 4360|  4.20M|          ? parse_number_string<true, UC>(first, last, options)
 4361|  4.20M|          : parse_number_string<false, UC>(first, last, options);
 4362|  4.20M|  if (!pns.valid) {
  ------------------
  |  Branch (4362:7): [True: 253k, False: 3.95M]
  ------------------
 4363|   253k|    if (uint64_t(fmt & chars_format::no_infnan)) {
  ------------------
  |  Branch (4363:9): [True: 0, False: 253k]
  ------------------
 4364|      0|      answer.ec = std::errc::invalid_argument;
 4365|      0|      answer.ptr = first;
 4366|      0|      return answer;
 4367|   253k|    } else {
 4368|   253k|      return detail::parse_infnan(first, last, value, fmt);
 4369|   253k|    }
 4370|   253k|  }
 4371|       |
 4372|       |  // call overload that takes parsed_number_string_t directly.
 4373|  3.95M|  return from_chars_advanced(pns, value);
 4374|  4.20M|}
_ZN3glz10fast_float6detail25adjust_for_feature_macrosENS0_12chars_formatE:
 1375|  8.40M|constexpr chars_format adjust_for_feature_macros(chars_format fmt) {
 1376|  8.40M|  return fmt
 1377|       |#ifdef GLZ_FASTFLOAT_ALLOWS_LEADING_PLUS
 1378|       |         | chars_format::allow_leading_plus
 1379|       |#endif
 1380|       |#ifdef GLZ_FASTFLOAT_SKIP_WHITE_SPACE
 1381|       |         | chars_format::skip_white_space
 1382|       |#endif
 1383|  8.40M|      ;
 1384|  8.40M|}
_ZN3glz10fast_floatanENS0_12chars_formatES1_:
 1340|  28.8M|constexpr chars_format operator&(chars_format lhs, chars_format rhs) noexcept {
 1341|  28.8M|  using int_type = std::underlying_type<chars_format>::type;
 1342|  28.8M|  return static_cast<chars_format>(static_cast<int_type>(lhs) &
 1343|  28.8M|                                   static_cast<int_type>(rhs));
 1344|  28.8M|}
_ZN3glz10fast_float4spanIKcEC2Ev:
  438|  8.91M|  constexpr span() : ptr(nullptr), length(0) {}
_ZN3glz10fast_float18report_parse_errorIcEENS0_22parsed_number_string_tIT_EEPKS3_NS0_11parse_errorE:
 1727|   253k|report_parse_error(UC const *p, parse_error error) {
 1728|   253k|  parsed_number_string_t<UC> answer;
 1729|   253k|  answer.valid = false;
 1730|   253k|  answer.lastmatch = p;
 1731|   253k|  answer.error = error;
 1732|   253k|  return answer;
 1733|   253k|}
_ZN3glz10fast_float10is_integerIcEEbT_:
 1481|   614k|fastfloat_really_inline constexpr bool is_integer(UC c) noexcept {
 1482|   614k|  return !(c > UC('9') || c < UC('0'));
  ------------------
  |  Branch (1482:12): [True: 10.7k, False: 603k]
  |  Branch (1482:27): [True: 7.32k, False: 596k]
  ------------------
 1483|   614k|}
_ZN3glz10fast_float11digit_valueIcEEmT_:
 1489|  16.0M|fastfloat_really_inline constexpr uint64_t digit_value(UC c) noexcept {
 1490|  16.0M|  return uint64_t(uint8_t(c) - uint8_t('0'));
 1491|  16.0M|}
_ZN3glz10fast_float4spanIKcEC2EPS2_m:
  436|  4.44M|  constexpr span(T const *_ptr, size_t _length) : ptr(_ptr), length(_length) {}
_ZN3glz10fast_float26loop_parse_if_eight_digitsERPKcS2_Rm:
 1679|   249k|                           uint64_t &i) {
 1680|       |  // optimizes better than parse_if_eight_digits_unrolled() for UC = char.
 1681|   609k|  while ((std::distance(p, pend) >= 8) &&
  ------------------
  |  Branch (1681:10): [True: 404k, False: 205k]
  ------------------
 1682|   404k|         is_made_of_eight_digits_fast(read8_to_u64(p))) {
  ------------------
  |  Branch (1682:10): [True: 359k, False: 44.3k]
  ------------------
 1683|   359k|    i = i * 100000000 +
 1684|   359k|        parse_eight_digits_unrolled(read8_to_u64(
 1685|   359k|            p)); // in rare cases, this will overflow, but that's ok
 1686|   359k|    p += 8;
 1687|   359k|  }
 1688|   249k|}
_ZN3glz10fast_float28is_made_of_eight_digits_fastEm:
 1597|   404k|is_made_of_eight_digits_fast(uint64_t val) noexcept {
 1598|   404k|  return !((((val + 0x4646464646464646) | (val - 0x3030303030303030)) &
 1599|   404k|            0x8080808080808080));
 1600|   404k|}
_ZN3glz10fast_float12read8_to_u64IcEEmPKT_:
 1503|  1.03M|read8_to_u64(UC const *chars) {
 1504|  1.03M|  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.03M|  uint64_t val;
 1513|  1.03M|  ::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.03M|  return val;
 1519|  1.03M|}
_ZN3glz10fast_float27parse_eight_digits_unrolledEm:
 1575|   625k|parse_eight_digits_unrolled(uint64_t val) {
 1576|   625k|  uint64_t const mask = 0x000000FF000000FF;
 1577|   625k|  uint64_t const mul1 = 0x000F424000000064; // 100 + (1000000ULL << 32)
 1578|   625k|  uint64_t const mul2 = 0x0000271000000001; // 1 + (10000ULL << 32)
 1579|   625k|  val -= 0x3030303030303030;
 1580|   625k|  val = (val * 10) + (val >> 8); // val = (val * 2561) >> 8;
 1581|   625k|  val = (((val & mask) * mul1) + (((val >> 16) & mask) * mul2)) >> 32;
 1582|   625k|  return uint32_t(val);
 1583|   625k|}
_ZNK3glz10fast_float4spanIKcE3lenEv:
  440|  97.2k|  constexpr size_t len() const noexcept { return length; }
_ZN3glz10fast_float19parse_number_stringILb0EcEENS0_22parsed_number_string_tIT0_EEPKS3_S6_NS0_15parse_options_tIS3_EE:
 1740|  4.20M|                    parse_options_t<UC> options) noexcept {
 1741|  4.20M|  chars_format const fmt = detail::adjust_for_feature_macros(options.format);
 1742|  4.20M|  UC const decimal_point = options.decimal_point;
 1743|       |
 1744|  4.20M|  parsed_number_string_t<UC> answer;
 1745|  4.20M|  answer.valid = false;
 1746|  4.20M|  answer.too_many_digits = false;
 1747|       |  // assume p < pend, so dereference without checks;
 1748|  4.20M|  answer.negative = (*p == UC('-'));
 1749|       |  // C++17 20.19.3.(7.1) explicitly forbids '+' sign here
 1750|  4.20M|  if ((*p == UC('-')) || (uint64_t(fmt & chars_format::allow_leading_plus) &&
  ------------------
  |  Branch (1750:7): [True: 16.3k, False: 4.18M]
  |  Branch (1750:27): [True: 0, False: 4.18M]
  ------------------
 1751|  16.3k|                          !basic_json_fmt && *p == UC('+'))) {
  ------------------
  |  Branch (1751:27): [True: 0, Folded]
  |  Branch (1751:46): [True: 0, False: 0]
  ------------------
 1752|  16.3k|    ++p;
 1753|  16.3k|    if (p == pend) {
  ------------------
  |  Branch (1753:9): [True: 934, False: 15.4k]
  ------------------
 1754|    934|      return report_parse_error<UC>(
 1755|    934|          p, parse_error::missing_integer_or_dot_after_sign);
 1756|    934|    }
 1757|  15.4k|    GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  15.4k|#define GLZ_FASTFLOAT_IF_CONSTEXPR17(x) if constexpr (x)
  ------------------
 1758|  15.4k|      if (!is_integer(*p)) { // a sign must be followed by an integer
 1759|  15.4k|        return report_parse_error<UC>(p,
 1760|  15.4k|                                      parse_error::missing_integer_after_sign);
 1761|  15.4k|      }
 1762|  15.4k|    }
 1763|  15.4k|    else {
 1764|  15.4k|      if (!is_integer(*p) &&
  ------------------
  |  Branch (1764:11): [True: 7.39k, False: 8.06k]
  ------------------
 1765|  7.39k|          (*p !=
  ------------------
  |  Branch (1765:11): [True: 2.68k, False: 4.71k]
  ------------------
 1766|  7.39k|           decimal_point)) { // a sign must be followed by an integer or the dot
 1767|  2.68k|        return report_parse_error<UC>(
 1768|  2.68k|            p, parse_error::missing_integer_or_dot_after_sign);
 1769|  2.68k|      }
 1770|  15.4k|    }
 1771|  15.4k|  }
 1772|  4.20M|  UC const *const start_digits = p;
 1773|       |
 1774|  4.20M|  uint64_t i = 0; // an unsigned int avoids signed overflows (which are bad)
 1775|       |
 1776|  4.20M|  uint64_t digit;
 1777|  19.4M|  while ((p != pend) && (digit = digit_value(*p)) <= 9) {
  ------------------
  |  Branch (1777:10): [True: 15.8M, False: 3.61M]
  |  Branch (1777:25): [True: 15.2M, False: 585k]
  ------------------
 1778|       |    // a multiplication by 10 is cheaper than an arbitrary integer
 1779|       |    // multiplication
 1780|  15.2M|    i = 10 * i + digit; // might overflow, we will handle the overflow later
 1781|  15.2M|    ++p;
 1782|  15.2M|  }
 1783|  4.20M|  UC const *const end_of_integer_part = p;
 1784|  4.20M|  int64_t digit_count = int64_t(end_of_integer_part - start_digits);
 1785|  4.20M|  answer.integer = span<UC const>(start_digits, size_t(digit_count));
 1786|  4.20M|  GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  4.20M|#define GLZ_FASTFLOAT_IF_CONSTEXPR17(x) if constexpr (x)
  ------------------
 1787|       |    // at least 1 digit in integer part, without leading zeros
 1788|       |    if (digit_count == 0) {
 1789|       |      return report_parse_error<UC>(p, parse_error::no_digits_in_integer_part);
 1790|       |    }
 1791|       |    if ((start_digits[0] == UC('0') && digit_count > 1)) {
 1792|       |      return report_parse_error<UC>(start_digits,
 1793|       |                                    parse_error::leading_zeros_in_integer_part);
 1794|       |    }
 1795|       |  }
 1796|       |
 1797|  4.20M|  int64_t exponent = 0;
 1798|  4.20M|  bool const has_decimal_point = (p != pend) && (*p == decimal_point);
  ------------------
  |  Branch (1798:34): [True: 585k, False: 3.61M]
  |  Branch (1798:49): [True: 249k, False: 335k]
  ------------------
 1799|  4.20M|  if (has_decimal_point) {
  ------------------
  |  Branch (1799:7): [True: 249k, False: 3.95M]
  ------------------
 1800|   249k|    ++p;
 1801|   249k|    UC const *before = p;
 1802|       |    // can occur at most twice without overflowing, but let it occur more, since
 1803|       |    // for integers with many digits, digit parsing is the primary bottleneck.
 1804|   249k|    loop_parse_if_eight_digits(p, pend, i);
 1805|       |
 1806|   343k|    while ((p != pend) && (digit = digit_value(*p)) <= 9) {
  ------------------
  |  Branch (1806:12): [True: 226k, False: 116k]
  |  Branch (1806:27): [True: 93.2k, False: 133k]
  ------------------
 1807|  93.2k|      ++p;
 1808|  93.2k|      i = i * 10 + digit; // in rare cases, this will overflow, but that's ok
 1809|  93.2k|    }
 1810|   249k|    exponent = before - p;
 1811|   249k|    answer.fraction = span<UC const>(before, size_t(p - before));
 1812|   249k|    digit_count -= exponent;
 1813|   249k|  }
 1814|  4.20M|  GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  4.20M|#define GLZ_FASTFLOAT_IF_CONSTEXPR17(x) if constexpr (x)
  ------------------
 1815|       |    // at least 1 digit in fractional part
 1816|       |    if (has_decimal_point && exponent == 0) {
 1817|       |      return report_parse_error<UC>(p,
 1818|       |                                    parse_error::no_digits_in_fractional_part);
 1819|       |    }
 1820|       |  }
 1821|  4.20M|  else if (digit_count == 0) { // we must have encountered at least one integer!
  ------------------
  |  Branch (1821:12): [True: 249k, False: 3.95M]
  ------------------
 1822|   249k|    return report_parse_error<UC>(p, parse_error::no_digits_in_mantissa);
 1823|   249k|  }
 1824|  3.95M|  int64_t exp_number = 0; // explicit exponential part
 1825|  4.20M|  if ((uint64_t(fmt & chars_format::scientific) && (p != pend) &&
  ------------------
  |  Branch (1825:8): [True: 3.95M, False: 252k]
  |  Branch (1825:52): [True: 302k, False: 3.64M]
  ------------------
 1826|   302k|       ((UC('e') == *p) || (UC('E') == *p))) ||
  ------------------
  |  Branch (1826:9): [True: 9.66k, False: 292k]
  |  Branch (1826:28): [True: 14.0k, False: 278k]
  ------------------
 1827|  3.92M|      (uint64_t(fmt & detail::basic_fortran_fmt) && (p != pend) &&
  ------------------
  |  Branch (1827:8): [True: 0, False: 3.92M]
  |  Branch (1827:53): [True: 0, False: 0]
  ------------------
 1828|      0|       ((UC('+') == *p) || (UC('-') == *p) || (UC('d') == *p) ||
  ------------------
  |  Branch (1828:9): [True: 0, False: 0]
  |  Branch (1828:28): [True: 0, False: 0]
  |  Branch (1828:47): [True: 0, False: 0]
  ------------------
 1829|  23.7k|        (UC('D') == *p)))) {
  ------------------
  |  Branch (1829:9): [True: 0, False: 0]
  ------------------
 1830|  23.7k|    UC const *location_of_e = p;
 1831|  23.7k|    if ((UC('e') == *p) || (UC('E') == *p) || (UC('d') == *p) ||
  ------------------
  |  Branch (1831:9): [True: 9.66k, False: 14.0k]
  |  Branch (1831:28): [True: 14.0k, False: 0]
  |  Branch (1831:47): [True: 0, False: 0]
  ------------------
 1832|  23.7k|        (UC('D') == *p)) {
  ------------------
  |  Branch (1832:9): [True: 0, False: 0]
  ------------------
 1833|  23.7k|      ++p;
 1834|  23.7k|    }
 1835|  23.7k|    bool neg_exp = false;
 1836|  23.7k|    if ((p != pend) && (UC('-') == *p)) {
  ------------------
  |  Branch (1836:9): [True: 21.9k, False: 1.77k]
  |  Branch (1836:24): [True: 10.2k, False: 11.7k]
  ------------------
 1837|  10.2k|      neg_exp = true;
 1838|  10.2k|      ++p;
 1839|  13.5k|    } else if ((p != pend) &&
  ------------------
  |  Branch (1839:16): [True: 11.7k, False: 1.77k]
  ------------------
 1840|  11.7k|               (UC('+') ==
  ------------------
  |  Branch (1840:16): [True: 366, False: 11.3k]
  ------------------
 1841|  11.7k|                *p)) { // '+' on exponent is allowed by C++17 20.19.3.(7.1)
 1842|    366|      ++p;
 1843|    366|    }
 1844|  23.7k|    if ((p == pend) || !is_integer(*p)) {
  ------------------
  |  Branch (1844:9): [True: 2.28k, False: 21.4k]
  |  Branch (1844:24): [True: 1.64k, False: 19.8k]
  ------------------
 1845|  3.92k|      if (!uint64_t(fmt & chars_format::fixed)) {
  ------------------
  |  Branch (1845:11): [True: 0, False: 3.92k]
  ------------------
 1846|       |        // The exponential part is invalid for scientific notation, so it must
 1847|       |        // be a trailing token for fixed notation. However, fixed notation is
 1848|       |        // disabled, so report a scientific notation error.
 1849|      0|        return report_parse_error<UC>(p, parse_error::missing_exponential_part);
 1850|      0|      }
 1851|       |      // Otherwise, we will be ignoring the 'e'.
 1852|  3.92k|      p = location_of_e;
 1853|  19.8k|    } else {
 1854|   588k|      while ((p != pend) && is_integer(*p)) {
  ------------------
  |  Branch (1854:14): [True: 577k, False: 10.7k]
  |  Branch (1854:29): [True: 568k, False: 9.03k]
  ------------------
 1855|   568k|        uint8_t exp_digit = uint8_t(*p - UC('0'));
 1856|   568k|        if (exp_number < 0x10000000) {
  ------------------
  |  Branch (1856:13): [True: 62.6k, False: 505k]
  ------------------
 1857|  62.6k|          exp_number = 10 * exp_number + exp_digit;
 1858|  62.6k|        }
 1859|   568k|        ++p;
 1860|   568k|      }
 1861|  19.8k|      if (neg_exp) {
  ------------------
  |  Branch (1861:11): [True: 9.94k, False: 9.87k]
  ------------------
 1862|  9.94k|        exp_number = -exp_number;
 1863|  9.94k|      }
 1864|  19.8k|      exponent += exp_number;
 1865|  19.8k|    }
 1866|  4.17M|  } else {
 1867|       |    // If it scientific and not fixed, we have to bail out.
 1868|  4.17M|    if (uint64_t(fmt & chars_format::scientific) &&
  ------------------
  |  Branch (1868:9): [True: 3.92M, False: 252k]
  ------------------
 1869|  3.92M|        !uint64_t(fmt & chars_format::fixed)) {
  ------------------
  |  Branch (1869:9): [True: 0, False: 3.92M]
  ------------------
 1870|      0|      return report_parse_error<UC>(p, parse_error::missing_exponential_part);
 1871|      0|    }
 1872|  4.17M|  }
 1873|  4.20M|  answer.lastmatch = p;
 1874|  4.20M|  answer.valid = true;
 1875|       |
 1876|       |  // If we frequently had to deal with long strings of digits,
 1877|       |  // we could extend our code by using a 128-bit integer instead
 1878|       |  // of a 64-bit integer. However, this is uncommon.
 1879|       |  //
 1880|       |  // We can deal with up to 19 digits.
 1881|  4.20M|  if (digit_count > 19) { // this is uncommon
  ------------------
  |  Branch (1881:7): [True: 71.4k, False: 4.13M]
  ------------------
 1882|       |    // It is possible that the integer had an overflow.
 1883|       |    // We have to handle the case where we have 0.0000somenumber.
 1884|       |    // We need to be mindful of the case where we only have zeroes...
 1885|       |    // E.g., 0.000000000...000.
 1886|  71.4k|    UC const *start = start_digits;
 1887|  5.43M|    while ((start != pend) && (*start == UC('0') || *start == decimal_point)) {
  ------------------
  |  Branch (1887:12): [True: 5.43M, False: 830]
  |  Branch (1887:32): [True: 5.33M, False: 107k]
  |  Branch (1887:53): [True: 36.4k, False: 70.6k]
  ------------------
 1888|  5.36M|      if (*start == UC('0')) {
  ------------------
  |  Branch (1888:11): [True: 5.33M, False: 36.4k]
  ------------------
 1889|  5.33M|        digit_count--;
 1890|  5.33M|      }
 1891|  5.36M|      start++;
 1892|  5.36M|    }
 1893|       |
 1894|  71.4k|    if (digit_count > 19) {
  ------------------
  |  Branch (1894:9): [True: 66.5k, False: 4.86k]
  ------------------
 1895|  66.5k|      answer.too_many_digits = true;
 1896|       |      // Let us start again, this time, avoiding overflows.
 1897|       |      // We don't need to check if is_integer, since we use the
 1898|       |      // pre-tokenized spans from above.
 1899|  66.5k|      i = 0;
 1900|  66.5k|      p = answer.integer.ptr;
 1901|  66.5k|      UC const *int_end = p + answer.integer.len();
 1902|  66.5k|      uint64_t const minimal_nineteen_digit_integer{1000000000000000000};
 1903|  1.39M|      while ((i < minimal_nineteen_digit_integer) && (p != int_end)) {
  ------------------
  |  Branch (1903:14): [True: 1.33M, False: 55.8k]
  |  Branch (1903:54): [True: 1.32M, False: 10.7k]
  ------------------
 1904|  1.32M|        i = i * 10 + uint64_t(*p - UC('0'));
 1905|  1.32M|        ++p;
 1906|  1.32M|      }
 1907|  66.5k|      if (i >= minimal_nineteen_digit_integer) { // We have a big integers
  ------------------
  |  Branch (1907:11): [True: 55.8k, False: 10.7k]
  ------------------
 1908|  55.8k|        exponent = end_of_integer_part - p + exp_number;
 1909|  55.8k|      } else { // We have a value with a fractional component.
 1910|  10.7k|        p = answer.fraction.ptr;
 1911|  10.7k|        UC const *frac_end = p + answer.fraction.len();
 1912|   154k|        while ((i < minimal_nineteen_digit_integer) && (p != frac_end)) {
  ------------------
  |  Branch (1912:16): [True: 143k, False: 10.7k]
  |  Branch (1912:56): [True: 143k, False: 0]
  ------------------
 1913|   143k|          i = i * 10 + uint64_t(*p - UC('0'));
 1914|   143k|          ++p;
 1915|   143k|        }
 1916|  10.7k|        exponent = answer.fraction.ptr - p + exp_number;
 1917|  10.7k|      }
 1918|       |      // We have now corrected both exponent and i, to a truncated value
 1919|  66.5k|    }
 1920|  71.4k|  }
 1921|  4.20M|  answer.exponent = exponent;
 1922|  4.20M|  answer.mantissa = i;
 1923|  4.20M|  return answer;
 1924|  4.20M|}
_ZN3glz10fast_float6detail12parse_infnanIdcEENS0_19from_chars_result_tIT0_EEPKS4_S7_RT_NS0_12chars_formatE:
 4076|   253k|                                       T &value, chars_format fmt) noexcept {
 4077|   253k|  from_chars_result_t<UC> answer{};
 4078|   253k|  answer.ptr = first;
 4079|   253k|  answer.ec = std::errc(); // be optimistic
 4080|       |  // assume first < last, so dereference without checks;
 4081|   253k|  bool const minusSign = (*first == UC('-'));
 4082|       |  // C++17 20.19.3.(7.1) explicitly forbids '+' sign here
 4083|   253k|  if ((*first == UC('-')) ||
  ------------------
  |  Branch (4083:7): [True: 4.37k, False: 248k]
  ------------------
 4084|   248k|      (uint64_t(fmt & chars_format::allow_leading_plus) &&
  ------------------
  |  Branch (4084:8): [True: 0, False: 248k]
  ------------------
 4085|  4.37k|       (*first == UC('+')))) {
  ------------------
  |  Branch (4085:8): [True: 0, False: 0]
  ------------------
 4086|  4.37k|    ++first;
 4087|  4.37k|  }
 4088|   253k|  if (last - first >= 3) {
  ------------------
  |  Branch (4088:7): [True: 122k, False: 130k]
  ------------------
 4089|   122k|    if (fastfloat_strncasecmp(first, str_const_nan<UC>(), 3)) {
  ------------------
  |  Branch (4089:9): [True: 14.7k, False: 107k]
  ------------------
 4090|  14.7k|      answer.ptr = (first += 3);
 4091|  14.7k|      value = minusSign ? -std::numeric_limits<T>::quiet_NaN()
  ------------------
  |  Branch (4091:15): [True: 60, False: 14.6k]
  ------------------
 4092|  14.7k|                        : std::numeric_limits<T>::quiet_NaN();
 4093|       |      // Check for possible nan(n-char-seq-opt), C++17 20.19.3.7,
 4094|       |      // C11 7.20.1.3.3. At least MSVC produces nan(ind) and nan(snan).
 4095|  14.7k|      if (first != last && *first == UC('(')) {
  ------------------
  |  Branch (4095:11): [True: 14.3k, False: 374]
  |  Branch (4095:28): [True: 13.8k, False: 546]
  ------------------
 4096|  62.7k|        for (UC const *ptr = first + 1; ptr != last; ++ptr) {
  ------------------
  |  Branch (4096:41): [True: 61.0k, False: 1.63k]
  ------------------
 4097|  61.0k|          if (*ptr == UC(')')) {
  ------------------
  |  Branch (4097:15): [True: 502, False: 60.5k]
  ------------------
 4098|    502|            answer.ptr = ptr + 1; // valid nan(n-char-seq-opt)
 4099|    502|            break;
 4100|  60.5k|          } else if (!((UC('a') <= *ptr && *ptr <= UC('z')) ||
  ------------------
  |  Branch (4100:25): [True: 1.04k, False: 59.5k]
  |  Branch (4100:44): [True: 470, False: 578]
  ------------------
 4101|  60.1k|                       (UC('A') <= *ptr && *ptr <= UC('Z')) ||
  ------------------
  |  Branch (4101:25): [True: 48.7k, False: 11.3k]
  |  Branch (4101:44): [True: 48.1k, False: 624]
  ------------------
 4102|  11.9k|                       (UC('0') <= *ptr && *ptr <= UC('9')) || *ptr == UC('_')))
  ------------------
  |  Branch (4102:25): [True: 924, False: 11.0k]
  |  Branch (4102:44): [True: 296, False: 628]
  |  Branch (4102:64): [True: 0, False: 11.6k]
  ------------------
 4103|  11.6k|            break; // forbidden char, not nan(n-char-seq-opt)
 4104|  61.0k|        }
 4105|  13.8k|      }
 4106|  14.7k|      return answer;
 4107|  14.7k|    }
 4108|   107k|    if (fastfloat_strncasecmp(first, str_const_inf<UC>(), 3)) {
  ------------------
  |  Branch (4108:9): [True: 14.6k, False: 93.3k]
  ------------------
 4109|  14.6k|      if ((last - first >= 8) &&
  ------------------
  |  Branch (4109:11): [True: 12.3k, False: 2.25k]
  ------------------
 4110|  12.3k|          fastfloat_strncasecmp(first + 3, str_const_inf<UC>() + 3, 5)) {
  ------------------
  |  Branch (4110:11): [True: 66, False: 12.3k]
  ------------------
 4111|     66|        answer.ptr = first + 8;
 4112|  14.5k|      } else {
 4113|  14.5k|        answer.ptr = first + 3;
 4114|  14.5k|      }
 4115|  14.6k|      value = minusSign ? -std::numeric_limits<T>::infinity()
  ------------------
  |  Branch (4115:15): [True: 1.63k, False: 13.0k]
  ------------------
 4116|  14.6k|                        : std::numeric_limits<T>::infinity();
 4117|  14.6k|      return answer;
 4118|  14.6k|    }
 4119|   107k|  }
 4120|   223k|  answer.ec = std::errc::invalid_argument;
 4121|   223k|  return answer;
 4122|   253k|}
_ZN3glz10fast_float21fastfloat_strncasecmpIcEEbPKT_S4_m:
  417|   243k|                      size_t length) {
  418|   333k|  for (size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (418:22): [True: 304k, False: 29.4k]
  ------------------
  419|   304k|    UC const actual = actual_mixedcase[i];
  420|   304k|    if ((actual < 256 ? actual | 32 : actual) != expected_lowercase[i]) {
  ------------------
  |  Branch (420:9): [True: 213k, False: 90.6k]
  |  Branch (420:10): [True: 304k, False: 0]
  ------------------
  421|   213k|      return false;
  422|   213k|    }
  423|   304k|  }
  424|  29.4k|  return true;
  425|   243k|}
_ZN3glz10fast_float13str_const_nanIcEEPKT_v:
 1186|   122k|template <> constexpr char const *str_const_nan<char>() { return "nan"; }
_ZN3glz10fast_float13str_const_infIcEEPKT_v:
 1206|   120k|template <> constexpr char const *str_const_inf<char>() { return "infinity"; }
_ZN3glz10fast_float19from_chars_advancedIdcEENS0_19from_chars_result_tIT0_EERNS0_22parsed_number_string_tIS3_EERT_:
 4249|  3.95M|from_chars_advanced(parsed_number_string_t<UC> &pns, T &value) noexcept {
 4250|       |
 4251|  3.95M|  static_assert(is_supported_float_type<T>::value,
 4252|  3.95M|                "only some floating-point types are supported");
 4253|  3.95M|  static_assert(is_supported_char_type<UC>::value,
 4254|  3.95M|                "only char, wchar_t, char16_t and char32_t are supported");
 4255|       |
 4256|  3.95M|  from_chars_result_t<UC> answer;
 4257|       |
 4258|  3.95M|  answer.ec = std::errc(); // be optimistic
 4259|  3.95M|  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.95M|  if (binary_format<T>::min_exponent_fast_path() <= pns.exponent &&
  ------------------
  |  Branch (4265:7): [True: 3.93M, False: 10.9k]
  ------------------
 4266|  3.93M|      pns.exponent <= binary_format<T>::max_exponent_fast_path() &&
  ------------------
  |  Branch (4266:7): [True: 3.92M, False: 10.7k]
  ------------------
 4267|  3.92M|      !pns.too_many_digits) {
  ------------------
  |  Branch (4267:7): [True: 3.87M, False: 56.5k]
  ------------------
 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|  3.87M|    if (!cpp20_and_in_constexpr() && detail::rounds_to_nearest()) {
  ------------------
  |  Branch (4275:9): [True: 3.87M, Folded]
  |  Branch (4275:38): [True: 3.87M, False: 0]
  ------------------
 4276|       |      // We have that fegetround() == FE_TONEAREST.
 4277|       |      // Next is Clinger's fast path.
 4278|  3.87M|      if (pns.mantissa <= binary_format<T>::max_mantissa_fast_path()) {
  ------------------
  |  Branch (4278:11): [True: 3.85M, False: 14.1k]
  ------------------
 4279|  3.85M|        value = T(pns.mantissa);
 4280|  3.85M|        if (pns.exponent < 0) {
  ------------------
  |  Branch (4280:13): [True: 36.8k, False: 3.82M]
  ------------------
 4281|  36.8k|          value = value / binary_format<T>::exact_power_of_ten(-pns.exponent);
 4282|  3.82M|        } else {
 4283|  3.82M|          value = value * binary_format<T>::exact_power_of_ten(pns.exponent);
 4284|  3.82M|        }
 4285|  3.85M|        if (pns.negative) {
  ------------------
  |  Branch (4285:13): [True: 10.2k, False: 3.84M]
  ------------------
 4286|  10.2k|          value = -value;
 4287|  10.2k|        }
 4288|  3.85M|        return answer;
 4289|  3.85M|      }
 4290|  3.87M|    } 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|  3.87M|  }
 4313|  92.4k|  adjusted_mantissa am =
 4314|  92.4k|      compute_float<binary_format<T>>(pns.exponent, pns.mantissa);
 4315|  92.4k|  if (pns.too_many_digits && am.power2 >= 0) {
  ------------------
  |  Branch (4315:7): [True: 66.5k, False: 25.8k]
  |  Branch (4315:30): [True: 66.5k, False: 0]
  ------------------
 4316|  66.5k|    if (am != compute_float<binary_format<T>>(pns.exponent, pns.mantissa + 1)) {
  ------------------
  |  Branch (4316:9): [True: 11.7k, False: 54.8k]
  ------------------
 4317|  11.7k|      am = compute_error<binary_format<T>>(pns.exponent, pns.mantissa);
 4318|  11.7k|    }
 4319|  66.5k|  }
 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|  92.4k|  if (am.power2 < 0) {
  ------------------
  |  Branch (4323:7): [True: 11.7k, False: 80.6k]
  ------------------
 4324|  11.7k|    am = digit_comp<T>(pns, am);
 4325|  11.7k|  }
 4326|  92.4k|  to_float(pns.negative, am, value);
 4327|       |  // Test for over/underflow.
 4328|  92.4k|  if ((pns.mantissa != 0 && am.mantissa == 0 && am.power2 == 0) ||
  ------------------
  |  Branch (4328:8): [True: 91.7k, False: 618]
  |  Branch (4328:29): [True: 9.43k, False: 82.3k]
  |  Branch (4328:49): [True: 2.22k, False: 7.20k]
  ------------------
 4329|  90.1k|      am.power2 == binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (4329:7): [True: 1.99k, False: 88.1k]
  ------------------
 4330|  4.22k|    answer.ec = std::errc::result_out_of_range;
 4331|  4.22k|  }
 4332|  92.4k|  return answer;
 4333|  3.95M|}
_ZN3glz10fast_float13binary_formatIdE22min_exponent_fast_pathEv:
  695|  3.95M|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.95M|  return -22;
  700|  3.95M|#endif
  701|  3.95M|}
_ZN3glz10fast_float13binary_formatIdE22max_exponent_fast_pathEv:
  767|  3.93M|inline constexpr int binary_format<double>::max_exponent_fast_path() {
  768|  3.93M|  return 22;
  769|  3.93M|}
_ZN3glz10fast_float6detail17rounds_to_nearestEv:
 4129|  3.87M|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|  3.87M|  static float volatile fmin = (std::numeric_limits<float>::min)();
 4151|  3.87M|  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|  3.87M|#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|  3.87M|  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|  3.87M|}
_ZN3glz10fast_float13binary_formatIdE22max_mantissa_fast_pathEv:
  777|  3.87M|inline constexpr uint64_t binary_format<double>::max_mantissa_fast_path() {
  778|  3.87M|  return uint64_t(2) << mantissa_explicit_bits();
  779|  3.87M|}
_ZN3glz10fast_float13binary_formatIdE22mantissa_explicit_bitsEv:
  713|  4.51M|inline constexpr int binary_format<double>::mantissa_explicit_bits() {
  714|  4.51M|  return 52;
  715|  4.51M|}
_ZN3glz10fast_float13binary_formatIdE18exact_power_of_tenEl:
 1057|  3.85M|binary_format<double>::exact_power_of_ten(int64_t power) {
 1058|       |  // Work around clang bug https://godbolt.org/z/zedh7rrhc
 1059|  3.85M|  return (void)powers_of_ten[0], powers_of_ten[power];
 1060|  3.85M|}
_ZN3glz10fast_float13compute_floatINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElm:
 2852|   158k|compute_float(int64_t q, uint64_t w) noexcept {
 2853|   158k|  adjusted_mantissa answer;
 2854|   158k|  if ((w == 0) || (q < binary::smallest_power_of_ten())) {
  ------------------
  |  Branch (2854:7): [True: 618, False: 158k]
  |  Branch (2854:19): [True: 1.80k, False: 156k]
  ------------------
 2855|  2.42k|    answer.power2 = 0;
 2856|  2.42k|    answer.mantissa = 0;
 2857|       |    // result should be zero
 2858|  2.42k|    return answer;
 2859|  2.42k|  }
 2860|   156k|  if (q > binary::largest_power_of_ten()) {
  ------------------
  |  Branch (2860:7): [True: 2.35k, False: 154k]
  ------------------
 2861|       |    // we want to get infinity:
 2862|  2.35k|    answer.power2 = binary::infinite_power();
 2863|  2.35k|    answer.mantissa = 0;
 2864|  2.35k|    return answer;
 2865|  2.35k|  }
 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|   154k|  int lz = leading_zeroes(w);
 2871|   154k|  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|   154k|  value128 product =
 2880|   154k|      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|   154k|  int upperbit = int(product.high >> 63);
 2891|   154k|  int shift = upperbit + 64 - binary::mantissa_explicit_bits() - 3;
 2892|       |
 2893|   154k|  answer.mantissa = product.high >> shift;
 2894|       |
 2895|   154k|  answer.power2 = int32_t(detail::power(int32_t(q)) + upperbit - lz -
 2896|   154k|                          binary::minimum_exponent());
 2897|   154k|  if (answer.power2 <= 0) { // we have a subnormal?
  ------------------
  |  Branch (2897:7): [True: 13.6k, False: 140k]
  ------------------
 2898|       |    // Here have that answer.power2 <= 0 so -answer.power2 >= 0
 2899|  13.6k|    if (-answer.power2 + 1 >=
  ------------------
  |  Branch (2899:9): [True: 954, False: 12.7k]
  ------------------
 2900|  13.6k|        64) { // if we have more than 64 bits below the minimum exponent, you
 2901|       |              // have a zero for sure.
 2902|    954|      answer.power2 = 0;
 2903|    954|      answer.mantissa = 0;
 2904|       |      // result should be zero
 2905|    954|      return answer;
 2906|    954|    }
 2907|       |    // next line is safe because -answer.power2 + 1 < 64
 2908|  12.7k|    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|  12.7k|    answer.mantissa += (answer.mantissa & 1); // round up
 2913|  12.7k|    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|  12.7k|    answer.power2 =
 2922|  12.7k|        (answer.mantissa < (uint64_t(1) << binary::mantissa_explicit_bits()))
  ------------------
  |  Branch (2922:9): [True: 12.6k, False: 4]
  ------------------
 2923|  12.7k|            ? 0
 2924|  12.7k|            : 1;
 2925|  12.7k|    return answer;
 2926|  13.6k|  }
 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|   140k|  if ((product.low <= 1) && (q >= binary::min_exponent_round_to_even()) &&
  ------------------
  |  Branch (2931:7): [True: 99.7k, False: 40.8k]
  |  Branch (2931:29): [True: 99.1k, False: 584]
  ------------------
 2932|  99.1k|      (q <= binary::max_exponent_round_to_even()) &&
  ------------------
  |  Branch (2932:7): [True: 98.2k, False: 896]
  ------------------
 2933|  98.2k|      ((answer.mantissa & 3) == 1)) { // we may fall between two floats!
  ------------------
  |  Branch (2933:7): [True: 7.37k, False: 90.8k]
  ------------------
 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|  7.37k|    if ((answer.mantissa << shift) == product.high) {
  ------------------
  |  Branch (2939:9): [True: 4.58k, False: 2.78k]
  ------------------
 2940|  4.58k|      answer.mantissa &= ~uint64_t(1); // flip it so that we do not round up
 2941|  4.58k|    }
 2942|  7.37k|  }
 2943|       |
 2944|   140k|  answer.mantissa += (answer.mantissa & 1); // round up
 2945|   140k|  answer.mantissa >>= 1;
 2946|   140k|  if (answer.mantissa >= (uint64_t(2) << binary::mantissa_explicit_bits())) {
  ------------------
  |  Branch (2946:7): [True: 5.53k, False: 135k]
  ------------------
 2947|  5.53k|    answer.mantissa = (uint64_t(1) << binary::mantissa_explicit_bits());
 2948|  5.53k|    answer.power2++; // undo previous addition
 2949|  5.53k|  }
 2950|       |
 2951|   140k|  answer.mantissa &= ~(uint64_t(1) << binary::mantissa_explicit_bits());
 2952|   140k|  if (answer.power2 >= binary::infinite_power()) { // infinity
  ------------------
  |  Branch (2952:7): [True: 446, False: 140k]
  ------------------
 2953|    446|    answer.power2 = binary::infinite_power();
 2954|    446|    answer.mantissa = 0;
 2955|    446|  }
 2956|   140k|  return answer;
 2957|   154k|}
_ZN3glz10fast_float17adjusted_mantissaC2Ev:
  568|   182k|  adjusted_mantissa() = default;
_ZN3glz10fast_float13binary_formatIdE21smallest_power_of_tenEv:
 1077|   158k|inline constexpr int binary_format<double>::smallest_power_of_ten() {
 1078|   158k|  return -342;
 1079|   158k|}
_ZN3glz10fast_float13binary_formatIdE20largest_power_of_tenEv:
 1068|   156k|template <> inline constexpr int binary_format<double>::largest_power_of_ten() {
 1069|   156k|  return 308;
 1070|   156k|}
_ZN3glz10fast_float14leading_zeroesEm:
  488|   173k|leading_zeroes(uint64_t input_num) {
  489|   173k|  assert(input_num > 0);
  ------------------
  |  Branch (489:3): [True: 173k, False: 0]
  ------------------
  490|   173k|  if (cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (490:7): [Folded, False: 173k]
  ------------------
  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|   173k|  return __builtin_clzll(input_num);
  505|   173k|#endif
  506|   173k|}
_ZN3glz10fast_float29compute_product_approximationILi55EEENS0_8value128Elm:
 2771|   165k|compute_product_approximation(int64_t q, uint64_t w) {
 2772|   165k|  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|   165k|  value128 firstproduct =
 2777|   165k|      full_multiplication(w, powers::power_of_five_128[index]);
 2778|   165k|  static_assert((bit_precision >= 0) && (bit_precision <= 64),
 2779|   165k|                " precision should  be in (0,64]");
 2780|   165k|  constexpr uint64_t precision_mask =
 2781|   165k|      (bit_precision < 64) ? (uint64_t(0xFFFFFFFFFFFFFFFF) >> bit_precision)
  ------------------
  |  Branch (2781:7): [True: 0, Folded]
  ------------------
 2782|   165k|                           : uint64_t(0xFFFFFFFFFFFFFFFF);
 2783|   165k|  if ((firstproduct.high & precision_mask) ==
  ------------------
  |  Branch (2783:7): [True: 18.2k, False: 147k]
  ------------------
 2784|   165k|      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|  18.2k|    value128 secondproduct =
 2789|  18.2k|        full_multiplication(w, powers::power_of_five_128[index + 1]);
 2790|  18.2k|    firstproduct.low += secondproduct.high;
 2791|  18.2k|    if (secondproduct.high > firstproduct.low) {
  ------------------
  |  Branch (2791:9): [True: 8.42k, False: 9.79k]
  ------------------
 2792|  8.42k|      firstproduct.high++;
 2793|  8.42k|    }
 2794|  18.2k|  }
 2795|   165k|  return firstproduct;
 2796|   165k|}
_ZN3glz10fast_float19full_multiplicationEmm:
  540|   184k|full_multiplication(uint64_t a, uint64_t b) {
  541|   184k|  if (cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (541:7): [Folded, False: 184k]
  ------------------
  542|      0|    value128 answer;
  543|      0|    answer.low = umul128_generic(a, b, &answer.high);
  544|      0|    return answer;
  545|      0|  }
  546|   184k|  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|   184k|  answer.low = uint64_t(r);
  558|   184k|  answer.high = uint64_t(r >> 64);
  559|       |#else
  560|       |  answer.low = umul128_generic(a, b, &answer.high);
  561|       |#endif
  562|   184k|  return answer;
  563|   184k|}
_ZN3glz10fast_float8value128C2Ev:
  454|   184k|  constexpr value128() : low(0), high(0) {}
_ZN3glz10fast_float6detail5powerEi:
 2814|   165k|constexpr fastfloat_really_inline int32_t power(int32_t q) noexcept {
 2815|   165k|  return (((152170 + 65536) * q) >> 16) + 63;
 2816|   165k|}
_ZN3glz10fast_float13binary_formatIdE16minimum_exponentEv:
  742|   177k|template <> inline constexpr int binary_format<double>::minimum_exponent() {
  743|   177k|  return -1023;
  744|   177k|}
_ZN3glz10fast_float13binary_formatIdE26min_exponent_round_to_evenEv:
  733|  99.7k|inline constexpr int binary_format<double>::min_exponent_round_to_even() {
  734|  99.7k|  return -4;
  735|  99.7k|}
_ZN3glz10fast_float13binary_formatIdE26max_exponent_round_to_evenEv:
  723|  99.1k|inline constexpr int binary_format<double>::max_exponent_round_to_even() {
  724|  99.1k|  return 23;
  725|  99.1k|}
_ZNK3glz10fast_float17adjusted_mantissaneERKS1_:
  574|  66.5k|  constexpr bool operator!=(adjusted_mantissa const &o) const {
  575|  66.5k|    return mantissa != o.mantissa || power2 != o.power2;
  ------------------
  |  Branch (575:12): [True: 11.7k, False: 54.8k]
  |  Branch (575:38): [True: 0, False: 54.8k]
  ------------------
  576|  66.5k|  }
_ZN3glz10fast_float13compute_errorINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElm:
 2837|  11.7k|compute_error(int64_t q, uint64_t w) noexcept {
 2838|  11.7k|  int lz = leading_zeroes(w);
 2839|  11.7k|  w <<= lz;
 2840|  11.7k|  value128 product =
 2841|  11.7k|      compute_product_approximation<binary::mantissa_explicit_bits() + 3>(q, w);
 2842|  11.7k|  return compute_error_scaled<binary>(q, product.high, lz);
 2843|  11.7k|}
_ZN3glz10fast_float20compute_error_scaledINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElmi:
 2823|  11.7k|compute_error_scaled(int64_t q, uint64_t w, int lz) noexcept {
 2824|  11.7k|  int hilz = int(w >> 63) ^ 1;
 2825|  11.7k|  adjusted_mantissa answer;
 2826|  11.7k|  answer.mantissa = w << hilz;
 2827|  11.7k|  int bias = binary::mantissa_explicit_bits() - binary::minimum_exponent();
 2828|  11.7k|  answer.power2 = int32_t(detail::power(int32_t(q)) + bias - hilz - lz - 62 +
 2829|  11.7k|                          invalid_am_bias);
 2830|  11.7k|  return answer;
 2831|  11.7k|}
_ZN3glz10fast_float10digit_compIdcEENS0_17adjusted_mantissaERNS0_22parsed_number_string_tIT0_EES2_:
 4034|  11.7k|digit_comp(parsed_number_string_t<UC> &num, adjusted_mantissa am) noexcept {
 4035|       |  // remove the invalid exponent bias
 4036|  11.7k|  am.power2 -= invalid_am_bias;
 4037|       |
 4038|  11.7k|  int32_t sci_exp = scientific_exponent(num);
 4039|  11.7k|  size_t max_digits = binary_format<T>::max_digits();
 4040|  11.7k|  size_t digits = 0;
 4041|  11.7k|  bigint bigmant;
 4042|  11.7k|  parse_mantissa(bigmant, num, max_digits, digits);
 4043|       |  // can't underflow, since digits is at most max_digits.
 4044|  11.7k|  int32_t exponent = sci_exp + 1 - int32_t(digits);
 4045|  11.7k|  if (exponent >= 0) {
  ------------------
  |  Branch (4045:7): [True: 3.78k, False: 7.95k]
  ------------------
 4046|  3.78k|    return positive_digit_comp<T>(bigmant, exponent);
 4047|  7.95k|  } else {
 4048|  7.95k|    return negative_digit_comp<T>(bigmant, am, exponent);
 4049|  7.95k|  }
 4050|  11.7k|}
_ZN3glz10fast_float19scientific_exponentIcEEiRNS0_22parsed_number_string_tIT_EE:
 3640|  11.7k|scientific_exponent(parsed_number_string_t<UC> &num) noexcept {
 3641|  11.7k|  uint64_t mantissa = num.mantissa;
 3642|  11.7k|  int32_t exponent = int32_t(num.exponent);
 3643|  58.6k|  while (mantissa >= 10000) {
  ------------------
  |  Branch (3643:10): [True: 46.9k, False: 11.7k]
  ------------------
 3644|  46.9k|    mantissa /= 10000;
 3645|  46.9k|    exponent += 4;
 3646|  46.9k|  }
 3647|  23.4k|  while (mantissa >= 100) {
  ------------------
  |  Branch (3647:10): [True: 11.7k, False: 11.7k]
  ------------------
 3648|  11.7k|    mantissa /= 100;
 3649|  11.7k|    exponent += 2;
 3650|  11.7k|  }
 3651|  11.7k|  while (mantissa >= 10) {
  ------------------
  |  Branch (3651:10): [True: 0, False: 11.7k]
  ------------------
 3652|      0|    mantissa /= 10;
 3653|      0|    exponent += 1;
 3654|      0|  }
 3655|  11.7k|  return exponent;
 3656|  11.7k|}
_ZN3glz10fast_float13binary_formatIdE10max_digitsEv:
 1085|  11.7k|template <> inline constexpr size_t binary_format<double>::max_digits() {
 1086|  11.7k|  return 769;
 1087|  11.7k|}
_ZN3glz10fast_float6bigintC2Ev:
 3399|  11.7k|  GLZ_FASTFLOAT_CONSTEXPR20 bigint() : vec() {}
_ZN3glz10fast_float8stackvecILt62EEC2Ev:
 3006|  86.7k|  stackvec() = default;
_ZN3glz10fast_float14parse_mantissaIcEEvRNS0_6bigintERNS0_22parsed_number_string_tIT_EEmRm:
 3859|  11.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|  11.7k|  size_t counter = 0;
 3864|  11.7k|  digits = 0;
 3865|  11.7k|  limb value = 0;
 3866|  11.7k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3867|  11.7k|  size_t step = 19;
 3868|       |#else
 3869|       |  size_t step = 9;
 3870|       |#endif
 3871|       |
 3872|       |  // process all integer digits.
 3873|  11.7k|  UC const *p = num.integer.ptr;
 3874|  11.7k|  UC const *pend = p + num.integer.len();
 3875|  11.7k|  skip_zeros(p, pend);
 3876|       |  // process all digits, in increments of step per loop
 3877|  28.0k|  while (p != pend) {
  ------------------
  |  Branch (3877:10): [True: 16.3k, False: 11.7k]
  ------------------
 3878|  34.8k|    while ((std::distance(p, pend) >= 8) && (step - counter >= 8) &&
  ------------------
  |  Branch (3878:12): [True: 21.5k, False: 13.2k]
  |  Branch (3878:45): [True: 18.4k, False: 3.07k]
  ------------------
 3879|  18.4k|           (max_digits - digits >= 8)) {
  ------------------
  |  Branch (3879:12): [True: 18.4k, False: 0]
  ------------------
 3880|  18.4k|      parse_eight_digits(p, value, counter, digits);
 3881|  18.4k|    }
 3882|  54.0k|    while (counter < step && p != pend && digits < max_digits) {
  ------------------
  |  Branch (3882:12): [True: 48.4k, False: 5.59k]
  |  Branch (3882:30): [True: 37.6k, False: 10.7k]
  |  Branch (3882:43): [True: 37.6k, False: 0]
  ------------------
 3883|  37.6k|      parse_one_digit(p, value, counter, digits);
 3884|  37.6k|    }
 3885|  16.3k|    if (digits == max_digits) {
  ------------------
  |  Branch (3885:9): [True: 0, False: 16.3k]
  ------------------
 3886|       |      // add the temporary value, then check if we've truncated any digits
 3887|      0|      add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3888|      0|      bool truncated = is_truncated(p, pend);
 3889|      0|      if (num.fraction.ptr != nullptr) {
  ------------------
  |  Branch (3889:11): [True: 0, False: 0]
  ------------------
 3890|      0|        truncated |= is_truncated(num.fraction);
 3891|      0|      }
 3892|      0|      if (truncated) {
  ------------------
  |  Branch (3892:11): [True: 0, False: 0]
  ------------------
 3893|      0|        round_up_bigint(result, digits);
 3894|      0|      }
 3895|      0|      return;
 3896|  16.3k|    } else {
 3897|  16.3k|      add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3898|  16.3k|      counter = 0;
 3899|  16.3k|      value = 0;
 3900|  16.3k|    }
 3901|  16.3k|  }
 3902|       |
 3903|       |  // add our fraction digits, if they're available.
 3904|  11.7k|  if (num.fraction.ptr != nullptr) {
  ------------------
  |  Branch (3904:7): [True: 8.15k, False: 3.58k]
  ------------------
 3905|  8.15k|    p = num.fraction.ptr;
 3906|  8.15k|    pend = p + num.fraction.len();
 3907|  8.15k|    if (digits == 0) {
  ------------------
  |  Branch (3907:9): [True: 972, False: 7.18k]
  ------------------
 3908|    972|      skip_zeros(p, pend);
 3909|    972|    }
 3910|       |    // process all digits, in increments of step per loop
 3911|   134k|    while (p != pend) {
  ------------------
  |  Branch (3911:12): [True: 128k, False: 5.59k]
  ------------------
 3912|   376k|      while ((std::distance(p, pend) >= 8) && (step - counter >= 8) &&
  ------------------
  |  Branch (3912:14): [True: 368k, False: 7.77k]
  |  Branch (3912:47): [True: 249k, False: 119k]
  ------------------
 3913|   249k|             (max_digits - digits >= 8)) {
  ------------------
  |  Branch (3913:14): [True: 247k, False: 1.52k]
  ------------------
 3914|   247k|        parse_eight_digits(p, value, counter, digits);
 3915|   247k|      }
 3916|   512k|      while (counter < step && p != pend && digits < max_digits) {
  ------------------
  |  Branch (3916:14): [True: 390k, False: 121k]
  |  Branch (3916:32): [True: 386k, False: 4.94k]
  |  Branch (3916:45): [True: 383k, False: 2.30k]
  ------------------
 3917|   383k|        parse_one_digit(p, value, counter, digits);
 3918|   383k|      }
 3919|   128k|      if (digits == max_digits) {
  ------------------
  |  Branch (3919:11): [True: 2.55k, False: 126k]
  ------------------
 3920|       |        // add the temporary value, then check if we've truncated any digits
 3921|  2.55k|        add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3922|  2.55k|        bool truncated = is_truncated(p, pend);
 3923|  2.55k|        if (truncated) {
  ------------------
  |  Branch (3923:13): [True: 1.46k, False: 1.09k]
  ------------------
 3924|  1.46k|          round_up_bigint(result, digits);
 3925|  1.46k|        }
 3926|  2.55k|        return;
 3927|   126k|      } else {
 3928|   126k|        add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3929|   126k|        counter = 0;
 3930|   126k|        value = 0;
 3931|   126k|      }
 3932|   128k|    }
 3933|  8.15k|  }
 3934|       |
 3935|  9.17k|  if (counter != 0) {
  ------------------
  |  Branch (3935:7): [True: 0, False: 9.17k]
  ------------------
 3936|      0|    add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3937|      0|  }
 3938|  9.17k|}
_ZN3glz10fast_float10skip_zerosIcEEvRPKT_S4_:
 3773|  12.7k|skip_zeros(UC const *&first, UC const *last) noexcept {
 3774|  12.7k|  uint64_t val;
 3775|  33.9k|  while (!cpp20_and_in_constexpr() &&
  ------------------
  |  Branch (3775:10): [True: 33.9k, Folded]
  ------------------
 3776|  33.9k|         std::distance(first, last) >= int_cmp_len<UC>()) {
  ------------------
  |  Branch (3776:10): [True: 29.6k, False: 4.28k]
  ------------------
 3777|  29.6k|    ::memcpy(&val, first, sizeof(uint64_t));
 3778|  29.6k|    if (val != int_cmp_zeros<UC>()) {
  ------------------
  |  Branch (3778:9): [True: 8.41k, False: 21.2k]
  ------------------
 3779|  8.41k|      break;
 3780|  8.41k|    }
 3781|  21.2k|    first += int_cmp_len<UC>();
 3782|  21.2k|  }
 3783|  20.6k|  while (first != last) {
  ------------------
  |  Branch (3783:10): [True: 19.7k, False: 972]
  ------------------
 3784|  19.7k|    if (*first != UC('0')) {
  ------------------
  |  Branch (3784:9): [True: 11.7k, False: 7.98k]
  ------------------
 3785|  11.7k|      break;
 3786|  11.7k|    }
 3787|  7.98k|    first++;
 3788|  7.98k|  }
 3789|  12.7k|}
_ZN3glz10fast_float11int_cmp_lenIcEEiv:
 1180|  98.2k|template <typename UC> constexpr int int_cmp_len() {
 1181|  98.2k|  return sizeof(uint64_t) / sizeof(UC);
 1182|  98.2k|}
_ZN3glz10fast_float13int_cmp_zerosIcEEmv:
 1170|  50.4k|template <typename UC> constexpr uint64_t int_cmp_zeros() {
 1171|  50.4k|  static_assert((sizeof(UC) == 1) || (sizeof(UC) == 2) || (sizeof(UC) == 4),
 1172|  50.4k|                "Unsupported character size");
 1173|  50.4k|  return (sizeof(UC) == 1) ? 0x3030303030303030
  ------------------
  |  Branch (1173:10): [True: 50.4k, Folded]
  ------------------
 1174|  50.4k|         : (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|  50.4k|}
_ZN3glz10fast_float18parse_eight_digitsIcEEvRPKT_RmS6_S6_:
 3824|   266k|                   size_t &count) noexcept {
 3825|   266k|  value = value * 100000000 + parse_eight_digits_unrolled(p);
 3826|   266k|  p += 8;
 3827|   266k|  counter += 8;
 3828|   266k|  count += 8;
 3829|   266k|}
_ZN3glz10fast_float27parse_eight_digits_unrolledIcEEjPKT_:
 1588|   266k|parse_eight_digits_unrolled(UC const *chars) noexcept {
 1589|   266k|  if (cpp20_and_in_constexpr() || !has_simd_opt<UC>()) {
  ------------------
  |  Branch (1589:7): [Folded, False: 0]
  |  Branch (1589:35): [True: 0, Folded]
  ------------------
 1590|   266k|    return parse_eight_digits_unrolled(read8_to_u64(chars)); // truncation okay
 1591|   266k|  }
 1592|      0|  return parse_eight_digits_unrolled(simd_read8_to_u64(chars));
 1593|   266k|}
_ZN3glz10fast_float15parse_one_digitIcEEvRPKT_RmS6_S6_:
 3834|   421k|                size_t &count) noexcept {
 3835|   421k|  value = value * 10 + limb(*p - UC('0'));
 3836|   421k|  p++;
 3837|   421k|  counter++;
 3838|   421k|  count++;
 3839|   421k|}
_ZN3glz10fast_float10add_nativeERNS0_6bigintEmm:
 3842|   146k|add_native(bigint &big, limb power, limb value) noexcept {
 3843|   146k|  big.mul(power);
 3844|   146k|  big.add(value);
 3845|   146k|}
_ZN3glz10fast_float6bigint3mulEm:
 3552|   146k|  GLZ_FASTFLOAT_CONSTEXPR20 bool mul(limb y) noexcept { return small_mul(vec, y); }
_ZN3glz10fast_float9small_mulILt62EEEbRNS0_8stackvecIXT_EEEm:
 3249|   253k|                                            limb y) noexcept {
 3250|   253k|  limb carry = 0;
 3251|  3.77M|  for (size_t index = 0; index < vec.len(); index++) {
  ------------------
  |  Branch (3251:26): [True: 3.52M, False: 253k]
  ------------------
 3252|  3.52M|    vec[index] = scalar_mul(vec[index], y, carry);
 3253|  3.52M|  }
 3254|   253k|  if (carry != 0) {
  ------------------
  |  Branch (3254:7): [True: 228k, False: 25.8k]
  ------------------
 3255|   228k|    GLZ_FASTFLOAT_TRY(vec.try_push(carry));
  ------------------
  |  |  354|   228k|  {                                                                            \
  |  |  355|   228k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 228k]
  |  |  ------------------
  |  |  356|   228k|      return false;                                                            \
  |  |  357|   228k|  }
  ------------------
 3256|   228k|  }
 3257|   253k|  return true;
 3258|   253k|}
_ZNK3glz10fast_float8stackvecILt62EE3lenEv:
 3039|  4.89M|  constexpr size_t len() const noexcept { return length; }
_ZN3glz10fast_float10scalar_mulEmmRm:
 3196|  3.52M|scalar_mul(limb x, limb y, limb &carry) noexcept {
 3197|  3.52M|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3198|  3.52M|#if defined(__SIZEOF_INT128__)
 3199|       |  // GCC and clang both define it as an extension.
 3200|  3.52M|  __uint128_t z = __uint128_t(x) * __uint128_t(y) + __uint128_t(carry);
 3201|  3.52M|  carry = limb(z >> limb_bits);
 3202|  3.52M|  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|  3.52M|}
_ZN3glz10fast_float8stackvecILt62EEixEm:
 3017|  8.77M|  GLZ_FASTFLOAT_CONSTEXPR14 limb &operator[](size_t index) noexcept {
 3018|  8.77M|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  8.77M|  { ((void)(x)); }
  ------------------
 3019|  8.77M|    return data[index];
 3020|  8.77M|  }
_ZN3glz10fast_float8stackvecILt62EE8try_pushEm:
 3052|   242k|  GLZ_FASTFLOAT_CONSTEXPR14 bool try_push(limb value) noexcept {
 3053|   242k|    if (len() < capacity()) {
  ------------------
  |  Branch (3053:9): [True: 242k, False: 0]
  ------------------
 3054|   242k|      push_unchecked(value);
 3055|   242k|      return true;
 3056|   242k|    } else {
 3057|      0|      return false;
 3058|      0|    }
 3059|   242k|  }
_ZNK3glz10fast_float8stackvecILt62EE8capacityEv:
 3043|   397k|  constexpr size_t capacity() const noexcept { return size; }
_ZN3glz10fast_float8stackvecILt62EE14push_uncheckedEm:
 3046|   249k|  GLZ_FASTFLOAT_CONSTEXPR14 void push_unchecked(limb value) noexcept {
 3047|   249k|    data[length] = value;
 3048|   249k|    length++;
 3049|   249k|  }
_ZN3glz10fast_float6bigint3addEm:
 3554|   146k|  GLZ_FASTFLOAT_CONSTEXPR20 bool add(limb y) noexcept { return small_add(vec, y); }
_ZN3glz10fast_float9small_addILt62EEEbRNS0_8stackvecIXT_EEEm:
 3242|   146k|small_add(stackvec<size> &vec, limb y) noexcept {
 3243|   146k|  return small_add_from(vec, y, 0);
 3244|   146k|}
_ZN3glz10fast_float14small_add_fromILt62EEEbRNS0_8stackvecIXT_EEEmm:
 3224|   146k|                                                 size_t start) noexcept {
 3225|   146k|  size_t index = start;
 3226|   146k|  limb carry = y;
 3227|   146k|  bool overflow;
 3228|   195k|  while (carry != 0 && index < vec.len()) {
  ------------------
  |  Branch (3228:10): [True: 61.5k, False: 134k]
  |  Branch (3228:24): [True: 49.5k, False: 12.0k]
  ------------------
 3229|  49.5k|    vec[index] = scalar_add(vec[index], carry, overflow);
 3230|  49.5k|    carry = limb(overflow);
 3231|  49.5k|    index += 1;
 3232|  49.5k|  }
 3233|   146k|  if (carry != 0) {
  ------------------
  |  Branch (3233:7): [True: 12.0k, False: 134k]
  ------------------
 3234|  12.0k|    GLZ_FASTFLOAT_TRY(vec.try_push(carry));
  ------------------
  |  |  354|  12.0k|  {                                                                            \
  |  |  355|  12.0k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 12.0k]
  |  |  ------------------
  |  |  356|  12.0k|      return false;                                                            \
  |  |  357|  12.0k|  }
  ------------------
 3235|  12.0k|  }
 3236|   146k|  return true;
 3237|   146k|}
_ZN3glz10fast_float10scalar_addEmmRb:
 3176|  1.05M|scalar_add(limb x, limb y, bool &overflow) noexcept {
 3177|  1.05M|  limb z;
 3178|       |// gcc and clang
 3179|  1.05M|#if defined(__has_builtin)
 3180|  1.05M|#if __has_builtin(__builtin_add_overflow)
 3181|  1.05M|  if (!cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (3181:7): [True: 1.05M, Folded]
  ------------------
 3182|  1.05M|    overflow = __builtin_add_overflow(x, y, &z);
 3183|  1.05M|    return z;
 3184|  1.05M|  }
 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|  1.05M|}
_ZN3glz10fast_float12is_truncatedIcEEbPKT_S4_:
 3795|  2.55k|is_truncated(UC const *first, UC const *last) noexcept {
 3796|       |  // do 8-bit optimizations, can just compare to 8 literal 0s.
 3797|  2.55k|  uint64_t val;
 3798|  22.8k|  while (!cpp20_and_in_constexpr() &&
  ------------------
  |  Branch (3798:10): [True: 22.8k, Folded]
  ------------------
 3799|  22.8k|         std::distance(first, last) >= int_cmp_len<UC>()) {
  ------------------
  |  Branch (3799:10): [True: 20.8k, False: 2.00k]
  ------------------
 3800|  20.8k|    ::memcpy(&val, first, sizeof(uint64_t));
 3801|  20.8k|    if (val != int_cmp_zeros<UC>()) {
  ------------------
  |  Branch (3801:9): [True: 550, False: 20.2k]
  ------------------
 3802|    550|      return true;
 3803|    550|    }
 3804|  20.2k|    first += int_cmp_len<UC>();
 3805|  20.2k|  }
 3806|  5.29k|  while (first != last) {
  ------------------
  |  Branch (3806:10): [True: 4.19k, False: 1.09k]
  ------------------
 3807|  4.19k|    if (*first != UC('0')) {
  ------------------
  |  Branch (3807:9): [True: 914, False: 3.28k]
  ------------------
 3808|    914|      return true;
 3809|    914|    }
 3810|  3.28k|    ++first;
 3811|  3.28k|  }
 3812|  1.09k|  return false;
 3813|  2.00k|}
_ZN3glz10fast_float15round_up_bigintERNS0_6bigintERm:
 3848|  1.46k|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|  1.46k|  add_native(big, 10, 1);
 3852|  1.46k|  count++;
 3853|  1.46k|}
_ZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEi:
 3942|  3.78k|positive_digit_comp(bigint &bigmant, int32_t exponent) noexcept {
 3943|  3.78k|  GLZ_FASTFLOAT_ASSERT(bigmant.pow10(uint32_t(exponent)));
  ------------------
  |  |  344|  3.78k|  { ((void)(x)); }
  ------------------
 3944|  3.78k|  adjusted_mantissa answer;
 3945|  3.78k|  bool truncated;
 3946|  3.78k|  answer.mantissa = bigmant.hi64(truncated);
 3947|  3.78k|  int bias = binary_format<T>::mantissa_explicit_bits() -
 3948|  3.78k|             binary_format<T>::minimum_exponent();
 3949|  3.78k|  answer.power2 = bigmant.bit_length() - 64 + bias;
 3950|       |
 3951|  3.78k|  round<T>(answer, [truncated](adjusted_mantissa &a, int32_t shift) {
 3952|  3.78k|    round_nearest_tie_even(
 3953|  3.78k|        a, shift,
 3954|  3.78k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  3.78k|          return is_above || (is_halfway && truncated) ||
 3956|  3.78k|                 (is_odd && is_halfway);
 3957|  3.78k|        });
 3958|  3.78k|  });
 3959|       |
 3960|  3.78k|  return answer;
 3961|  3.78k|}
_ZN3glz10fast_float6bigint5pow10Ej:
 3591|  3.78k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow10(uint32_t exp) noexcept {
 3592|  3.78k|    GLZ_FASTFLOAT_TRY(pow5(exp));
  ------------------
  |  |  354|  3.78k|  {                                                                            \
  |  |  355|  3.78k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 3.78k]
  |  |  ------------------
  |  |  356|  3.78k|      return false;                                                            \
  |  |  357|  3.78k|  }
  ------------------
 3593|  3.78k|    return pow2(exp);
 3594|  3.78k|  }
_ZN3glz10fast_float6bigint4pow5Ej:
 3560|  11.7k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow5(uint32_t exp) noexcept {
 3561|       |    // multiply by a power of 5
 3562|  11.7k|    size_t large_length = sizeof(large_power_of_5) / sizeof(limb);
 3563|  11.7k|    limb_span large = limb_span(large_power_of_5, large_length);
 3564|  28.4k|    while (exp >= large_step) {
  ------------------
  |  Branch (3564:12): [True: 16.7k, False: 11.7k]
  ------------------
 3565|  16.7k|      GLZ_FASTFLOAT_TRY(large_mul(vec, large));
  ------------------
  |  |  354|  16.7k|  {                                                                            \
  |  |  355|  16.7k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  356|  16.7k|      return false;                                                            \
  |  |  357|  16.7k|  }
  ------------------
 3566|  16.7k|      exp -= large_step;
 3567|  16.7k|    }
 3568|  11.7k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3569|  11.7k|    uint32_t small_step = 27;
 3570|  11.7k|    limb max_native = 7450580596923828125UL;
 3571|       |#else
 3572|       |    uint32_t small_step = 13;
 3573|       |    limb max_native = 1220703125U;
 3574|       |#endif
 3575|  26.3k|    while (exp >= small_step) {
  ------------------
  |  Branch (3575:12): [True: 14.6k, False: 11.7k]
  ------------------
 3576|  14.6k|      GLZ_FASTFLOAT_TRY(small_mul(vec, max_native));
  ------------------
  |  |  354|  14.6k|  {                                                                            \
  |  |  355|  14.6k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 14.6k]
  |  |  ------------------
  |  |  356|  14.6k|      return false;                                                            \
  |  |  357|  14.6k|  }
  ------------------
 3577|  14.6k|      exp -= small_step;
 3578|  14.6k|    }
 3579|  11.7k|    if (exp != 0) {
  ------------------
  |  Branch (3579:9): [True: 9.03k, False: 2.70k]
  ------------------
 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|  9.03k|      GLZ_FASTFLOAT_TRY(small_mul(
  ------------------
  |  |  354|  9.03k|  {                                                                            \
  |  |  355|  9.03k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 9.03k]
  |  |  ------------------
  |  |  356|  9.03k|      return false;                                                            \
  |  |  357|  9.03k|  }
  ------------------
 3584|  9.03k|          vec, limb(((void)small_power_of_5[0], small_power_of_5[exp]))));
 3585|  9.03k|    }
 3586|       |
 3587|  11.7k|    return true;
 3588|  11.7k|  }
_ZN3glz10fast_float4spanImEC2EPKmm:
  436|   112k|  constexpr span(T const *_ptr, size_t _length) : ptr(_ptr), length(_length) {}
_ZN3glz10fast_float9large_mulILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEE:
 3329|  16.7k|GLZ_FASTFLOAT_CONSTEXPR20 bool large_mul(stackvec<size> &x, limb_span y) noexcept {
 3330|  16.7k|  if (y.len() == 1) {
  ------------------
  |  Branch (3330:7): [True: 0, False: 16.7k]
  ------------------
 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|  16.7k|  } else {
 3333|  16.7k|    GLZ_FASTFLOAT_TRY(long_mul(x, y));
  ------------------
  |  |  354|  16.7k|  {                                                                            \
  |  |  355|  16.7k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  356|  16.7k|      return false;                                                            \
  |  |  357|  16.7k|  }
  ------------------
 3334|  16.7k|  }
 3335|  16.7k|  return true;
 3336|  16.7k|}
_ZNK3glz10fast_float4spanImE3lenEv:
  440|  1.27M|  constexpr size_t len() const noexcept { return length; }
_ZNK3glz10fast_float4spanImEixEm:
  442|   794k|  GLZ_FASTFLOAT_CONSTEXPR14 const T &operator[](size_t index) const noexcept {
  443|   794k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|   794k|  { ((void)(x)); }
  ------------------
  444|   794k|    return ptr[index];
  445|   794k|  }
_ZN3glz10fast_float8long_mulILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEE:
 3301|  16.7k|GLZ_FASTFLOAT_CONSTEXPR20 bool long_mul(stackvec<size> &x, limb_span y) noexcept {
 3302|  16.7k|  limb_span xs = limb_span(x.data, x.len());
 3303|  16.7k|  stackvec<size> z(xs);
 3304|  16.7k|  limb_span zs = limb_span(z.data, z.len());
 3305|       |
 3306|  16.7k|  if (y.len() != 0) {
  ------------------
  |  Branch (3306:7): [True: 16.7k, False: 0]
  ------------------
 3307|  16.7k|    limb y0 = y[0];
 3308|  16.7k|    GLZ_FASTFLOAT_TRY(small_mul(x, y0));
  ------------------
  |  |  354|  16.7k|  {                                                                            \
  |  |  355|  16.7k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  356|  16.7k|      return false;                                                            \
  |  |  357|  16.7k|  }
  ------------------
 3309|  83.7k|    for (size_t index = 1; index < y.len(); index++) {
  ------------------
  |  Branch (3309:28): [True: 67.0k, False: 16.7k]
  ------------------
 3310|  67.0k|      limb yi = y[index];
 3311|  67.0k|      stackvec<size> zi;
 3312|  67.0k|      if (yi != 0) {
  ------------------
  |  Branch (3312:11): [True: 67.0k, False: 0]
  ------------------
 3313|       |        // re-use the same buffer throughout
 3314|  67.0k|        zi.set_len(0);
 3315|  67.0k|        GLZ_FASTFLOAT_TRY(zi.try_extend(zs));
  ------------------
  |  |  354|  67.0k|  {                                                                            \
  |  |  355|  67.0k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 67.0k]
  |  |  ------------------
  |  |  356|  67.0k|      return false;                                                            \
  |  |  357|  67.0k|  }
  ------------------
 3316|  67.0k|        GLZ_FASTFLOAT_TRY(small_mul(zi, yi));
  ------------------
  |  |  354|  67.0k|  {                                                                            \
  |  |  355|  67.0k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 67.0k]
  |  |  ------------------
  |  |  356|  67.0k|      return false;                                                            \
  |  |  357|  67.0k|  }
  ------------------
 3317|  67.0k|        limb_span zis = limb_span(zi.data, zi.len());
 3318|  67.0k|        GLZ_FASTFLOAT_TRY(large_add_from(x, zis, index));
  ------------------
  |  |  354|  67.0k|  {                                                                            \
  |  |  355|  67.0k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 67.0k]
  |  |  ------------------
  |  |  356|  67.0k|      return false;                                                            \
  |  |  357|  67.0k|  }
  ------------------
 3319|  67.0k|      }
 3320|  67.0k|    }
 3321|  16.7k|  }
 3322|       |
 3323|  16.7k|  x.normalize();
 3324|  16.7k|  return true;
 3325|  16.7k|}
_ZN3glz10fast_float8stackvecILt62EEC2ENS0_4spanImEE:
 3013|  16.7k|  GLZ_FASTFLOAT_CONSTEXPR20 stackvec(limb_span s) {
 3014|  16.7k|    GLZ_FASTFLOAT_ASSERT(try_extend(s));
  ------------------
  |  |  344|  16.7k|  { ((void)(x)); }
  ------------------
 3015|  16.7k|  }
_ZN3glz10fast_float8stackvecILt62EE7set_lenEm:
 3035|   222k|  GLZ_FASTFLOAT_CONSTEXPR14 void set_len(size_t len) noexcept {
 3036|   222k|    length = uint16_t(len);
 3037|   222k|  }
_ZN3glz10fast_float8stackvecILt62EE10try_extendENS0_4spanImEE:
 3069|  83.7k|  GLZ_FASTFLOAT_CONSTEXPR20 bool try_extend(limb_span s) noexcept {
 3070|  83.7k|    if (len() + s.len() <= capacity()) {
  ------------------
  |  Branch (3070:9): [True: 83.7k, False: 0]
  ------------------
 3071|  83.7k|      extend_unchecked(s);
 3072|  83.7k|      return true;
 3073|  83.7k|    } else {
 3074|      0|      return false;
 3075|      0|    }
 3076|  83.7k|  }
_ZN3glz10fast_float8stackvecILt62EE16extend_uncheckedENS0_4spanImEE:
 3062|  83.7k|  GLZ_FASTFLOAT_CONSTEXPR20 void extend_unchecked(limb_span s) noexcept {
 3063|  83.7k|    limb *ptr = data + length;
 3064|  83.7k|    std::copy_n(s.ptr, s.len(), ptr);
 3065|  83.7k|    set_len(len() + s.len());
 3066|  83.7k|  }
_ZN3glz10fast_float14large_add_fromILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEEm:
 3264|  67.0k|                                          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|  67.0k|  if (x.len() < start || y.len() > x.len() - start) {
  ------------------
  |  Branch (3267:7): [True: 0, False: 67.0k]
  |  Branch (3267:26): [True: 66.4k, False: 534]
  ------------------
 3268|  66.4k|    GLZ_FASTFLOAT_TRY(x.try_resize(y.len() + start, 0));
  ------------------
  |  |  354|  66.4k|  {                                                                            \
  |  |  355|  66.4k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 66.4k]
  |  |  ------------------
  |  |  356|  66.4k|      return false;                                                            \
  |  |  357|  66.4k|  }
  ------------------
 3269|  66.4k|  }
 3270|       |
 3271|  67.0k|  bool carry = false;
 3272|   777k|  for (size_t index = 0; index < y.len(); index++) {
  ------------------
  |  Branch (3272:26): [True: 710k, False: 67.0k]
  ------------------
 3273|   710k|    limb xi = x[index + start];
 3274|   710k|    limb yi = y[index];
 3275|   710k|    bool c1 = false;
 3276|   710k|    bool c2 = false;
 3277|   710k|    xi = scalar_add(xi, yi, c1);
 3278|   710k|    if (carry) {
  ------------------
  |  Branch (3278:9): [True: 294k, False: 415k]
  ------------------
 3279|   294k|      xi = scalar_add(xi, 1, c2);
 3280|   294k|    }
 3281|   710k|    x[index + start] = xi;
 3282|   710k|    carry = c1 | c2;
 3283|   710k|  }
 3284|       |
 3285|       |  // handle overflow
 3286|  67.0k|  if (carry) {
  ------------------
  |  Branch (3286:7): [True: 0, False: 67.0k]
  ------------------
 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|  67.0k|  return true;
 3290|  67.0k|}
_ZN3glz10fast_float8stackvecILt62EE10try_resizeEmm:
 3095|  66.4k|  GLZ_FASTFLOAT_CONSTEXPR20 bool try_resize(size_t new_len, limb value) noexcept {
 3096|  66.4k|    if (new_len > capacity()) {
  ------------------
  |  Branch (3096:9): [True: 0, False: 66.4k]
  ------------------
 3097|      0|      return false;
 3098|  66.4k|    } else {
 3099|  66.4k|      resize_unchecked(new_len, value);
 3100|  66.4k|      return true;
 3101|  66.4k|    }
 3102|  66.4k|  }
_ZN3glz10fast_float8stackvecILt62EE16resize_uncheckedEmm:
 3082|  66.4k|  void resize_unchecked(size_t new_len, limb value) noexcept {
 3083|  66.4k|    if (new_len > len()) {
  ------------------
  |  Branch (3083:9): [True: 66.4k, False: 0]
  ------------------
 3084|  66.4k|      size_t count = new_len - len();
 3085|  66.4k|      limb *first = data + len();
 3086|  66.4k|      limb *last = first + count;
 3087|  66.4k|      ::std::fill(first, last, value);
 3088|  66.4k|      set_len(new_len);
 3089|  66.4k|    } else {
 3090|      0|      set_len(new_len);
 3091|      0|    }
 3092|  66.4k|  }
_ZN3glz10fast_float8stackvecILt62EE9normalizeEv:
 3118|  24.7k|  GLZ_FASTFLOAT_CONSTEXPR14 void normalize() noexcept {
 3119|  24.7k|    while (len() > 0 && rindex(0) == 0) {
  ------------------
  |  Branch (3119:12): [True: 24.7k, False: 0]
  |  Branch (3119:25): [True: 0, False: 24.7k]
  ------------------
 3120|      0|      length--;
 3121|      0|    }
 3122|  24.7k|  }
_ZNK3glz10fast_float8stackvecILt62EE6rindexEm:
 3028|  36.7k|  GLZ_FASTFLOAT_CONSTEXPR14 const limb &rindex(size_t index) const noexcept {
 3029|  36.7k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  36.7k|  { ((void)(x)); }
  ------------------
 3030|  36.7k|    size_t rindex = length - index - 1;
 3031|  36.7k|    return data[rindex];
 3032|  36.7k|  }
_ZN3glz10fast_float6bigint4pow2Ej:
 3557|  11.5k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow2(uint32_t exp) noexcept { return shl(exp); }
_ZN3glz10fast_float6bigint3shlEm:
 3519|  11.5k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl(size_t n) noexcept {
 3520|  11.5k|    size_t rem = n % limb_bits;
 3521|  11.5k|    size_t div = n / limb_bits;
 3522|  11.5k|    if (rem != 0) {
  ------------------
  |  Branch (3522:9): [True: 8.44k, False: 3.06k]
  ------------------
 3523|  8.44k|      GLZ_FASTFLOAT_TRY(shl_bits(rem));
  ------------------
  |  |  354|  8.44k|  {                                                                            \
  |  |  355|  8.44k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 8.44k]
  |  |  ------------------
  |  |  356|  8.44k|      return false;                                                            \
  |  |  357|  8.44k|  }
  ------------------
 3524|  8.44k|    }
 3525|  11.5k|    if (div != 0) {
  ------------------
  |  Branch (3525:9): [True: 5.56k, False: 5.95k]
  ------------------
 3526|  5.56k|      GLZ_FASTFLOAT_TRY(shl_limbs(div));
  ------------------
  |  |  354|  5.56k|  {                                                                            \
  |  |  355|  5.56k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 5.56k]
  |  |  ------------------
  |  |  356|  5.56k|      return false;                                                            \
  |  |  357|  5.56k|  }
  ------------------
 3527|  5.56k|    }
 3528|  11.5k|    return true;
 3529|  11.5k|  }
_ZN3glz10fast_float6bigint8shl_bitsEm:
 3472|  8.44k|  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|  8.44k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n != 0);
  ------------------
  |  |  349|  8.44k|  { ((void)(x)); }
  ------------------
 3479|  8.44k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n < sizeof(limb) * 8);
  ------------------
  |  |  349|  8.44k|  { ((void)(x)); }
  ------------------
 3480|       |
 3481|  8.44k|    size_t shl = n;
 3482|  8.44k|    size_t shr = limb_bits - shl;
 3483|  8.44k|    limb prev = 0;
 3484|   110k|    for (size_t index = 0; index < vec.len(); index++) {
  ------------------
  |  Branch (3484:28): [True: 102k, False: 8.44k]
  ------------------
 3485|   102k|      limb xi = vec[index];
 3486|   102k|      vec[index] = (xi << shl) | (prev >> shr);
 3487|   102k|      prev = xi;
 3488|   102k|    }
 3489|       |
 3490|  8.44k|    limb carry = prev >> shr;
 3491|  8.44k|    if (carry != 0) {
  ------------------
  |  Branch (3491:9): [True: 1.89k, False: 6.55k]
  ------------------
 3492|  1.89k|      return vec.try_push(carry);
 3493|  1.89k|    }
 3494|  6.55k|    return true;
 3495|  8.44k|  }
_ZN3glz10fast_float6bigint9shl_limbsEm:
 3498|  5.56k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl_limbs(size_t n) noexcept {
 3499|  5.56k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n != 0);
  ------------------
  |  |  349|  5.56k|  { ((void)(x)); }
  ------------------
 3500|  5.56k|    if (n + vec.len() > vec.capacity()) {
  ------------------
  |  Branch (3500:9): [True: 0, False: 5.56k]
  ------------------
 3501|      0|      return false;
 3502|  5.56k|    } else if (!vec.is_empty()) {
  ------------------
  |  Branch (3502:16): [True: 5.56k, False: 0]
  ------------------
 3503|       |      // move limbs
 3504|  5.56k|      limb *dst = vec.data + n;
 3505|  5.56k|      limb const *src = vec.data;
 3506|  5.56k|      std::copy_backward(src, src + vec.len(), dst + vec.len());
 3507|       |      // fill in empty limbs
 3508|  5.56k|      limb *first = vec.data;
 3509|  5.56k|      limb *last = first + n;
 3510|  5.56k|      ::std::fill(first, last, 0);
 3511|  5.56k|      vec.set_len(n + vec.len());
 3512|  5.56k|      return true;
 3513|  5.56k|    } else {
 3514|      0|      return true;
 3515|      0|    }
 3516|  5.56k|  }
_ZNK3glz10fast_float8stackvecILt62EE8is_emptyEv:
 3041|  9.34k|  constexpr bool is_empty() const noexcept { return length == 0; }
_ZNK3glz10fast_float6bigint4hi64ERb:
 3418|  3.78k|  GLZ_FASTFLOAT_CONSTEXPR20 uint64_t hi64(bool &truncated) const noexcept {
 3419|  3.78k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3420|  3.78k|    if (vec.len() == 0) {
  ------------------
  |  Branch (3420:9): [True: 0, False: 3.78k]
  ------------------
 3421|      0|      return empty_hi64(truncated);
 3422|  3.78k|    } else if (vec.len() == 1) {
  ------------------
  |  Branch (3422:16): [True: 944, False: 2.83k]
  ------------------
 3423|    944|      return uint64_hi64(vec.rindex(0), truncated);
 3424|  2.83k|    } else {
 3425|  2.83k|      uint64_t result = uint64_hi64(vec.rindex(0), vec.rindex(1), truncated);
 3426|  2.83k|      truncated |= vec.nonzero(2);
 3427|  2.83k|      return result;
 3428|  2.83k|    }
 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|  3.78k|  }
_ZN3glz10fast_float11uint64_hi64EmRb:
 3132|    944|uint64_hi64(uint64_t r0, bool &truncated) noexcept {
 3133|    944|  truncated = false;
 3134|    944|  int shl = leading_zeroes(r0);
 3135|    944|  return r0 << shl;
 3136|    944|}
_ZN3glz10fast_float11uint64_hi64EmmRb:
 3139|  2.83k|uint64_hi64(uint64_t r0, uint64_t r1, bool &truncated) noexcept {
 3140|  2.83k|  int shl = leading_zeroes(r0);
 3141|  2.83k|  if (shl == 0) {
  ------------------
  |  Branch (3141:7): [True: 344, False: 2.49k]
  ------------------
 3142|    344|    truncated = r1 != 0;
 3143|    344|    return r0;
 3144|  2.49k|  } else {
 3145|  2.49k|    int shr = 64 - shl;
 3146|  2.49k|    truncated = (r1 << shl) != 0;
 3147|  2.49k|    return (r0 << shl) | (r1 >> shr);
 3148|  2.49k|  }
 3149|  2.83k|}
_ZNK3glz10fast_float8stackvecILt62EE7nonzeroEm:
 3107|  2.83k|  GLZ_FASTFLOAT_CONSTEXPR14 bool nonzero(size_t index) const noexcept {
 3108|  2.83k|    while (index < len()) {
  ------------------
  |  Branch (3108:12): [True: 1.65k, False: 1.18k]
  ------------------
 3109|  1.65k|      if (rindex(index) != 0) {
  ------------------
  |  Branch (3109:11): [True: 1.65k, False: 0]
  ------------------
 3110|  1.65k|        return true;
 3111|  1.65k|      }
 3112|      0|      index++;
 3113|      0|    }
 3114|  1.18k|    return false;
 3115|  2.83k|  }
_ZNK3glz10fast_float6bigint10bit_lengthEv:
 3547|  3.78k|  GLZ_FASTFLOAT_CONSTEXPR20 int bit_length() const noexcept {
 3548|  3.78k|    int lz = ctlz();
 3549|  3.78k|    return int(limb_bits * vec.len()) - lz;
 3550|  3.78k|  }
_ZNK3glz10fast_float6bigint4ctlzEv:
 3532|  3.78k|  GLZ_FASTFLOAT_CONSTEXPR20 int ctlz() const noexcept {
 3533|  3.78k|    if (vec.is_empty()) {
  ------------------
  |  Branch (3533:9): [True: 0, False: 3.78k]
  ------------------
 3534|      0|      return 0;
 3535|  3.78k|    } else {
 3536|  3.78k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3537|  3.78k|      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|  3.78k|    }
 3544|  3.78k|  }
_ZN3glz10fast_float5roundIdZNS0_19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiEUlRS3_iE_EEvS6_T0_:
 3707|  3.78k|                                                         callback cb) noexcept {
 3708|  3.78k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  3.78k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 0, False: 3.78k]
  ------------------
 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|  3.78k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  3.78k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 3.78k]
  ------------------
 3726|  3.78k|      (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|  3.78k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  3.78k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 3.78k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  3.78k|}
_ZZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS2_iE_clES5_i:
 3951|  3.78k|  round<T>(answer, [truncated](adjusted_mantissa &a, int32_t shift) {
 3952|  3.78k|    round_nearest_tie_even(
 3953|  3.78k|        a, shift,
 3954|  3.78k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  3.78k|          return is_above || (is_halfway && truncated) ||
 3956|  3.78k|                 (is_odd && is_halfway);
 3957|  3.78k|        });
 3958|  3.78k|  });
_ZN3glz10fast_float22round_nearest_tie_evenIZZNS0_19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS3_iE_clES6_iEUlbbbE_EEvS6_iT_:
 3742|  3.78k|                       callback cb) noexcept {
 3743|  3.78k|  uint64_t const mask = (shift == 64) ? UINT64_MAX : (uint64_t(1) << shift) - 1;
  ------------------
  |  Branch (3743:25): [True: 0, False: 3.78k]
  ------------------
 3744|  3.78k|  uint64_t const halfway = (shift == 0) ? 0 : uint64_t(1) << (shift - 1);
  ------------------
  |  Branch (3744:28): [True: 0, False: 3.78k]
  ------------------
 3745|  3.78k|  uint64_t truncated_bits = am.mantissa & mask;
 3746|  3.78k|  bool is_above = truncated_bits > halfway;
 3747|  3.78k|  bool is_halfway = truncated_bits == halfway;
 3748|       |
 3749|       |  // shift digits into position
 3750|  3.78k|  if (shift == 64) {
  ------------------
  |  Branch (3750:7): [True: 0, False: 3.78k]
  ------------------
 3751|      0|    am.mantissa = 0;
 3752|  3.78k|  } else {
 3753|  3.78k|    am.mantissa >>= shift;
 3754|  3.78k|  }
 3755|  3.78k|  am.power2 += shift;
 3756|       |
 3757|  3.78k|  bool is_odd = (am.mantissa & 1) == 1;
 3758|  3.78k|  am.mantissa += uint64_t(cb(is_odd, is_halfway, is_above));
 3759|  3.78k|}
_ZZZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS2_iE_clES5_iENKUlbbbE_clEbbb:
 3954|  3.78k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  3.78k|          return is_above || (is_halfway && truncated) ||
  ------------------
  |  Branch (3955:18): [True: 338, False: 3.44k]
  |  Branch (3955:31): [True: 1.21k, False: 2.22k]
  |  Branch (3955:45): [True: 482, False: 736]
  ------------------
 3956|  2.96k|                 (is_odd && is_halfway);
  ------------------
  |  Branch (3956:19): [True: 1.19k, False: 1.76k]
  |  Branch (3956:29): [True: 218, False: 980]
  ------------------
 3957|  3.78k|        });
_ZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_i:
 3970|  7.95k|    bigint &bigmant, adjusted_mantissa am, int32_t exponent) noexcept {
 3971|  7.95k|  bigint &real_digits = bigmant;
 3972|  7.95k|  int32_t real_exp = exponent;
 3973|       |
 3974|       |  // get the value of `b`, rounded down, and get a bigint representation of b+h
 3975|  7.95k|  adjusted_mantissa am_b = am;
 3976|       |  // gcc7 buf: use a lambda to remove the noexcept qualifier bug with
 3977|       |  // -Wnoexcept-type.
 3978|  7.95k|  round<T>(am_b,
 3979|  7.95k|           [](adjusted_mantissa &a, int32_t shift) { round_down(a, shift); });
 3980|  7.95k|  T b;
 3981|  7.95k|  to_float(false, am_b, b);
 3982|  7.95k|  adjusted_mantissa theor = to_extended_halfway(b);
 3983|  7.95k|  bigint theor_digits(theor.mantissa);
 3984|  7.95k|  int32_t theor_exp = theor.power2;
 3985|       |
 3986|       |  // scale real digits and theor digits to be same power.
 3987|  7.95k|  int32_t pow2_exp = theor_exp - real_exp;
 3988|  7.95k|  uint32_t pow5_exp = uint32_t(-real_exp);
 3989|  7.95k|  if (pow5_exp != 0) {
  ------------------
  |  Branch (3989:7): [True: 7.95k, False: 0]
  ------------------
 3990|  7.95k|    GLZ_FASTFLOAT_ASSERT(theor_digits.pow5(pow5_exp));
  ------------------
  |  |  344|  7.95k|  { ((void)(x)); }
  ------------------
 3991|  7.95k|  }
 3992|  7.95k|  if (pow2_exp > 0) {
  ------------------
  |  Branch (3992:7): [True: 5.17k, False: 2.77k]
  ------------------
 3993|  5.17k|    GLZ_FASTFLOAT_ASSERT(theor_digits.pow2(uint32_t(pow2_exp)));
  ------------------
  |  |  344|  5.17k|  { ((void)(x)); }
  ------------------
 3994|  5.17k|  } else if (pow2_exp < 0) {
  ------------------
  |  Branch (3994:14): [True: 2.55k, False: 222]
  ------------------
 3995|  2.55k|    GLZ_FASTFLOAT_ASSERT(real_digits.pow2(uint32_t(-pow2_exp)));
  ------------------
  |  |  344|  2.55k|  { ((void)(x)); }
  ------------------
 3996|  2.55k|  }
 3997|       |
 3998|       |  // compare digits, and use it to director rounding
 3999|  7.95k|  int ord = real_digits.compare(theor_digits);
 4000|  7.95k|  adjusted_mantissa answer = am;
 4001|  7.95k|  round<T>(answer, [ord](adjusted_mantissa &a, int32_t shift) {
 4002|  7.95k|    round_nearest_tie_even(
 4003|  7.95k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  7.95k|          (void)_;  // not needed, since we've done our comparison
 4005|  7.95k|          (void)__; // not needed, since we've done our comparison
 4006|  7.95k|          if (ord > 0) {
 4007|  7.95k|            return true;
 4008|  7.95k|          } else if (ord < 0) {
 4009|  7.95k|            return false;
 4010|  7.95k|          } else {
 4011|  7.95k|            return is_odd;
 4012|  7.95k|          }
 4013|  7.95k|        });
 4014|  7.95k|  });
 4015|       |
 4016|  7.95k|  return answer;
 4017|  7.95k|}
_ZN3glz10fast_float5roundIdZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iEUlRS3_iE_EEvS6_T0_:
 3707|  7.95k|                                                         callback cb) noexcept {
 3708|  7.95k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  7.95k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 684, False: 7.26k]
  ------------------
 3710|       |    // have a denormal float
 3711|    684|    int32_t shift = -am.power2 + 1;
 3712|    684|    cb(am, (std::min<int32_t>)(shift, 64));
 3713|       |    // check for round-up: if rounding-nearest carried us to the hidden bit.
 3714|    684|    am.power2 = (am.mantissa <
  ------------------
  |  Branch (3714:17): [True: 684, False: 0]
  ------------------
 3715|    684|                 (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))
 3716|    684|                    ? 0
 3717|    684|                    : 1;
 3718|    684|    return;
 3719|    684|  }
 3720|       |
 3721|       |  // have a normal float, use the default shift.
 3722|  7.26k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  7.26k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 7.26k]
  ------------------
 3726|  7.26k|      (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|  7.26k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  7.26k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 7.26k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  7.26k|}
_ZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE_clES5_i:
 3979|  7.95k|           [](adjusted_mantissa &a, int32_t shift) { round_down(a, shift); });
_ZN3glz10fast_float10round_downERNS0_17adjusted_mantissaEi:
 3762|  7.95k|round_down(adjusted_mantissa &am, int32_t shift) noexcept {
 3763|  7.95k|  if (shift == 64) {
  ------------------
  |  Branch (3763:7): [True: 0, False: 7.95k]
  ------------------
 3764|      0|    am.mantissa = 0;
 3765|  7.95k|  } else {
 3766|  7.95k|    am.mantissa >>= shift;
 3767|  7.95k|  }
 3768|  7.95k|  am.power2 += shift;
 3769|  7.95k|}
_ZN3glz10fast_float19to_extended_halfwayIdEENS0_17adjusted_mantissaET_:
 3696|  7.95k|to_extended_halfway(T value) noexcept {
 3697|  7.95k|  adjusted_mantissa am = to_extended(value);
 3698|  7.95k|  am.mantissa <<= 1;
 3699|  7.95k|  am.mantissa += 1;
 3700|  7.95k|  am.power2 -= 1;
 3701|  7.95k|  return am;
 3702|  7.95k|}
_ZN3glz10fast_float11to_extendedIdEENS0_17adjusted_mantissaET_:
 3661|  7.95k|to_extended(T value) noexcept {
 3662|  7.95k|  using equiv_uint = equiv_uint_t<T>;
 3663|  7.95k|  constexpr equiv_uint exponent_mask = binary_format<T>::exponent_mask();
 3664|  7.95k|  constexpr equiv_uint mantissa_mask = binary_format<T>::mantissa_mask();
 3665|  7.95k|  constexpr equiv_uint hidden_bit_mask = binary_format<T>::hidden_bit_mask();
 3666|       |
 3667|  7.95k|  adjusted_mantissa am;
 3668|  7.95k|  int32_t bias = binary_format<T>::mantissa_explicit_bits() -
 3669|  7.95k|                 binary_format<T>::minimum_exponent();
 3670|  7.95k|  equiv_uint bits;
 3671|  7.95k|#if GLZ_FASTFLOAT_HAS_BIT_CAST
 3672|  7.95k|  bits = std::bit_cast<equiv_uint>(value);
 3673|       |#else
 3674|       |  ::memcpy(&bits, &value, sizeof(T));
 3675|       |#endif
 3676|  7.95k|  if ((bits & exponent_mask) == 0) {
  ------------------
  |  Branch (3676:7): [True: 684, False: 7.26k]
  ------------------
 3677|       |    // denormal
 3678|    684|    am.power2 = 1 - bias;
 3679|    684|    am.mantissa = bits & mantissa_mask;
 3680|  7.26k|  } else {
 3681|       |    // normal
 3682|  7.26k|    am.power2 = int32_t((bits & exponent_mask) >>
 3683|  7.26k|                        binary_format<T>::mantissa_explicit_bits());
 3684|  7.26k|    am.power2 -= bias;
 3685|  7.26k|    am.mantissa = (bits & mantissa_mask) | hidden_bit_mask;
 3686|  7.26k|  }
 3687|       |
 3688|  7.95k|  return am;
 3689|  7.95k|}
_ZN3glz10fast_float6bigintC2Em:
 3406|  7.95k|  GLZ_FASTFLOAT_CONSTEXPR20 bigint(uint64_t value) : vec() {
 3407|  7.95k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3408|  7.95k|    vec.push_unchecked(value);
 3409|       |#else
 3410|       |    vec.push_unchecked(uint32_t(value));
 3411|       |    vec.push_unchecked(uint32_t(value >> 32));
 3412|       |#endif
 3413|  7.95k|    vec.normalize();
 3414|  7.95k|  }
_ZNK3glz10fast_float6bigint7compareERKS1_:
 3451|  7.95k|  GLZ_FASTFLOAT_CONSTEXPR20 int compare(bigint const &other) const noexcept {
 3452|  7.95k|    if (vec.len() > other.vec.len()) {
  ------------------
  |  Branch (3452:9): [True: 0, False: 7.95k]
  ------------------
 3453|      0|      return 1;
 3454|  7.95k|    } else if (vec.len() < other.vec.len()) {
  ------------------
  |  Branch (3454:16): [True: 0, False: 7.95k]
  ------------------
 3455|      0|      return -1;
 3456|  7.95k|    } else {
 3457|  65.7k|      for (size_t index = vec.len(); index > 0; index--) {
  ------------------
  |  Branch (3457:38): [True: 64.5k, False: 1.24k]
  ------------------
 3458|  64.5k|        limb xi = vec[index - 1];
 3459|  64.5k|        limb yi = other.vec[index - 1];
 3460|  64.5k|        if (xi > yi) {
  ------------------
  |  Branch (3460:13): [True: 4.62k, False: 59.8k]
  ------------------
 3461|  4.62k|          return 1;
 3462|  59.8k|        } else if (xi < yi) {
  ------------------
  |  Branch (3462:20): [True: 2.08k, False: 57.8k]
  ------------------
 3463|  2.08k|          return -1;
 3464|  2.08k|        }
 3465|  64.5k|      }
 3466|  1.24k|      return 0;
 3467|  7.95k|    }
 3468|  7.95k|  }
_ZNK3glz10fast_float8stackvecILt62EEixEm:
 3022|   129k|  GLZ_FASTFLOAT_CONSTEXPR14 const limb &operator[](size_t index) const noexcept {
 3023|   129k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|   129k|  { ((void)(x)); }
  ------------------
 3024|   129k|    return data[index];
 3025|   129k|  }
_ZN3glz10fast_float5roundIdZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iEUlRS3_iE0_EEvS6_T0_:
 3707|  7.95k|                                                         callback cb) noexcept {
 3708|  7.95k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  7.95k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 684, False: 7.26k]
  ------------------
 3710|       |    // have a denormal float
 3711|    684|    int32_t shift = -am.power2 + 1;
 3712|    684|    cb(am, (std::min<int32_t>)(shift, 64));
 3713|       |    // check for round-up: if rounding-nearest carried us to the hidden bit.
 3714|    684|    am.power2 = (am.mantissa <
  ------------------
  |  Branch (3714:17): [True: 684, False: 0]
  ------------------
 3715|    684|                 (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))
 3716|    684|                    ? 0
 3717|    684|                    : 1;
 3718|    684|    return;
 3719|    684|  }
 3720|       |
 3721|       |  // have a normal float, use the default shift.
 3722|  7.26k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  7.26k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 270, False: 6.99k]
  ------------------
 3726|  7.26k|      (uint64_t(2) << binary_format<T>::mantissa_explicit_bits())) {
 3727|    270|    am.mantissa = (uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3728|    270|    am.power2++;
 3729|    270|  }
 3730|       |
 3731|       |  // check for infinite: we could have carried to an infinite power
 3732|  7.26k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  7.26k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 7.26k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  7.26k|}
_ZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE0_clES5_i:
 4001|  7.95k|  round<T>(answer, [ord](adjusted_mantissa &a, int32_t shift) {
 4002|  7.95k|    round_nearest_tie_even(
 4003|  7.95k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  7.95k|          (void)_;  // not needed, since we've done our comparison
 4005|  7.95k|          (void)__; // not needed, since we've done our comparison
 4006|  7.95k|          if (ord > 0) {
 4007|  7.95k|            return true;
 4008|  7.95k|          } else if (ord < 0) {
 4009|  7.95k|            return false;
 4010|  7.95k|          } else {
 4011|  7.95k|            return is_odd;
 4012|  7.95k|          }
 4013|  7.95k|        });
 4014|  7.95k|  });
_ZN3glz10fast_float22round_nearest_tie_evenIZZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iENKUlRS3_iE0_clES6_iEUlbbbE_EEvS6_iT_:
 3742|  7.95k|                       callback cb) noexcept {
 3743|  7.95k|  uint64_t const mask = (shift == 64) ? UINT64_MAX : (uint64_t(1) << shift) - 1;
  ------------------
  |  Branch (3743:25): [True: 0, False: 7.95k]
  ------------------
 3744|  7.95k|  uint64_t const halfway = (shift == 0) ? 0 : uint64_t(1) << (shift - 1);
  ------------------
  |  Branch (3744:28): [True: 0, False: 7.95k]
  ------------------
 3745|  7.95k|  uint64_t truncated_bits = am.mantissa & mask;
 3746|  7.95k|  bool is_above = truncated_bits > halfway;
 3747|  7.95k|  bool is_halfway = truncated_bits == halfway;
 3748|       |
 3749|       |  // shift digits into position
 3750|  7.95k|  if (shift == 64) {
  ------------------
  |  Branch (3750:7): [True: 0, False: 7.95k]
  ------------------
 3751|      0|    am.mantissa = 0;
 3752|  7.95k|  } else {
 3753|  7.95k|    am.mantissa >>= shift;
 3754|  7.95k|  }
 3755|  7.95k|  am.power2 += shift;
 3756|       |
 3757|  7.95k|  bool is_odd = (am.mantissa & 1) == 1;
 3758|  7.95k|  am.mantissa += uint64_t(cb(is_odd, is_halfway, is_above));
 3759|  7.95k|}
_ZZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE0_clES5_iENKUlbbbE_clEbbb:
 4003|  7.95k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  7.95k|          (void)_;  // not needed, since we've done our comparison
 4005|  7.95k|          (void)__; // not needed, since we've done our comparison
 4006|  7.95k|          if (ord > 0) {
  ------------------
  |  Branch (4006:15): [True: 4.62k, False: 3.32k]
  ------------------
 4007|  4.62k|            return true;
 4008|  4.62k|          } else if (ord < 0) {
  ------------------
  |  Branch (4008:22): [True: 2.08k, False: 1.24k]
  ------------------
 4009|  2.08k|            return false;
 4010|  2.08k|          } else {
 4011|  1.24k|            return is_odd;
 4012|  1.24k|          }
 4013|  7.95k|        });
_ZN3glz10fast_float8to_floatIdEEvbNS0_17adjusted_mantissaERT_:
 1131|   100k|to_float(bool negative, adjusted_mantissa am, T &value) {
 1132|   100k|  using equiv_uint = equiv_uint_t<T>;
 1133|   100k|  equiv_uint word = equiv_uint(am.mantissa);
 1134|   100k|  word = equiv_uint(word | equiv_uint(am.power2)
 1135|   100k|                               << binary_format<T>::mantissa_explicit_bits());
 1136|   100k|  word =
 1137|   100k|      equiv_uint(word | equiv_uint(negative) << binary_format<T>::sign_index());
 1138|   100k|#if GLZ_FASTFLOAT_HAS_BIT_CAST
 1139|   100k|  value = std::bit_cast<T>(word);
 1140|       |#else
 1141|       |  ::memcpy(&value, &word, sizeof(T));
 1142|       |#endif
 1143|   100k|}
_ZN3glz10fast_float13binary_formatIdE10sign_indexEv:
  758|   100k|template <> inline constexpr int binary_format<double>::sign_index() {
  759|   100k|  return 63;
  760|   100k|}
_ZN3glz10fast_float13binary_formatIdE14infinite_powerEv:
  750|   251k|template <> inline constexpr int binary_format<double>::infinite_power() {
  751|   251k|  return 0x7FF;
  752|   251k|}
_ZN3glz10fast_float15parse_options_tIcEC2ENS0_12chars_formatEci:
  217|  4.20M|      : format(fmt), decimal_point(dot), base(b) {}

_ZN3glz18code_point_to_utf8IcEEjjPT_:
  249|  7.81k|   {
  250|  7.81k|      if (code_point <= 0x7F) {
  ------------------
  |  Branch (250:11): [True: 1.14k, False: 6.66k]
  ------------------
  251|  1.14k|         c[0] = Char(code_point);
  252|  1.14k|         return 1;
  253|  1.14k|      }
  254|  6.66k|      if (code_point <= 0x7FF) {
  ------------------
  |  Branch (254:11): [True: 1.27k, False: 5.38k]
  ------------------
  255|  1.27k|         c[0] = Char(0xC0 | ((code_point >> 6) & 0x1F));
  256|  1.27k|         c[1] = Char(0x80 | (code_point & 0x3F));
  257|  1.27k|         return 2;
  258|  1.27k|      }
  259|  5.38k|      if (code_point <= 0xFFFF) {
  ------------------
  |  Branch (259:11): [True: 5.17k, False: 210]
  ------------------
  260|  5.17k|         c[0] = Char(0xE0 | ((code_point >> 12) & 0x0F));
  261|  5.17k|         c[1] = Char(0x80 | ((code_point >> 6) & 0x3F));
  262|  5.17k|         c[2] = Char(0x80 | (code_point & 0x3F));
  263|  5.17k|         return 3;
  264|  5.17k|      }
  265|    210|      if (code_point <= 0x10FFFF) {
  ------------------
  |  Branch (265:11): [True: 210, False: 0]
  ------------------
  266|    210|         c[0] = Char(0xF0 | ((code_point >> 18) & 0x07));
  267|    210|         c[1] = Char(0x80 | ((code_point >> 12) & 0x3F));
  268|    210|         c[2] = Char(0x80 | ((code_point >> 6) & 0x3F));
  269|    210|         c[3] = Char(0x80 | (code_point & 0x3F));
  270|    210|         return 4;
  271|    210|      }
  272|      0|      return 0;
  273|    210|   }
_ZN3glz10hex_to_u32EPKc:
  224|  5.73k|   {
  225|  5.73k|      constexpr auto& t = digit_hex_table;
  226|  5.73k|      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|  5.73k|      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|  5.73k|      if (chunk & repeat_byte4(0b11110000u)) [[unlikely]] {
  ------------------
  |  Branch (234:11): [True: 182, False: 5.54k]
  ------------------
  235|    182|         return 0xFFFFFFFFu;
  236|    182|      }
  237|       |
  238|       |      // now pack into first four bytes of uint32_t
  239|  5.54k|      uint32_t packed{};
  240|  5.54k|      packed |= (chunk & 0x0000000F);
  241|  5.54k|      packed |= (chunk & 0x00000F00) >> 4;
  242|  5.54k|      packed |= (chunk & 0x000F0000) >> 8;
  243|  5.54k|      packed |= (chunk & 0x0F000000) >> 12;
  244|  5.54k|      return packed;
  245|  5.73k|   }

_ZN3glz8to_charsITkNSt3__114floating_pointEdLb0EEEPcS2_T_:
 1118|   937k|   {
 1119|   937k|      static_assert(std::is_same_v<T, float> || std::is_same_v<T, double>);
 1120|   937k|      return zmij::detail::write<T, OptSize>(val, buf);
 1121|   937k|   }
_ZN3glz4zmij6detail5writeIdLb0EEEPcT_S3_:
  975|   937k|      {
  976|   937k|         using namespace detail_impl;
  977|   937k|         using traits = float_traits<Float>;
  978|   937k|         auto bits = traits::to_bits(value);
  979|   937k|         auto bin_exp = traits::get_exp(bits);
  980|   937k|         auto bin_sig = traits::get_sig(bits);
  981|       |
  982|   937k|         *buffer = '-';
  983|   937k|         buffer += traits::is_negative(bits);
  984|       |
  985|   937k|         const auto* c = &consts_v<OptSize>;
  986|   937k|         ZMIJ_ASM(("" : "+r"(c)));
  ------------------
  |  |  126|   937k|#define ZMIJ_ASM(x) asm x
  ------------------
  987|   937k|         int64_t threshold = traits::num_bits == 64 ? static_cast<int64_t>(c->threshold) : 10'000'000;
  ------------------
  |  Branch (987:30): [True: 937k, Folded]
  ------------------
  988|       |
  989|   937k|         to_decimal_result dec;
  990|   937k|         bool is_normal = unsigned(bin_exp - 1) < unsigned(traits::exp_mask - 1);
  991|   937k|         if (!is_normal) [[unlikely]] {
  ------------------
  |  Branch (991:14): [True: 555k, False: 381k]
  ------------------
  992|   555k|            if (bin_exp != 0) {
  ------------------
  |  Branch (992:17): [True: 69.9k, False: 485k]
  ------------------
  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|  69.9k|               buffer -= traits::is_negative(bits);
 1000|  69.9k|               memcpy(buffer, "null", 4);
 1001|  69.9k|               return buffer + 4;
 1002|  69.9k|#endif
 1003|  69.9k|            }
 1004|   485k|            if (bin_sig == 0) {
  ------------------
  |  Branch (1004:17): [True: 480k, False: 5.91k]
  ------------------
 1005|   480k|               memcpy(buffer, "0", 2);
 1006|   480k|               return buffer + 1;
 1007|   480k|            }
 1008|  5.91k|            dec = detail_impl::to_decimal<Float, typename traits::sig_type, OptSize>(bin_sig, 1, true, *c);
 1009|  5.91k|            int64_t dec_sig = dec.sig * 10 + (dec.has_last_digit ? dec.last_digit : 0);
  ------------------
  |  Branch (1009:47): [True: 2.01k, False: 3.90k]
  ------------------
 1010|  5.91k|            int32_t dec_exp = dec.exp;
 1011|  52.1k|            while (dec_sig < threshold) {
  ------------------
  |  Branch (1011:20): [True: 46.2k, False: 5.91k]
  ------------------
 1012|  46.2k|               dec_sig *= 10;
 1013|  46.2k|               --dec_exp;
 1014|  46.2k|            }
 1015|  5.91k|            int64_t d = static_cast<int64_t>(detail_impl::div10(static_cast<uint64_t>(dec_sig)));
 1016|  5.91k|            int32_t last_digit = static_cast<int32_t>(dec_sig - d * 10);
 1017|  5.91k|            dec = {d, dec_exp, last_digit, last_digit != 0};
 1018|  5.91k|         }
 1019|   381k|         else {
 1020|   381k|            dec = detail_impl::to_decimal<Float, typename traits::sig_type, OptSize>(bin_sig | traits::implicit_bit,
 1021|   381k|                                                                                     bin_exp, bin_sig != 0, *c);
 1022|   381k|         }
 1023|   387k|         bool extra_digit = dec.sig >= threshold;
 1024|   387k|         int dec_exp = dec.exp + traits::max_digits10 - 2 + extra_digit;
 1025|   387k|         if (traits::num_bits == 32 && dec.sig < 1'000'000) [[unlikely]] {
  ------------------
  |  Branch (1025:14): [Folded, False: 387k]
  |  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|   387k|         char* start = buffer;
 1032|   387k|         auto dig = to_digits<traits::num_bits, OptSize>(static_cast<uint64_t>(dec.sig), extra_digit, *c);
 1033|   387k|         constexpr int bcd_size = traits::num_bits == 64 ? 16 : 8;
  ------------------
  |  Branch (1033:35): [True: 0, Folded]
  ------------------
 1034|   387k|         if (dec_exp >= traits::min_fixed_dec_exp && dec_exp <= traits::max_fixed_dec_exp) {
  ------------------
  |  Branch (1034:14): [True: 381k, False: 6.19k]
  |  Branch (1034:54): [True: 378k, False: 3.52k]
  ------------------
 1035|   378k|            memcpy(start, &zeros_v, 8);
 1036|   378k|            const auto& fmt = dec_exp_formats.get<traits>(dec_exp);
 1037|   378k|            buffer += fmt.start_pos;
 1038|   378k|            memcpy(buffer, &dig.digits, bcd_size);
 1039|   378k|            memmove(buffer, buffer + !extra_digit, bcd_size);
 1040|   378k|            buffer[bcd_size + extra_digit - 1] = static_cast<char>('0' + (dec.has_last_digit ? dec.last_digit : 0));
  ------------------
  |  Branch (1040:75): [True: 870, False: 377k]
  ------------------
 1041|   378k|            memmove(start + fmt.shift_pos, start + fmt.point_pos, bcd_size);
 1042|   378k|            start[fmt.point_pos] = '.';
 1043|   378k|            int num_digits = dec.has_last_digit ? bcd_size : dig.num_digits - 1;
  ------------------
  |  Branch (1043:30): [True: 870, False: 377k]
  ------------------
 1044|   378k|            return buffer + fmt.exp_pos[num_digits + extra_digit - 1];
 1045|   378k|         }
 1046|  9.72k|         buffer += extra_digit;
 1047|  9.72k|         memcpy(buffer, &dig.digits, bcd_size);
 1048|  9.72k|         buffer[bcd_size] = static_cast<char>('0' + dec.last_digit);
 1049|  9.72k|         buffer += dec.has_last_digit ? bcd_size + 1 : dig.num_digits;
  ------------------
  |  Branch (1049:20): [True: 2.93k, False: 6.79k]
  ------------------
 1050|  9.72k|         start[0] = start[1];
 1051|  9.72k|         start[1] = '.';
 1052|  9.72k|         buffer -= (buffer - 1 == start + 1);
 1053|       |
 1054|  9.72k|         if constexpr (exp_string_table<OptSize>::enable) {
 1055|  9.72k|            uint64_t exp_data = exp_strings_v<OptSize>.data[dec_exp + exp_string_table<OptSize>::offset];
 1056|  9.72k|            int len = int(exp_data >> 48);
 1057|  9.72k|            if (is_big_endian) exp_data = bswap64(exp_data);
  ------------------
  |  Branch (1057:17): [Folded, False: 9.72k]
  ------------------
 1058|  9.72k|            memcpy(buffer, &exp_data, traits::max_exponent10 >= 100 ? 8 : 4);
  ------------------
  |  Branch (1058:39): [True: 9.72k, Folded]
  ------------------
 1059|  9.72k|            return buffer + len;
 1060|  9.72k|         }
 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|  9.72k|         buffer[0] = 'E';
 1067|  9.72k|         buffer[1] = '-';
 1068|  9.72k|         buffer += 1 + unsigned(neg);
 1069|  9.72k|         dec_exp = neg ? -dec_exp : dec_exp;
  ------------------
  |  Branch (1069:20): [True: 0, False: 9.72k]
  ------------------
 1070|  9.72k|         unsigned hundreds_written = 0;
 1071|  9.72k|         if constexpr (traits::max_exponent10 >= 100) {
 1072|  9.72k|            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|  9.72k|            else {
 1077|  9.72k|               digit = static_cast<int32_t>((uint32_t(dec_exp) * div100_sig) >> div100_exp);
 1078|  9.72k|            }
 1079|  9.72k|            *buffer = static_cast<char>('0' + digit);
 1080|  9.72k|            hundreds_written = unsigned(dec_exp >= 100);
 1081|  9.72k|            buffer += hundreds_written;
 1082|  9.72k|            dec_exp -= digit * 100;
 1083|  9.72k|         }
 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|  9.72k|         const char* d2 = digits2(dec_exp);
 1087|  9.72k|         *buffer = d2[0];
 1088|  9.72k|         buffer += hundreds_written | unsigned(dec_exp >= 10);
 1089|  9.72k|         *buffer = d2[1];
 1090|  9.72k|         return buffer + 1;
 1091|   387k|      }
_ZN3glz4zmij11detail_impl12float_traitsIdE7to_bitsEd:
  358|   937k|         {
  359|   937k|            sig_type bits;
  360|   937k|            memcpy(&bits, &value, sizeof(value));
  361|   937k|            return bits;
  362|   937k|         }
_ZN3glz4zmij11detail_impl12float_traitsIdE7get_expEm:
  367|   937k|         {
  368|   937k|            return static_cast<int32_t>((bits << 1) >> (num_sig_bits + 1));
  369|   937k|         }
_ZN3glz4zmij11detail_impl12float_traitsIdE7get_sigEm:
  365|   937k|         static auto get_sig(sig_type bits) noexcept -> sig_type { return bits & (implicit_bit - 1); }
_ZN3glz4zmij11detail_impl12float_traitsIdE11is_negativeEm:
  364|  1.00M|         static auto is_negative(sig_type bits) noexcept -> bool { return bits >> (num_bits - 1); }
_ZN3glz4zmij11detail_impl10to_decimalIdmLb0EEENS1_17to_decimal_resultET0_lbRKNS1_9constantsIXT1_EEE:
  868|   387k|      {
  869|   387k|         using traits = float_traits<Float>;
  870|   387k|         int64_t bin_exp = raw_exp - traits::exp_offset;
  871|   387k|         constexpr int num_bits = std::numeric_limits<UInt>::digits;
  872|       |
  873|   387k|         constexpr uint64_t log10_2_sig = 78'913;
  874|   387k|         constexpr int32_t log10_2_exp = 18;
  875|   387k|         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|   387k|         else {
  881|   387k|            dec_exp = compute_dec_exp(bin_exp);
  882|   387k|         }
  883|   387k|         uint64_t even = 1 - (bin_sig & 1);
  884|   387k|         constexpr int32_t extra_shift = exp_shift_table<OptSize>::extra_shift;
  885|       |
  886|   387k|         if (!regular) [[unlikely]] {
  ------------------
  |  Branch (886:14): [True: 256k, False: 131k]
  ------------------
  887|   256k|            int32_t irregular_dec_exp = compute_dec_exp(bin_exp, false);
  888|   256k|            int32_t shift = compute_exp_shift(bin_exp, irregular_dec_exp + 1) + extra_shift;
  889|   256k|            uint128 pow10 = c.pow10_significands[-irregular_dec_exp - 1];
  890|   256k|            uint128 p = umul192_hi128(pow10.hi, pow10.lo, bin_sig << shift);
  891|       |
  892|   256k|            int64_t integral = p.hi >> extra_shift;
  893|   256k|            uint64_t fractional = p.hi << (64 - extra_shift) | p.lo >> extra_shift;
  894|       |
  895|   256k|            uint64_t half_ulp = pow10.hi >> (extra_shift + 1 - shift);
  896|   256k|            bool round_up = half_ulp > ~uint64_t(0) - fractional;
  897|   256k|            bool round_down = (half_ulp >> 1) > fractional;
  898|   256k|            integral += round_up;
  899|       |
  900|   256k|            int32_t digit = static_cast<int32_t>(umul128_add_hi64(fractional, 10, (uint64_t(1) << 63) - 1));
  901|   256k|            int32_t lo = static_cast<int32_t>(umul128_add_hi64(fractional - (half_ulp >> 1), 10, ~uint64_t(0)));
  902|   256k|            if (digit < lo) digit = lo;
  ------------------
  |  Branch (902:17): [True: 255k, False: 764]
  ------------------
  903|   256k|            return {integral, irregular_dec_exp, digit, (round_up + round_down) == 0};
  904|   256k|         }
  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|   131k|         else {
  928|   131k|            int32_t shift = exp_shift_table<OptSize>::enable ? exp_shifts_v<OptSize>.data[bin_exp + traits::exp_offset]
  ------------------
  |  Branch (928:29): [True: 131k, Folded]
  ------------------
  929|   131k|                                                             : compute_exp_shift(bin_exp, dec_exp + 1) + extra_shift;
  930|   131k|            ZMIJ_ASM(("" : "+r"(dec_exp)));
  ------------------
  |  |  126|   131k|#define ZMIJ_ASM(x) asm x
  ------------------
  931|   131k|            uint128 pow10 = c.pow10_significands[-dec_exp - 1];
  932|   131k|            uint128 p = umul192_hi128(pow10.hi, pow10.lo, bin_sig << shift);
  933|   131k|            int64_t integral = p.hi >> extra_shift;
  934|   131k|            uint64_t fractional = p.hi << (64 - extra_shift) | p.lo >> extra_shift;
  935|   131k|            uint64_t half_ulp = (pow10.hi >> (extra_shift + 1 - shift)) + even;
  936|   131k|            bool round_up = fractional + half_ulp < fractional;
  937|   131k|            bool round_down = half_ulp > fractional;
  938|   131k|            integral += round_up;
  939|       |
  940|   131k|            int32_t digit = static_cast<int32_t>(umul128_add_hi64(fractional, 10, c.biased_half));
  941|   131k|            if (fractional == (1ull << 62)) [[unlikely]] {
  ------------------
  |  Branch (941:17): [True: 62, False: 131k]
  ------------------
  942|     62|               digit = 2;
  943|     62|            }
  944|   131k|            return {integral, dec_exp, digit, (round_up + round_down) == 0};
  945|   131k|         }
  946|   131k|      }
_ZN3glz4zmij11detail_impl15compute_dec_expElb:
  333|   643k|      {
  334|   643k|         assert(bin_exp >= -1334 && bin_exp <= 2620);
  ------------------
  |  Branch (334:10): [True: 643k, False: 0]
  |  Branch (334:10): [True: 643k, False: 0]
  |  Branch (334:10): [True: 643k, False: 0]
  ------------------
  335|   643k|         constexpr int log10_3_over_4_sig = 131'072;
  336|   643k|         constexpr int log10_2_sig = 315'653, log10_2_exp = 20;
  337|   643k|         return static_cast<int32_t>((bin_exp * log10_2_sig - !regular * log10_3_over_4_sig) >> log10_2_exp);
  338|   643k|      }
_ZN3glz4zmij11detail_impl17compute_exp_shiftEli:
  457|   256k|      {
  458|   256k|         assert(dec_exp >= -350 && dec_exp <= 350);
  ------------------
  |  Branch (458:10): [True: 256k, False: 0]
  |  Branch (458:10): [True: 256k, False: 0]
  |  Branch (458:10): [True: 256k, False: 0]
  ------------------
  459|   256k|         constexpr int log2_pow10_sig = 217'707, log2_pow10_exp = 16;
  460|   256k|         int pow10_bin_exp = -dec_exp * log2_pow10_sig >> log2_pow10_exp;
  461|   256k|         return static_cast<int32_t>(bin_exp + pow10_bin_exp + 1);
  462|   256k|      }
_ZNK3glz4zmij11detail_impl23pow10_significand_tableILb0EEixEi:
  440|   387k|         {
  441|   387k|            constexpr int dec_exp_min = -293;
  442|   387k|            int i = dec_exp - dec_exp_min;
  443|   387k|            if (compress) return compute(i);
  ------------------
  |  Branch (443:17): [Folded, False: 387k]
  ------------------
  444|   387k|            if (!split_tables) return {data[i * 2], data[i * 2 + 1]};
  ------------------
  |  Branch (444:17): [True: 387k, 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|   387k|         }
_ZN3glz4zmij11detail_impl13umul192_hi128Emmm:
  308|   387k|      {
  309|   387k|         uint128_t p = umul128(x_hi, y);
  310|   387k|         uint64_t lo = uint64_t(p) + uint64_t(umul128(x_lo, y) >> 64);
  311|   387k|         return {uint64_t(p >> 64) + (lo < uint64_t(p)), lo};
  312|   387k|      }
_ZN3glz4zmij11detail_impl7umul128Emm:
  265|   781k|      {
  266|   781k|#if ZMIJ_USE_INT128
  267|   781k|         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|   781k|      }
_ZN3glz4zmij11detail_impl16umul128_add_hi64Emmm:
  298|   643k|      {
  299|   643k|#if ZMIJ_USE_INT128
  300|   643k|         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|   643k|      }
_ZN3glz4zmij11detail_impl5div10Em:
  326|  5.91k|      {
  327|  5.91k|         assert(x <= (1ull << 62));
  ------------------
  |  Branch (327:10): [True: 5.91k, False: 0]
  ------------------
  328|  5.91k|         constexpr uint64_t div10_sig64 = (1ull << 63) / 5 + 1;
  329|  5.91k|         return ZMIJ_USE_INT128 ? umul128_hi64(x, div10_sig64) : x / 10;
  ------------------
  |  |  247|  5.91k|#define ZMIJ_USE_INT128 1
  |  |  ------------------
  |  |  |  Branch (247:25): [True: 5.91k, Folded]
  |  |  ------------------
  ------------------
  330|  5.91k|      }
_ZN3glz4zmij11detail_impl12umul128_hi64Emm:
  295|  5.91k|      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|   387k|      {
  810|       |         if constexpr (num_bits == 32) {
  811|       |            auto result = to_bcd8<OptSize>(value);
  812|       |            return {result.bcd + zeros_v, result.len};
  813|       |         }
  814|   387k|         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|   387k|            uint32_t abbccddee = uint32_t(value / 100'000'000);
  834|   387k|            uint32_t ffgghhii = uint32_t(value % 100'000'000);
  835|       |
  836|   387k|            const __m128i zeros = _mm_load_si128(m128ptr(&c.zeros));
  837|   387k|            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|   387k|            auto bcd = _mm_shuffle_epi32(unshuffled_bcd, _MM_SHUFFLE(0, 1, 2, 3));
  843|   387k|#endif
  844|       |
  845|   387k|            __m128i mask128 = _mm_cmpgt_epi8(bcd, _mm_setzero_si128());
  846|   387k|            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|   387k|            int len = 63 - clz((mask << 1) | 1);
  851|   387k|#endif
  852|   387k|            return {_mm_or_si128(bcd, zeros), len};
  853|   387k|#endif
  854|   387k|         }
  855|   387k|      }
_ZN3glz4zmij11detail_impl20to_unshuffled_digitsILb0EEEDv2_xjjRKNS1_9constantsIXT_EEE:
  735|   387k|      {
  736|   387k|         const __m128i div10k = _mm_load_si128(m128ptr(&c.div10k));
  737|   387k|         const __m128i neg10k = _mm_load_si128(m128ptr(&c.neg10k));
  738|   387k|         __m128i x = _mm_set_epi64x(bbccddee, ffgghhii);
  739|   387k|         __m128i y = _mm_add_epi64(x, _mm_mul_epu32(neg10k, _mm_srli_epi64(_mm_mul_epu32(x, div10k), div10k_exp)));
  740|   387k|         return to_bcd_4x4(y, c);
  741|   387k|      }
_ZN3glz4zmij11detail_impl10to_bcd_4x4ILb0EEEDv2_xS3_RKNS1_9constantsIXT_EEE:
  712|   387k|      {
  713|   387k|         const __m128i div100 = _mm_load_si128(m128ptr(&c.div100));
  714|   387k|         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|   387k|         const __m128i hundred = _mm_load_si128(m128ptr(&c.hundred));
  723|   387k|         const __m128i moddiv10 = _mm_load_si128(m128ptr(&c.moddiv10));
  724|       |
  725|   387k|         __m128i y_div_100 = _mm_srli_epi16(_mm_mulhi_epu16(y, div100), 3);
  726|   387k|         __m128i y_mod_100 = _mm_sub_epi16(y, _mm_mullo_epi16(y_div_100, hundred));
  727|   387k|         __m128i z = _mm_or_si128(_mm_slli_epi32(y_mod_100, 16), y_div_100);
  728|   387k|         return _mm_sub_epi16(_mm_slli_epi16(z, 8), _mm_mullo_epi16(moddiv10, _mm_mulhi_epu16(z, div10)));
  729|   387k|#endif
  730|   387k|      }
_ZN3glz4zmij11detail_impl3clzEm:
  187|   387k|      {
  188|   387k|         assert(x != 0);
  ------------------
  |  Branch (188:10): [True: 387k, False: 0]
  ------------------
  189|   387k|#if ZMIJ_HAS_BUILTIN(__builtin_clzll)
  190|   387k|         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|   387k|      }
_ZNK3glz4zmij11detail_impl20dec_exp_format_table3getINS1_12float_traitsIdEEEERKNS2_5entryEi:
  559|   378k|         {
  560|   378k|            constexpr auto min = traits::min_fixed_dec_exp, max = Traits::max_fixed_dec_exp;
  561|   378k|            unsigned i = unsigned(dec_exp - min);
  562|   378k|            return data[i <= unsigned(max - min) ? i : num_entries - 1];
  ------------------
  |  Branch (562:25): [True: 378k, False: 0]
  ------------------
  563|   378k|         }

_ZNK3glz4yaml12yaml_context12indent_stackMUlvE_clEv:
   97|  7.89M|      std::vector<int16_t> indent_stack = [] {
   98|  7.89M|         std::vector<int16_t> v;
   99|  7.89M|         v.reserve(max_yaml_recursive_depth);
  100|  7.89M|         return v;
  101|  7.89M|      }();
_ZN3glz4yaml12yaml_context16reset_read_stateEv:
  338|   157k|      {
  339|   157k|         indent_stack.clear();
  340|   157k|         anchors.clear();
  341|   157k|         active_alias_spans.clear();
  342|   157k|         sequence_item_value_context = false;
  343|   157k|         forced_block_mapping_indent = -1;
  344|   157k|         sequence_dash_indent = -1;
  345|   157k|         explicit_mapping_key_context = false;
  346|   157k|         allow_indentless_sequence = false;
  347|   157k|         reset_line_memo();
  348|   157k|      }
_ZNK3glz4yaml12yaml_context15reset_line_memoEv:
  324|   157k|      {
  325|   157k|         memo_line_begin = nullptr;
  326|   157k|         memo_verified_end = nullptr;
  327|   157k|         memo_first_tab = nullptr;
  328|   157k|         memo_first_content = nullptr;
  329|   157k|      }
_ZN3glz4yaml19skip_document_startIRPKcS3_NS0_12yaml_contextEEEvOT_T0_RT1_:
 1201|   157k|   {
 1202|   157k|      ctx.secondary_tag_handle_overridden = false;
 1203|       |
 1204|       |      // Skip leading blank/comment-only lines before directives or document start.
 1205|   164k|      while (it != end) {
  ------------------
  |  Branch (1205:14): [True: 164k, False: 66]
  ------------------
 1206|   164k|         auto line = it;
 1207|   164k|         skip_inline_ws(line, end);
 1208|   164k|         if (line == end) {
  ------------------
  |  Branch (1208:14): [True: 16, False: 164k]
  ------------------
 1209|     16|            it = line;
 1210|     16|            break;
 1211|     16|         }
 1212|   164k|         if (*line == '#') {
  ------------------
  |  Branch (1212:14): [True: 1.18k, False: 163k]
  ------------------
 1213|  1.18k|            it = line;
 1214|  1.18k|            skip_comment(it, end);
 1215|  1.18k|            skip_newline(it, end);
 1216|  1.18k|            continue;
 1217|  1.18k|         }
 1218|   163k|         if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (1218:14): [True: 2.20k, False: 160k]
  |  Branch (1218:31): [True: 3.77k, False: 157k]
  ------------------
 1219|  5.98k|            it = line;
 1220|  5.98k|            skip_newline(it, end);
 1221|  5.98k|            continue;
 1222|  5.98k|         }
 1223|   157k|         it = line;
 1224|   157k|         break;
 1225|   163k|      }
 1226|       |
 1227|       |      // Track if we've seen a %YAML directive (duplicates are an error per spec)
 1228|   157k|      bool seen_yaml_directive = false;
 1229|   157k|      bool saw_any_directive = false;
 1230|   157k|      bool consumed_document_start = false;
 1231|       |
 1232|       |      // Process YAML directives (lines starting with %) until we hit --- or content
 1233|       |      // Directives must appear at the start of a line and before ---
 1234|   166k|      while (it != end && *it == '%') {
  ------------------
  |  Branch (1234:14): [True: 165k, False: 680]
  |  Branch (1234:27): [True: 9.09k, False: 156k]
  ------------------
 1235|  9.09k|         saw_any_directive = true;
 1236|  9.09k|         ++it; // Skip the '%'
 1237|       |
 1238|       |         // Parse directive name
 1239|  9.09k|         auto name_start = it;
 1240|  1.31M|         while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1240:17): [True: 1.31M, False: 220]
  |  Branch (1240:30): [True: 1.31M, False: 2.36k]
  |  Branch (1240:44): [True: 1.30M, False: 5.06k]
  |  Branch (1240:59): [True: 1.30M, False: 592]
  |  Branch (1240:74): [True: 1.30M, False: 848]
  ------------------
 1241|  1.30M|            ++it;
 1242|  1.30M|         }
 1243|  9.09k|         std::string_view directive_name(name_start, static_cast<size_t>(it - name_start));
 1244|       |
 1245|       |         // Check for %YAML directive
 1246|  9.09k|         if (directive_name == "YAML") {
  ------------------
  |  Branch (1246:14): [True: 200, False: 8.89k]
  ------------------
 1247|       |            // Error on duplicate %YAML directive (per spec: "It is an error to specify
 1248|       |            // more than one YAML directive for the same document")
 1249|    200|            if (seen_yaml_directive) {
  ------------------
  |  Branch (1249:17): [True: 6, False: 194]
  ------------------
 1250|      6|               ctx.error = error_code::syntax_error;
 1251|      6|               return;
 1252|      6|            }
 1253|    194|            seen_yaml_directive = true;
 1254|       |
 1255|       |            // Skip whitespace before version
 1256|    810|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1256:20): [True: 798, False: 12]
  |  Branch (1256:34): [True: 416, False: 382]
  |  Branch (1256:48): [True: 200, False: 182]
  ------------------
 1257|    616|               ++it;
 1258|    616|            }
 1259|       |
 1260|       |            // Parse major.minor version and reject malformed forms.
 1261|    194|            if (it == end || *it < '0' || *it > '9') {
  ------------------
  |  Branch (1261:17): [True: 12, False: 182]
  |  Branch (1261:30): [True: 22, False: 160]
  |  Branch (1261:43): [True: 4, False: 156]
  ------------------
 1262|     38|               ctx.error = error_code::syntax_error;
 1263|     38|               return;
 1264|     38|            }
 1265|       |            // Clamp rather than accumulate without bound. An int accumulator overflows on a long
 1266|       |            // digit run -- undefined behavior, and in practice a wrap that carries a huge version
 1267|       |            // back into the accepted range, so "%YAML 4294967296.0" was read as major version 0.
 1268|       |            //
 1269|       |            // Clamping is safe because the accumulator only grows: it stops updating once it has
 1270|       |            // already reached max_tracked_version, so a clamped value is always at least that
 1271|       |            // large, and the clamp is far above the threshold checked below. A version big enough
 1272|       |            // to freeze the accumulator therefore still compares greater and is still rejected.
 1273|       |            // The bound is deliberately independent of that threshold, so raising the threshold
 1274|       |            // later cannot quietly reintroduce the wrap. Peak value is 999, well inside int.
 1275|    156|            constexpr int max_tracked_version = 100;
 1276|    156|            int major_version = 0;
 1277|    940|            while (it != end && *it >= '0' && *it <= '9') {
  ------------------
  |  Branch (1277:20): [True: 918, False: 22]
  |  Branch (1277:33): [True: 784, False: 134]
  |  Branch (1277:47): [True: 784, False: 0]
  ------------------
 1278|    784|               if (major_version < max_tracked_version) {
  ------------------
  |  Branch (1278:20): [True: 444, False: 340]
  ------------------
 1279|    444|                  major_version = major_version * 10 + (*it - '0');
 1280|    444|               }
 1281|    784|               ++it;
 1282|    784|            }
 1283|    156|            if (it == end || *it != '.') {
  ------------------
  |  Branch (1283:17): [True: 22, False: 134]
  |  Branch (1283:30): [True: 38, False: 96]
  ------------------
 1284|     60|               ctx.error = error_code::syntax_error;
 1285|     60|               return;
 1286|     60|            }
 1287|     96|            ++it; // skip '.'
 1288|     96|            if (it == end || *it < '0' || *it > '9') {
  ------------------
  |  Branch (1288:17): [True: 2, False: 94]
  |  Branch (1288:30): [True: 6, False: 88]
  |  Branch (1288:43): [True: 4, False: 84]
  ------------------
 1289|     12|               ctx.error = error_code::syntax_error;
 1290|     12|               return;
 1291|     12|            }
 1292|    352|            while (it != end && *it >= '0' && *it <= '9') {
  ------------------
  |  Branch (1292:20): [True: 344, False: 8]
  |  Branch (1292:33): [True: 268, False: 76]
  |  Branch (1292:47): [True: 268, False: 0]
  ------------------
 1293|    268|               ++it;
 1294|    268|            }
 1295|       |
 1296|       |            // Check for major version > 1 (per spec: should be rejected)
 1297|     84|            if (major_version > 1) {
  ------------------
  |  Branch (1297:17): [True: 12, False: 72]
  ------------------
 1298|     12|               ctx.error = error_code::syntax_error;
 1299|     12|               return;
 1300|     12|            }
 1301|       |
 1302|       |            // After the version, only spaces/tabs and optional comment are allowed.
 1303|       |            // A '#' must be separated by at least one space.
 1304|     72|            if (it != end && *it == '#') {
  ------------------
  |  Branch (1304:17): [True: 68, False: 4]
  |  Branch (1304:30): [True: 4, False: 64]
  ------------------
 1305|      4|               ctx.error = error_code::syntax_error;
 1306|      4|               return;
 1307|      4|            }
 1308|    480|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1308:20): [True: 470, False: 10]
  |  Branch (1308:34): [True: 212, False: 258]
  |  Branch (1308:48): [True: 200, False: 58]
  ------------------
 1309|    412|               ++it;
 1310|    412|            }
 1311|     68|            if (it != end && *it != '\n' && *it != '\r' && *it != '#') {
  ------------------
  |  Branch (1311:17): [True: 58, False: 10]
  |  Branch (1311:30): [True: 54, False: 4]
  |  Branch (1311:45): [True: 42, False: 12]
  |  Branch (1311:60): [True: 34, False: 8]
  ------------------
 1312|     34|               ctx.error = error_code::syntax_error;
 1313|     34|               return;
 1314|     34|            }
 1315|     68|         }
 1316|  8.89k|         else if (directive_name == "TAG") {
  ------------------
  |  Branch (1316:19): [True: 5.83k, False: 3.05k]
  ------------------
 1317|  13.7k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1317:20): [True: 13.6k, False: 16]
  |  Branch (1317:34): [True: 2.39k, False: 11.2k]
  |  Branch (1317:48): [True: 5.47k, False: 5.82k]
  ------------------
 1318|  7.86k|               ++it;
 1319|  7.86k|            }
 1320|       |
 1321|  5.83k|            auto handle_start = it;
 1322|  3.95M|            while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1322:20): [True: 3.95M, False: 54]
  |  Branch (1322:33): [True: 3.95M, False: 5.48k]
  |  Branch (1322:47): [True: 3.95M, False: 284]
  |  Branch (1322:62): [True: 3.95M, False: 16]
  |  Branch (1322:77): [True: 3.95M, False: 4]
  ------------------
 1323|  3.95M|               ++it;
 1324|  3.95M|            }
 1325|  5.83k|            const std::string_view handle(handle_start, static_cast<size_t>(it - handle_start));
 1326|       |
 1327|  12.6k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1327:20): [True: 12.6k, False: 74]
  |  Branch (1327:34): [True: 6.26k, False: 6.34k]
  |  Branch (1327:48): [True: 576, False: 5.76k]
  ------------------
 1328|  6.84k|               ++it;
 1329|  6.84k|            }
 1330|       |
 1331|  5.83k|            auto prefix_start = it;
 1332|  45.9k|            while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1332:20): [True: 45.8k, False: 166]
  |  Branch (1332:33): [True: 42.5k, False: 3.24k]
  |  Branch (1332:47): [True: 42.1k, False: 416]
  |  Branch (1332:62): [True: 40.4k, False: 1.68k]
  |  Branch (1332:77): [True: 40.1k, False: 328]
  ------------------
 1333|  40.1k|               ++it;
 1334|  40.1k|            }
 1335|  5.83k|            const std::string_view prefix(prefix_start, static_cast<size_t>(it - prefix_start));
 1336|       |
 1337|  5.83k|            if (handle.empty() || prefix.empty()) {
  ------------------
  |  Branch (1337:17): [True: 32, False: 5.80k]
  |  Branch (1337:35): [True: 62, False: 5.74k]
  ------------------
 1338|     94|               ctx.error = error_code::syntax_error;
 1339|     94|               return;
 1340|     94|            }
 1341|       |
 1342|  5.74k|            if (handle == "!!") {
  ------------------
  |  Branch (1342:17): [True: 684, False: 5.06k]
  ------------------
 1343|    684|               ctx.secondary_tag_handle_overridden = (prefix != "tag:yaml.org,2002:");
 1344|    684|            }
 1345|  5.74k|         }
 1346|       |         // %TAG and other directives are silently skipped (per spec: should be ignored)
 1347|       |
 1348|       |         // Skip to end of directive line
 1349|   117k|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1349:17): [True: 117k, False: 488]
  |  Branch (1349:30): [True: 111k, False: 5.64k]
  |  Branch (1349:45): [True: 109k, False: 2.70k]
  ------------------
 1350|   109k|            ++it;
 1351|   109k|         }
 1352|       |         // Skip the newline
 1353|  8.83k|         skip_newline(it, end);
 1354|       |         // Skip blank and comment-only lines between directives and document start.
 1355|  10.8k|         while (it != end) {
  ------------------
  |  Branch (1355:17): [True: 10.3k, False: 582]
  ------------------
 1356|  10.3k|            auto line = it;
 1357|  10.3k|            skip_inline_ws(line, end);
 1358|  10.3k|            if (line == end) {
  ------------------
  |  Branch (1358:17): [True: 16, False: 10.2k]
  ------------------
 1359|     16|               it = line;
 1360|     16|               break;
 1361|     16|            }
 1362|  10.2k|            if (*line == '#') {
  ------------------
  |  Branch (1362:17): [True: 688, False: 9.59k]
  ------------------
 1363|    688|               it = line;
 1364|    688|               skip_comment(it, end);
 1365|    688|               skip_newline(it, end);
 1366|    688|               continue;
 1367|    688|            }
 1368|  9.59k|            if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (1368:17): [True: 560, False: 9.03k]
  |  Branch (1368:34): [True: 800, False: 8.23k]
  ------------------
 1369|  1.36k|               it = line;
 1370|  1.36k|               skip_newline(it, end);
 1371|  1.36k|               continue;
 1372|  1.36k|            }
 1373|  8.23k|            break;
 1374|  9.59k|         }
 1375|  8.83k|      }
 1376|       |
 1377|       |      // Check for ---
 1378|   157k|      if (end - it >= 3 && it[0] == '-' && it[1] == '-' && it[2] == '-') {
  ------------------
  |  Branch (1378:11): [True: 155k, False: 1.99k]
  |  Branch (1378:28): [True: 4.24k, False: 150k]
  |  Branch (1378:44): [True: 366, False: 3.87k]
  |  Branch (1378:60): [True: 276, False: 90]
  ------------------
 1379|    276|         auto after = it + 3;
 1380|       |         // Must be followed by whitespace, newline, or end
 1381|    276|         if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' || *after == '#') {
  ------------------
  |  Branch (1381:14): [True: 4, False: 272]
  |  Branch (1381:30): [True: 52, False: 220]
  |  Branch (1381:47): [True: 72, False: 148]
  |  Branch (1381:65): [True: 44, False: 104]
  |  Branch (1381:83): [True: 20, False: 84]
  |  Branch (1381:101): [True: 28, False: 56]
  ------------------
 1382|    220|            auto content = after;
 1383|    708|            while (content != end && (*content == ' ' || *content == '\t')) {
  ------------------
  |  Branch (1383:20): [True: 690, False: 18]
  |  Branch (1383:39): [True: 224, False: 466]
  |  Branch (1383:58): [True: 264, False: 202]
  ------------------
 1384|    488|               ++content;
 1385|    488|            }
 1386|       |            // Per yaml-test-suite, block mappings cannot begin on the same line as '---'.
 1387|    220|            if (content != end && *content != '\n' && *content != '\r' && *content != '#' &&
  ------------------
  |  Branch (1387:17): [True: 202, False: 18]
  |  Branch (1387:35): [True: 158, False: 44]
  |  Branch (1387:55): [True: 134, False: 24]
  |  Branch (1387:75): [True: 106, False: 28]
  ------------------
 1388|    106|                line_could_be_block_mapping(content, end)) {
  ------------------
  |  Branch (1388:17): [True: 24, False: 82]
  ------------------
 1389|     24|               ctx.error = error_code::syntax_error;
 1390|     24|               return;
 1391|     24|            }
 1392|    196|            consumed_document_start = true;
 1393|    196|            it = after;
 1394|       |            // Skip rest of line (whitespace and optional comment)
 1395|    196|            skip_ws_and_comment(it, end);
 1396|    196|            skip_newline(it, end);
 1397|    196|         }
 1398|    276|      }
 1399|       |
 1400|       |      // A directives section must be followed by a document start marker.
 1401|   157k|      if (saw_any_directive && !consumed_document_start) {
  ------------------
  |  Branch (1401:11): [True: 856, False: 156k]
  |  Branch (1401:32): [True: 838, False: 18]
  ------------------
 1402|    838|         ctx.error = error_code::syntax_error;
 1403|    838|         return;
 1404|    838|      }
 1405|   157k|   }
_ZN3glz4yaml14skip_inline_wsIRPKcS3_EEvOT_T0_:
  897|   137M|   {
  898|   165M|      while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (898:14): [True: 164M, False: 1.06M]
  |  Branch (898:28): [True: 26.5M, False: 137M]
  |  Branch (898:42): [True: 1.43M, False: 136M]
  ------------------
  899|  27.9M|         ++it;
  900|  27.9M|      }
  901|   137M|   }
_ZN3glz4yaml12skip_commentIRPKcS3_EEvOT_T0_:
  906|  7.79M|   {
  907|  7.79M|      if (it != end && *it == '#') {
  ------------------
  |  Branch (907:11): [True: 7.09M, False: 705k]
  |  Branch (907:24): [True: 1.74M, False: 5.34M]
  ------------------
  908|       |         // Stops on a forbidden control byte rather than consuming it, leaving the
  909|       |         // caller's line-end validation to reject the document.
  910|   445M|         while (it != end && !comment_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (910:17): [True: 445M, False: 54.4k]
  |  Branch (910:30): [True: 443M, False: 1.69M]
  ------------------
  911|   443M|            ++it;
  912|   443M|         }
  913|  1.74M|      }
  914|  7.79M|   }
_ZN3glz4yaml27line_could_be_block_mappingIPKcS3_EEbT_T0_:
 1112|  3.11M|   {
 1113|  3.11M|      const auto stop = implicit_key_scan_end(it, end);
 1114|       |      // A quote is an indicator only where a node can begin. Once a plain scalar is under way it
 1115|       |      // runs to the end of the line, and the spaces and quotes inside it are content ("a 'b'" is
 1116|       |      // one plain scalar, "a '''" likewise), so the guard is whether a node starts here rather
 1117|       |      // than what the preceding character was. A node starts at the beginning of the scan, after
 1118|       |      // an indicator that ends the node before it, and after the properties that precede one. The
 1119|       |      // other implicit-key probes carry the same model and point here for it.
 1120|  3.11M|      bool at_node_start = true;
 1121|  3.11M|      bool prev_was_whitespace = true; // For the '#' rule, which is about the preceding character
 1122|  3.11M|      int flow_depth = 0;
 1123|  37.0M|      while (it != stop) {
  ------------------
  |  Branch (1123:14): [True: 36.7M, False: 269k]
  ------------------
 1124|  36.7M|         const char c = *it;
 1125|  36.7M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1125:14): [True: 676k, False: 36.0M]
  |  Branch (1125:27): [True: 802k, False: 35.2M]
  ------------------
 1126|  1.47M|            return false;
 1127|  1.47M|         }
 1128|  35.2M|         if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (1128:14): [True: 4.99M, False: 30.2M]
  |  Branch (1128:26): [True: 683k, False: 29.6M]
  ------------------
 1129|  5.68M|            prev_was_whitespace = true; // Whitespace separates nodes, it does not end one
 1130|  5.68M|            ++it;
 1131|  5.68M|            continue;
 1132|  5.68M|         }
 1133|       |         // Past here `c` is an indicator or content. Either way it ends a run of whitespace, and
 1134|       |         // unless a branch below says otherwise it begins a plain scalar that owns the rest of the
 1135|       |         // line, so both flags clear by default and a branch opts back in.
 1136|  29.6M|         const bool after_whitespace = std::exchange(prev_was_whitespace, false);
 1137|  29.6M|         const bool node_start = std::exchange(at_node_start, false);
 1138|       |
 1139|  29.6M|         if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (1139:14): [True: 3.00M, False: 26.6M]
  |  Branch (1139:26): [True: 2.30M, False: 699k]
  ------------------
 1140|  2.30M|            ++it;
 1141|       |            // Colon followed by space, newline, or end indicates a mapping key
 1142|  2.30M|            if (it == end || *it == ' ' || *it == '\t' || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (1142:17): [True: 105k, False: 2.19M]
  |  Branch (1142:30): [True: 797k, False: 1.40M]
  |  Branch (1142:44): [True: 68.0k, False: 1.33M]
  |  Branch (1142:59): [True: 125k, False: 1.20M]
  |  Branch (1142:74): [True: 142k, False: 1.06M]
  ------------------
 1143|  1.23M|               return true;
 1144|  1.23M|            }
 1145|       |            // Otherwise this ':' is part of plain content (e.g., "::", "http://").
 1146|       |            // Continue scanning for a later mapping separator on the same line.
 1147|  1.06M|            continue;
 1148|  2.30M|         }
 1149|       |         // Per YAML spec: # only starts a comment when preceded by whitespace
 1150|       |         // Stop scanning if we hit a comment - any colon after is not a key indicator
 1151|  27.3M|         if (c == '#' && flow_depth == 0 && after_whitespace) {
  ------------------
  |  Branch (1151:14): [True: 929k, False: 26.3M]
  |  Branch (1151:26): [True: 795k, False: 133k]
  |  Branch (1151:45): [True: 97.7k, False: 697k]
  ------------------
 1152|  97.7k|            return false;
 1153|  97.7k|         }
 1154|  27.2M|         if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (1154:15): [True: 213k, False: 26.9M]
  |  Branch (1154:27): [True: 87.1k, False: 26.9M]
  |  Branch (1154:41): [True: 149k, False: 151k]
  ------------------
 1155|   149k|            if (not skip_probe_quoted_scalar(it, stop)) {
  ------------------
  |  Branch (1155:17): [True: 25.7k, False: 123k]
  ------------------
 1156|  25.7k|               return false;
 1157|  25.7k|            }
 1158|   123k|            continue;
 1159|   149k|         }
 1160|       |         // A flow collection opens only where a node can begin, and thereafter every bracket is
 1161|       |         // an indicator because ns-plain-safe-in excludes them. In block context a plain scalar
 1162|       |         // already under way swallows them instead: "a['][]" is one plain key.
 1163|  27.0M|         if ((c == '[' || c == '{') && (node_start || flow_depth > 0)) {
  ------------------
  |  Branch (1163:15): [True: 417k, False: 26.6M]
  |  Branch (1163:27): [True: 910k, False: 25.7M]
  |  Branch (1163:41): [True: 987k, False: 341k]
  |  Branch (1163:55): [True: 122k, False: 218k]
  ------------------
 1164|  1.11M|            ++flow_depth;
 1165|  1.11M|            at_node_start = true;
 1166|  1.11M|            ++it;
 1167|  1.11M|            continue;
 1168|  1.11M|         }
 1169|  25.9M|         if ((c == ']' || c == '}') && flow_depth > 0) {
  ------------------
  |  Branch (1169:15): [True: 208k, False: 25.7M]
  |  Branch (1169:27): [True: 546k, False: 25.1M]
  |  Branch (1169:40): [True: 209k, False: 545k]
  ------------------
 1170|   209k|            --flow_depth; // A closing bracket ends a node; it never starts one
 1171|   209k|            ++it;
 1172|   209k|            continue;
 1173|   209k|         }
 1174|       |         // Inside a flow collection ',' separates entries and ':' ends a key, so a node begins
 1175|       |         // after either. Outside one both are ordinary plain content -- ns-plain-safe-out admits
 1176|       |         // them, which is why "a,'b: c" is a single plain key and "a[b]'c: d" another.
 1177|  25.7M|         if (flow_depth > 0 && (c == ',' || c == ':')) {
  ------------------
  |  Branch (1177:14): [True: 6.51M, False: 19.2M]
  |  Branch (1177:33): [True: 369k, False: 6.14M]
  |  Branch (1177:45): [True: 699k, False: 5.44M]
  ------------------
 1178|  1.06M|            at_node_start = true;
 1179|  1.06M|            ++it;
 1180|  1.06M|            continue;
 1181|  1.06M|         }
 1182|  24.6M|         if (node_start && skip_probe_node_property(it, stop)) {
  ------------------
  |  Branch (1182:14): [True: 4.26M, False: 20.4M]
  |  Branch (1182:28): [True: 1.40M, False: 2.85M]
  ------------------
 1183|  1.40M|            at_node_start = true; // Properties precede the node, so it is still starting
 1184|  1.40M|            continue;
 1185|  1.40M|         }
 1186|  23.2M|         ++it;
 1187|  23.2M|      }
 1188|   269k|      return false;
 1189|  3.11M|   }
_ZN3glz4yaml21implicit_key_scan_endIPKcS3_EET_S4_T0_:
   85|  16.0M|   {
   86|  16.0M|      const size_t remaining = size_t(end - it);
   87|  16.0M|      return it + (remaining < max_implicit_key_lookahead ? remaining : max_implicit_key_lookahead);
  ------------------
  |  Branch (87:20): [True: 12.5M, False: 3.56M]
  ------------------
   88|  16.0M|   }
_ZN3glz4yaml24skip_probe_quoted_scalarIPKcS3_EEbRT_T0_:
 1045|  3.08M|   {
 1046|  3.08M|      const char quote = *it;
 1047|  3.08M|      ++it;
 1048|  13.4M|      while (it != stop) {
  ------------------
  |  Branch (1048:14): [True: 13.4M, False: 13.9k]
  ------------------
 1049|  13.4M|         const char c = *it;
 1050|  13.4M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1050:14): [True: 24.4k, False: 13.4M]
  |  Branch (1050:27): [True: 49.7k, False: 13.3M]
  ------------------
 1051|  74.2k|            return false;
 1052|  74.2k|         }
 1053|  13.3M|         if (c == quote) {
  ------------------
  |  Branch (1053:14): [True: 2.97M, False: 10.4M]
  ------------------
 1054|  2.97M|            ++it;
 1055|  2.97M|            if (quote == '\'' && it != stop && *it == '\'') {
  ------------------
  |  Branch (1055:17): [True: 62.9k, False: 2.90M]
  |  Branch (1055:34): [True: 54.2k, False: 8.67k]
  |  Branch (1055:48): [True: 13.2k, False: 41.0k]
  ------------------
 1056|  13.2k|               ++it; // '' is an escaped quote, not the end of the scalar
 1057|  13.2k|               continue;
 1058|  13.2k|            }
 1059|       |            // A closing quote on the last byte of the window reports closed, though the byte past
 1060|       |            // it could have made the pair an escape. Harmless: `it` is then `stop`, so the caller's
 1061|       |            // loop ends and the probe answers false either way.
 1062|  2.95M|            return true;
 1063|  2.97M|         }
 1064|  10.4M|         if (c == '\\' && quote == '"') {
  ------------------
  |  Branch (1064:14): [True: 143k, False: 10.2M]
  |  Branch (1064:27): [True: 125k, False: 18.0k]
  ------------------
 1065|   125k|            ++it; // Skip escape character
 1066|   125k|            if (it == stop) {
  ------------------
  |  Branch (1066:17): [True: 4.27k, False: 121k]
  ------------------
 1067|  4.27k|               return false;
 1068|  4.27k|            }
 1069|   121k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (1069:17): [True: 9.67k, False: 111k]
  |  Branch (1069:32): [True: 27.2k, False: 84.2k]
  ------------------
 1070|  36.9k|               return false;
 1071|  36.9k|            }
 1072|   121k|         }
 1073|  10.3M|         ++it;
 1074|  10.3M|      }
 1075|  13.9k|      return false;
 1076|  3.08M|   }
_ZN3glz4yaml24skip_probe_node_propertyIPKcS3_EEbRT_T0_:
 1084|  22.1M|   {
 1085|  22.1M|      const char c = *it;
 1086|  22.1M|      if (c == '&' || c == '!') {
  ------------------
  |  Branch (1086:11): [True: 3.13M, False: 19.0M]
  |  Branch (1086:23): [True: 1.14M, False: 17.8M]
  ------------------
 1087|       |         // An anchor name and a tag shorthand both run to the next whitespace or flow indicator.
 1088|  4.27M|         ++it;
 1089|   747M|         while (it != stop && *it != ' ' && *it != '\t' && *it != ',' && *it != '[' && *it != ']' && *it != '{' &&
  ------------------
  |  Branch (1089:17): [True: 747M, False: 214k]
  |  Branch (1089:31): [True: 744M, False: 2.37M]
  |  Branch (1089:45): [True: 744M, False: 517k]
  |  Branch (1089:60): [True: 744M, False: 93.0k]
  |  Branch (1089:74): [True: 743M, False: 51.7k]
  |  Branch (1089:88): [True: 743M, False: 48.8k]
  |  Branch (1089:102): [True: 743M, False: 456k]
  ------------------
 1090|   743M|                *it != '}' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1090:17): [True: 743M, False: 75.9k]
  |  Branch (1090:31): [True: 743M, False: 231k]
  |  Branch (1090:46): [True: 742M, False: 210k]
  ------------------
 1091|   742M|            ++it;
 1092|   742M|         }
 1093|  4.27M|         return true;
 1094|  4.27M|      }
 1095|       |      // Only "? " is the explicit key indicator; "?foo" is an ordinary plain scalar.
 1096|  17.8M|      if (c == '?') {
  ------------------
  |  Branch (1096:11): [True: 1.06M, False: 16.7M]
  ------------------
 1097|  1.06M|         const auto next = it + 1;
 1098|  1.06M|         if (next != stop && (*next == ' ' || *next == '\t')) {
  ------------------
  |  Branch (1098:14): [True: 1.06M, False: 8.39k]
  |  Branch (1098:31): [True: 212k, False: 848k]
  |  Branch (1098:47): [True: 2.62k, False: 845k]
  ------------------
 1099|   215k|            ++it;
 1100|   215k|            return true;
 1101|   215k|         }
 1102|  1.06M|      }
 1103|  17.6M|      return false;
 1104|  17.8M|   }
_ZN3glz4yaml19skip_ws_and_commentIRPKcS3_EEvOT_T0_:
  919|  2.07M|   {
  920|  2.07M|      skip_inline_ws(it, end);
  921|  2.07M|      skip_comment(it, end);
  922|  2.07M|   }
_ZN3glz4yaml17at_document_startIRPKcS3_EEbOT_T0_:
 1411|  8.07M|   {
 1412|  8.07M|      if (end - it >= 3 && it[0] == '-' && it[1] == '-' && it[2] == '-') {
  ------------------
  |  Branch (1412:11): [True: 7.89M, False: 179k]
  |  Branch (1412:28): [True: 372k, False: 7.52M]
  |  Branch (1412:44): [True: 61.3k, False: 311k]
  |  Branch (1412:60): [True: 26.7k, False: 34.6k]
  ------------------
 1413|  26.7k|         auto after = it + 3;
 1414|  26.7k|         return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r';
  ------------------
  |  Branch (1414:17): [True: 4.66k, False: 22.0k]
  |  Branch (1414:33): [True: 6.89k, False: 15.1k]
  |  Branch (1414:50): [True: 3.52k, False: 11.6k]
  |  Branch (1414:68): [True: 3.93k, False: 7.72k]
  |  Branch (1414:86): [True: 1.05k, False: 6.67k]
  ------------------
 1415|  26.7k|      }
 1416|  8.04M|      return false;
 1417|  8.07M|   }
_ZN3glz4yaml15at_document_endIRPKcS3_EEbOT_T0_:
 1423|  10.5M|   {
 1424|  10.5M|      if (end - it >= 3 && it[0] == '.' && it[1] == '.' && it[2] == '.') {
  ------------------
  |  Branch (1424:11): [True: 10.2M, False: 296k]
  |  Branch (1424:28): [True: 218k, False: 10.0M]
  |  Branch (1424:44): [True: 126k, False: 92.4k]
  |  Branch (1424:60): [True: 102k, False: 23.7k]
  ------------------
 1425|   102k|         auto after = it + 3;
 1426|   205k|         while (after != end && (*after == ' ' || *after == '\t')) ++after;
  ------------------
  |  Branch (1426:17): [True: 181k, False: 24.3k]
  |  Branch (1426:34): [True: 70.3k, False: 110k]
  |  Branch (1426:51): [True: 32.5k, False: 78.2k]
  ------------------
 1427|   102k|         return after == end || *after == '\n' || *after == '\r' || *after == '#';
  ------------------
  |  Branch (1427:17): [True: 24.3k, False: 78.2k]
  |  Branch (1427:33): [True: 28.3k, False: 49.8k]
  |  Branch (1427:51): [True: 9.12k, False: 40.7k]
  |  Branch (1427:69): [True: 8.90k, False: 31.8k]
  ------------------
 1428|   102k|      }
 1429|  10.4M|      return false;
 1430|  10.5M|   }
_ZN3glz4yaml25skip_ws_newlines_commentsIRPKcS3_EEvOT_T0_:
  962|  16.7M|   {
  963|  18.0M|      while (it != end) {
  ------------------
  |  Branch (963:14): [True: 18.0M, False: 940]
  ------------------
  964|  18.0M|         if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (964:14): [True: 1.00M, False: 17.0M]
  |  Branch (964:28): [True: 24.4k, False: 17.0M]
  ------------------
  965|  1.02M|            ++it;
  966|  1.02M|         }
  967|  17.0M|         else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (967:19): [True: 75.0k, False: 16.9M]
  |  Branch (967:34): [True: 134k, False: 16.8M]
  ------------------
  968|   209k|            skip_newline(it, end);
  969|   209k|         }
  970|  16.8M|         else if (*it == '#') {
  ------------------
  |  Branch (970:19): [True: 57.5k, False: 16.7M]
  ------------------
  971|  57.5k|            skip_comment(it, end);
  972|  57.5k|         }
  973|  16.7M|         else {
  974|  16.7M|            break;
  975|  16.7M|         }
  976|  18.0M|      }
  977|  16.7M|   }
_ZN3glz4yaml17parse_anchor_nameIPKcS3_EENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEERT_T0_:
 1511|  16.2M|   {
 1512|  16.2M|      auto start = it;
 1513|  16.2M|      if (start == end) return {};
  ------------------
  |  Branch (1513:11): [True: 3.52k, False: 16.2M]
  ------------------
 1514|  2.42G|      while (it != end) {
  ------------------
  |  Branch (1514:14): [True: 2.42G, False: 195k]
  ------------------
 1515|  2.42G|         const char c = *it;
 1516|       |         // Per YAML, anchor names end at whitespace or flow indicators.
 1517|       |         // Colon is allowed in anchor names.
 1518|  2.42G|         if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == '[' || c == ']' || c == '{' ||
  ------------------
  |  Branch (1518:14): [True: 9.10M, False: 2.41G]
  |  Branch (1518:26): [True: 326k, False: 2.41G]
  |  Branch (1518:39): [True: 863k, False: 2.41G]
  |  Branch (1518:52): [True: 1.02M, False: 2.41G]
  |  Branch (1518:65): [True: 605k, False: 2.41G]
  |  Branch (1518:77): [True: 135k, False: 2.41G]
  |  Branch (1518:89): [True: 63.2k, False: 2.41G]
  |  Branch (1518:101): [True: 1.80M, False: 2.40G]
  ------------------
 1519|  2.40G|             c == '}') {
  ------------------
  |  Branch (1519:14): [True: 2.13M, False: 2.40G]
  ------------------
 1520|  16.0M|            break;
 1521|  16.0M|         }
 1522|  2.40G|         ++it;
 1523|  2.40G|      }
 1524|  16.2M|      return std::string_view(&*start, static_cast<size_t>(it - start));
 1525|  16.2M|   }
_ZNK3glz4yaml12yaml_context23transparent_string_hashclENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
  134|  64.4M|         size_t operator()(std::string_view key) const noexcept { return std::hash<std::string_view>{}(key); }
_ZNK3glz4yaml12yaml_context24transparent_string_equalclENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEES7_:
  141|  12.7M|         bool operator()(std::string_view lhs, std::string_view rhs) const noexcept { return lhs == rhs; }
_ZN3glz4yaml14parse_yaml_tagIPKcS3_NS0_12yaml_contextEEENS0_8yaml_tagERT_T0_RKT1_:
  848|  33.4M|   {
  849|  33.4M|      return parse_yaml_tag(it, end, !ctx.secondary_tag_handle_overridden);
  850|  33.4M|   }
_ZN3glz4yaml14parse_yaml_tagIPKcS3_EENS0_8yaml_tagERT_T0_b:
  729|  33.4M|   {
  730|  33.4M|      if (it == end || *it != '!') {
  ------------------
  |  Branch (730:11): [True: 0, False: 33.4M]
  |  Branch (730:24): [True: 30.9M, False: 2.45M]
  ------------------
  731|  30.9M|         return yaml_tag::none;
  732|  30.9M|      }
  733|       |
  734|  2.45M|      ++it; // skip first !
  735|       |
  736|  2.45M|      if (it == end) {
  ------------------
  |  Branch (736:11): [True: 652, False: 2.45M]
  ------------------
  737|    652|         return yaml_tag::unknown;
  738|    652|      }
  739|       |
  740|       |      // Check for !! (shorthand tag)
  741|  2.45M|      if (*it == '!') {
  ------------------
  |  Branch (741:11): [True: 1.53M, False: 913k]
  ------------------
  742|  1.53M|         ++it; // skip second !
  743|       |
  744|       |         // Read tag name
  745|  1.53M|         auto tag_start = it;
  746|  1.22G|         while (it != end && !plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (746:17): [True: 1.22G, False: 8.16k]
  |  Branch (746:30): [True: 1.22G, False: 1.53M]
  ------------------
  747|  1.22G|            ++it;
  748|  1.22G|         }
  749|       |
  750|  1.53M|         std::string_view tag_name(tag_start, static_cast<size_t>(it - tag_start));
  751|  1.53M|         if (tag_name.empty() || malformed_tag_token(tag_name)) {
  ------------------
  |  Branch (751:14): [True: 786, False: 1.53M]
  |  Branch (751:34): [True: 0, False: 1.53M]
  ------------------
  752|    786|            return yaml_tag::unknown;
  753|    786|         }
  754|  1.53M|         if (it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (754:14): [True: 1.53M, False: 7.85k]
  |  Branch (754:27): [True: 540, False: 1.53M]
  ------------------
  755|    540|            return yaml_tag::unknown;
  756|    540|         }
  757|       |
  758|       |         // Skip whitespace after tag
  759|  4.00M|         while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (759:17): [True: 3.99M, False: 8.38k]
  |  Branch (759:31): [True: 1.81M, False: 2.17M]
  |  Branch (759:45): [True: 646k, False: 1.52M]
  ------------------
  760|  2.46M|            ++it;
  761|  2.46M|         }
  762|       |
  763|  1.53M|         if (!allow_core_schema_secondary_handle) {
  ------------------
  |  Branch (763:14): [True: 14, False: 1.53M]
  ------------------
  764|     14|            return yaml_tag::none;
  765|     14|         }
  766|       |
  767|       |         // Match known tags
  768|  1.53M|         if (tag_name == "str") return yaml_tag::str;
  ------------------
  |  Branch (768:14): [True: 42.0k, False: 1.49M]
  ------------------
  769|  1.49M|         if (tag_name == "int") return yaml_tag::int_tag;
  ------------------
  |  Branch (769:14): [True: 29.8k, False: 1.46M]
  ------------------
  770|  1.46M|         if (tag_name == "float") return yaml_tag::float_tag;
  ------------------
  |  Branch (770:14): [True: 21.1k, False: 1.44M]
  ------------------
  771|  1.44M|         if (tag_name == "bool") return yaml_tag::bool_tag;
  ------------------
  |  Branch (771:14): [True: 187k, False: 1.25M]
  ------------------
  772|  1.25M|         if (tag_name == "null") return yaml_tag::null_tag;
  ------------------
  |  Branch (772:14): [True: 10.2k, False: 1.24M]
  ------------------
  773|  1.24M|         if (tag_name == "map") return yaml_tag::map;
  ------------------
  |  Branch (773:14): [True: 170k, False: 1.07M]
  ------------------
  774|  1.07M|         if (tag_name == "seq") return yaml_tag::seq;
  ------------------
  |  Branch (774:14): [True: 362k, False: 713k]
  ------------------
  775|       |
  776|       |         // Unrecognized shorthand tag (e.g., !!omap) — ignore and parse value normally
  777|   713k|         return yaml_tag::none;
  778|  1.07M|      }
  779|       |
  780|       |      // Check for verbatim tag !<...>
  781|   913k|      if (*it == '<') {
  ------------------
  |  Branch (781:11): [True: 11.0k, False: 902k]
  ------------------
  782|  11.0k|         ++it;
  783|  11.0k|         auto tag_start = it;
  784|  7.05M|         while (it != end && *it != '>') {
  ------------------
  |  Branch (784:17): [True: 7.05M, False: 406]
  |  Branch (784:30): [True: 7.04M, False: 10.6k]
  ------------------
  785|  7.04M|            ++it;
  786|  7.04M|         }
  787|  11.0k|         if (it == end) {
  ------------------
  |  Branch (787:14): [True: 406, False: 10.6k]
  ------------------
  788|    406|            return yaml_tag::unknown;
  789|    406|         }
  790|       |
  791|  10.6k|         std::string_view tag_uri(tag_start, static_cast<size_t>(it - tag_start));
  792|  10.6k|         if (tag_uri.empty() || malformed_tag_token(tag_uri)) {
  ------------------
  |  Branch (792:14): [True: 66, False: 10.5k]
  |  Branch (792:33): [True: 416, False: 10.1k]
  ------------------
  793|    482|            return yaml_tag::unknown;
  794|    482|         }
  795|  10.1k|         ++it; // skip >
  796|  10.1k|         if (it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (796:14): [True: 8.65k, False: 1.52k]
  |  Branch (796:27): [True: 320, False: 8.33k]
  ------------------
  797|    320|            return yaml_tag::unknown;
  798|    320|         }
  799|       |
  800|       |         // Skip whitespace after tag
  801|  18.6k|         while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (801:17): [True: 16.9k, False: 1.64k]
  |  Branch (801:31): [True: 6.96k, False: 10.0k]
  |  Branch (801:45): [True: 1.79k, False: 8.21k]
  ------------------
  802|  8.75k|            ++it;
  803|  8.75k|         }
  804|       |
  805|       |         // Match known YAML 1.2 URIs
  806|  9.85k|         if (tag_uri == "tag:yaml.org,2002:str") return yaml_tag::str;
  ------------------
  |  Branch (806:14): [True: 1.30k, False: 8.55k]
  ------------------
  807|  8.55k|         if (tag_uri == "tag:yaml.org,2002:int") return yaml_tag::int_tag;
  ------------------
  |  Branch (807:14): [True: 202, False: 8.35k]
  ------------------
  808|  8.35k|         if (tag_uri == "tag:yaml.org,2002:float") return yaml_tag::float_tag;
  ------------------
  |  Branch (808:14): [True: 440, False: 7.91k]
  ------------------
  809|  7.91k|         if (tag_uri == "tag:yaml.org,2002:bool") return yaml_tag::bool_tag;
  ------------------
  |  Branch (809:14): [True: 194, False: 7.72k]
  ------------------
  810|  7.72k|         if (tag_uri == "tag:yaml.org,2002:null") return yaml_tag::null_tag;
  ------------------
  |  Branch (810:14): [True: 194, False: 7.52k]
  ------------------
  811|  7.52k|         if (tag_uri == "tag:yaml.org,2002:map") return yaml_tag::map;
  ------------------
  |  Branch (811:14): [True: 210, False: 7.31k]
  ------------------
  812|  7.31k|         if (tag_uri == "tag:yaml.org,2002:seq") return yaml_tag::seq;
  ------------------
  |  Branch (812:14): [True: 206, False: 7.11k]
  ------------------
  813|       |
  814|       |         // Unrecognized verbatim tag — ignore and parse value normally
  815|  7.11k|         return yaml_tag::none;
  816|  7.31k|      }
  817|       |
  818|       |      // Named tag !name - skip it and read name
  819|   902k|      auto tag_start = it;
  820|  15.9M|      while (it != end && !plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (820:14): [True: 15.8M, False: 5.92k]
  |  Branch (820:27): [True: 15.0M, False: 896k]
  ------------------
  821|  15.0M|         ++it;
  822|  15.0M|      }
  823|   902k|      std::string_view tag_name(tag_start, static_cast<size_t>(it - tag_start));
  824|   902k|      if (!tag_name.empty() && malformed_tag_token(tag_name)) {
  ------------------
  |  Branch (824:11): [True: 646k, False: 256k]
  |  Branch (824:32): [True: 0, False: 646k]
  ------------------
  825|      0|         return yaml_tag::unknown;
  826|      0|      }
  827|   902k|      if (!tag_name.empty() && it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (827:11): [True: 646k, False: 256k]
  |  Branch (827:32): [True: 640k, False: 5.92k]
  |  Branch (827:45): [True: 716, False: 639k]
  ------------------
  828|    716|         return yaml_tag::unknown;
  829|    716|      }
  830|       |
  831|       |      // Skip whitespace after tag
  832|  1.76M|      while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (832:14): [True: 1.75M, False: 6.40k]
  |  Branch (832:28): [True: 546k, False: 1.21M]
  |  Branch (832:42): [True: 315k, False: 895k]
  ------------------
  833|   861k|         ++it;
  834|   861k|      }
  835|       |
  836|       |      // Unrecognized named tag — ignore and parse value normally
  837|   901k|      return yaml_tag::none;
  838|   902k|   }
_ZN3glz4yaml19malformed_tag_tokenENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  707|  2.19M|   {
  708|       |      // Reject obviously malformed tag tokens used by conformance tests.
  709|       |      // Unknown-but-well-formed tags are still ignored.
  710|  1.24G|      for (const char c : token) {
  ------------------
  |  Branch (710:25): [True: 1.24G, False: 2.19M]
  ------------------
  711|  1.24G|         if (c == '{' || c == '}') return true;
  ------------------
  |  Branch (711:14): [True: 214, False: 1.24G]
  |  Branch (711:26): [True: 202, False: 1.24G]
  ------------------
  712|  1.24G|      }
  713|  2.19M|      return false;
  714|  2.19M|   }
_ZN3glz4yaml25malformed_tag_terminationEc:
  717|  2.17M|   {
  718|  2.17M|      return !(c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '#' || c == ',' || c == ']' || c == '}');
  ------------------
  |  Branch (718:16): [True: 740k, False: 1.43M]
  |  Branch (718:28): [True: 705k, False: 734k]
  |  Branch (718:41): [True: 312k, False: 422k]
  |  Branch (718:54): [True: 125k, False: 296k]
  |  Branch (718:67): [True: 153k, False: 143k]
  |  Branch (718:79): [True: 119k, False: 23.9k]
  |  Branch (718:91): [True: 7.37k, False: 16.6k]
  |  Branch (718:103): [True: 15.0k, False: 1.57k]
  ------------------
  719|  2.17M|   }
_ZN3glz4yaml20tag_valid_for_stringENS0_8yaml_tagE:
  854|  16.8M|   {
  855|  16.8M|      return tag == yaml_tag::none || tag == yaml_tag::str;
  ------------------
  |  Branch (855:14): [True: 16.8M, False: 8.20k]
  |  Branch (855:39): [True: 8.03k, False: 176]
  ------------------
  856|  16.8M|   }
_ZN3glz4yaml17tag_valid_for_mapENS0_8yaml_tagE:
  890|  8.00M|   {
  891|  8.00M|      return tag == yaml_tag::none || tag == yaml_tag::map;
  ------------------
  |  Branch (891:14): [True: 8.00M, False: 4.45k]
  |  Branch (891:39): [True: 4.42k, False: 28]
  ------------------
  892|  8.00M|   }
_ZNK3glz4yaml12yaml_context23alias_span_is_replayingEPKcS3_:
  154|  1.95M|      {
  155|  3.67M|         for (const auto& [b, e] : active_alias_spans) {
  ------------------
  |  Branch (155:34): [True: 3.67M, False: 1.95M]
  ------------------
  156|  3.67M|            if (b == begin && e == end) return true;
  ------------------
  |  Branch (156:17): [True: 3.51k, False: 3.67M]
  |  Branch (156:31): [True: 3.22k, False: 294]
  ------------------
  157|  3.67M|         }
  158|  1.95M|         return false;
  159|  1.95M|      }
_ZN3glz4yaml12yaml_context22charge_alias_expansionEm:
  174|  3.42M|      {
  175|  3.42M|         if (alias_expansion_budget == 0) {
  ------------------
  |  Branch (175:14): [True: 0, False: 3.42M]
  ------------------
  176|      0|            return true; // unbudgeted
  177|      0|         }
  178|  3.42M|         if (bytes >= alias_expansion_budget) {
  ------------------
  |  Branch (178:14): [True: 330, False: 3.42M]
  ------------------
  179|    330|            alias_expansion_budget = 1; // latch: spent, and still not "unbudgeted"
  180|    330|            return false;
  181|    330|         }
  182|  3.42M|         alias_expansion_budget -= bytes;
  183|  3.42M|         return true;
  184|  3.42M|      }
_ZN3glz4yaml12yaml_context11push_indentEi:
  106|  5.14M|      {
  107|  5.14M|         if (indent_stack.size() >= max_yaml_recursive_depth) [[unlikely]] {
  ------------------
  |  Branch (107:14): [True: 0, False: 5.14M]
  ------------------
  108|      0|            error = error_code::exceeded_max_recursive_depth;
  109|      0|            return false;
  110|      0|         }
  111|  5.14M|         indent_stack.push_back(static_cast<int16_t>(indent));
  112|  5.14M|         return true;
  113|  5.14M|      }
_ZN3glz4yaml20skip_ws_and_newlinesIRPKcS3_EEvOT_T0_:
  947|  23.6M|   {
  948|  27.8M|      while (it != end && (*it == ' ' || *it == '\t' || *it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (948:14): [True: 27.8M, False: 33.8k]
  |  Branch (948:28): [True: 2.48M, False: 25.3M]
  |  Branch (948:42): [True: 245k, False: 25.1M]
  |  Branch (948:57): [True: 360k, False: 24.7M]
  |  Branch (948:72): [True: 1.11M, False: 23.6M]
  ------------------
  949|  4.20M|         if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (949:14): [True: 360k, False: 3.84M]
  |  Branch (949:29): [True: 1.11M, False: 2.72M]
  ------------------
  950|  1.47M|            skip_newline(it, end);
  951|  1.47M|         }
  952|  2.72M|         else {
  953|  2.72M|            ++it;
  954|  2.72M|         }
  955|  4.20M|      }
  956|  23.6M|   }
_ZN3glz4yaml19detect_scalar_styleEc:
 1529|  3.22M|   {
 1530|  3.22M|      switch (c) {
 1531|  69.7k|      case '"':
  ------------------
  |  Branch (1531:7): [True: 69.7k, False: 3.15M]
  ------------------
 1532|  69.7k|         return scalar_style::double_quoted;
 1533|  17.1k|      case '\'':
  ------------------
  |  Branch (1533:7): [True: 17.1k, False: 3.20M]
  ------------------
 1534|  17.1k|         return scalar_style::single_quoted;
 1535|  11.8k|      case '|':
  ------------------
  |  Branch (1535:7): [True: 11.8k, False: 3.21M]
  ------------------
 1536|  11.8k|         return scalar_style::literal_block;
 1537|  43.6k|      case '>':
  ------------------
  |  Branch (1537:7): [True: 43.6k, False: 3.17M]
  ------------------
 1538|  43.6k|         return scalar_style::folded_block;
 1539|  3.08M|      default:
  ------------------
  |  Branch (1539:7): [True: 3.08M, False: 142k]
  ------------------
 1540|  3.08M|         return scalar_style::plain;
 1541|  3.22M|      }
 1542|  3.22M|   }
_ZN3glz4yaml23skip_folded_line_indentINS0_12yaml_contextEEEbRPKcS4_RT_Pi:
 1013|   589k|   {
 1014|   589k|      bool saw_space = false;
 1015|   589k|      int indent_count = 0;
 1016|   749k|      while (src < src_end && (*src == ' ' || *src == '\t')) {
  ------------------
  |  Branch (1016:14): [True: 719k, False: 29.8k]
  |  Branch (1016:32): [True: 135k, False: 584k]
  |  Branch (1016:47): [True: 24.7k, False: 559k]
  ------------------
 1017|       |         // In nested block contexts, a tab at indentation column 0 is invalid.
 1018|   159k|         if (*src == '\t' && !saw_space && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1018:14): [True: 24.7k, False: 135k]
  |  Branch (1018:30): [True: 20.8k, False: 3.90k]
  |  Branch (1018:44): [True: 110, False: 20.7k]
  ------------------
 1019|    110|            ctx.error = error_code::syntax_error;
 1020|    110|            return false;
 1021|    110|         }
 1022|   159k|         if (*src == ' ') saw_space = true;
  ------------------
  |  Branch (1022:14): [True: 135k, False: 24.6k]
  ------------------
 1023|   159k|         ++indent_count;
 1024|   159k|         ++src;
 1025|   159k|      }
 1026|   589k|      if (ctx.current_indent() >= 0 && src < src_end && *src != '\n' && *src != '\r' &&
  ------------------
  |  Branch (1026:11): [True: 277k, False: 311k]
  |  Branch (1026:40): [True: 254k, False: 23.6k]
  |  Branch (1026:57): [True: 127k, False: 126k]
  |  Branch (1026:73): [True: 102k, False: 25.2k]
  ------------------
 1027|   102k|          indent_count < ctx.current_indent()) {
  ------------------
  |  Branch (1027:11): [True: 170, False: 102k]
  ------------------
 1028|    170|         ctx.error = error_code::syntax_error;
 1029|    170|         return false;
 1030|    170|      }
 1031|   589k|      if (indent_out) *indent_out = indent_count;
  ------------------
  |  Branch (1031:11): [True: 589k, False: 0]
  ------------------
 1032|   589k|      return true;
 1033|   589k|   }
_ZN3glz4yaml27starts_with_document_markerIPKcS3_EEbT_T0_:
  990|   549k|   {
  991|   549k|      if (src >= src_end) return false;
  ------------------
  |  Branch (991:11): [True: 24.3k, False: 525k]
  ------------------
  992|   525k|      if ((src_end - src) >= 3) {
  ------------------
  |  Branch (992:11): [True: 500k, False: 24.6k]
  ------------------
  993|   500k|         if (src[0] == '-' && src[1] == '-' && src[2] == '-') {
  ------------------
  |  Branch (993:14): [True: 51.2k, False: 449k]
  |  Branch (993:31): [True: 41.3k, False: 9.91k]
  |  Branch (993:48): [True: 3.61k, False: 37.7k]
  ------------------
  994|  3.61k|            const auto* after = src + 3;
  995|  3.61k|            return after == src_end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (995:20): [True: 34, False: 3.57k]
  |  Branch (995:40): [True: 30, False: 3.54k]
  |  Branch (995:57): [True: 30, False: 3.51k]
  |  Branch (995:75): [True: 30, False: 3.48k]
  |  Branch (995:93): [True: 42, False: 3.44k]
  ------------------
  996|  3.44k|                   *after == '#';
  ------------------
  |  Branch (996:20): [True: 30, False: 3.41k]
  ------------------
  997|  3.61k|         }
  998|   497k|         if (src[0] == '.' && src[1] == '.' && src[2] == '.') {
  ------------------
  |  Branch (998:14): [True: 27.9k, False: 469k]
  |  Branch (998:31): [True: 25.2k, False: 2.75k]
  |  Branch (998:48): [True: 20.4k, False: 4.74k]
  ------------------
  999|  20.4k|            const auto* after = src + 3;
 1000|  20.4k|            return after == src_end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (1000:20): [True: 42, False: 20.4k]
  |  Branch (1000:40): [True: 34, False: 20.4k]
  |  Branch (1000:57): [True: 34, False: 20.3k]
  |  Branch (1000:75): [True: 34, False: 20.3k]
  |  Branch (1000:93): [True: 30, False: 20.3k]
  ------------------
 1001|  20.3k|                   *after == '#';
  ------------------
  |  Branch (1001:20): [True: 42, False: 20.2k]
  ------------------
 1002|  20.4k|         }
 1003|   497k|      }
 1004|   501k|      return false;
 1005|   525k|   }
_ZN3glz4yaml19tag_valid_for_floatENS0_8yaml_tagE:
  866|  4.47M|   {
  867|  4.47M|      return tag == yaml_tag::none || tag == yaml_tag::float_tag || tag == yaml_tag::int_tag;
  ------------------
  |  Branch (867:14): [True: 4.47M, False: 4.02k]
  |  Branch (867:39): [True: 1.49k, False: 2.53k]
  |  Branch (867:69): [True: 732, False: 1.80k]
  ------------------
  868|  4.47M|   }
_ZN3glz4yaml18tag_valid_for_boolENS0_8yaml_tagE:
  872|   347k|   {
  873|   347k|      return tag == yaml_tag::none || tag == yaml_tag::bool_tag;
  ------------------
  |  Branch (873:14): [True: 342k, False: 4.57k]
  |  Branch (873:39): [True: 4.54k, False: 28]
  ------------------
  874|   347k|   }
_ZN3glz4yaml12is_yaml_nullENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1564|  83.0k|   {
 1565|  83.0k|      return s == "null" || s == "Null" || s == "NULL" || s == "~" || s.empty();
  ------------------
  |  Branch (1565:14): [True: 39.9k, False: 43.1k]
  |  Branch (1565:29): [True: 11.7k, False: 31.3k]
  |  Branch (1565:44): [True: 24.7k, False: 6.61k]
  |  Branch (1565:59): [True: 0, False: 6.61k]
  |  Branch (1565:71): [True: 6.31k, False: 298]
  ------------------
 1566|  83.0k|   }
_ZN3glz4yaml14measure_indentILb1ERPKcS3_NS0_12yaml_contextEEEiOT0_T1_RT2_:
 1440|  1.95M|   {
 1441|  1.95M|      int32_t indent = 0;
 1442|  3.67M|      while (it != end && *it == ' ') {
  ------------------
  |  Branch (1442:14): [True: 3.41M, False: 262k]
  |  Branch (1442:27): [True: 1.71M, False: 1.69M]
  ------------------
 1443|  1.71M|         ++indent;
 1444|  1.71M|         ++it;
 1445|  1.71M|      }
 1446|       |      // YAML spec: "Tab characters must not be used for indentation"
 1447|  1.95M|      if constexpr (error_on_tab) {
 1448|  1.95M|         if (it != end && *it == '\t') {
  ------------------
  |  Branch (1448:14): [True: 1.69M, False: 262k]
  |  Branch (1448:27): [True: 118, False: 1.69M]
  ------------------
 1449|    118|            ctx.error = error_code::syntax_error;
 1450|    118|         }
 1451|       |      }
 1452|       |      else {
 1453|       |         // In block scalar context: tabs after spaces are content, not indentation.
 1454|       |         // Only error when tab is the first character (pure tab indentation).
 1455|       |         if (indent == 0 && it != end && *it == '\t') {
 1456|       |            ctx.error = error_code::syntax_error;
 1457|       |         }
 1458|       |      }
 1459|  1.95M|      return indent;
 1460|  1.95M|   }
_ZNK3glz4yaml12yaml_context13line_begin_ofEPKc:
  302|  12.9M|      {
  303|  12.9M|         if (!stream_begin || p < stream_begin) {
  ------------------
  |  Branch (303:14): [True: 0, False: 12.9M]
  |  Branch (303:31): [True: 0, False: 12.9M]
  ------------------
  304|      0|            return p;
  305|      0|         }
  306|  12.9M|         memoize_line(p);
  307|  12.9M|         return memo_line_begin;
  308|  12.9M|      }
_ZNK3glz4yaml12yaml_context12memoize_lineEPKc:
  266|  12.9M|      {
  267|  12.9M|         if (memo_line_begin && p >= memo_line_begin && p <= memo_verified_end) {
  ------------------
  |  Branch (267:14): [True: 12.5M, False: 446k]
  |  Branch (267:33): [True: 11.2M, False: 1.21M]
  |  Branch (267:57): [True: 4.74M, False: 6.54M]
  ------------------
  268|  4.74M|            return;
  269|  4.74M|         }
  270|       |         // A query past the memoized span only has to walk the new bytes; one before it (or with
  271|       |         // no memo yet) walks all the way back.
  272|  8.20M|         const bool extends = memo_line_begin && p > memo_verified_end;
  ------------------
  |  Branch (272:31): [True: 7.75M, False: 446k]
  |  Branch (272:50): [True: 6.54M, False: 1.21M]
  ------------------
  273|  8.20M|         const char* const floor = extends ? memo_verified_end : stream_begin;
  ------------------
  |  Branch (273:36): [True: 6.54M, False: 1.65M]
  ------------------
  274|  8.20M|         const char* first_tab = nullptr;
  275|  8.20M|         const char* first_content = nullptr;
  276|  8.20M|         const char* q = p;
  277|  1.57G|         while (q > floor) {
  ------------------
  |  Branch (277:17): [True: 1.56G, False: 3.17M]
  ------------------
  278|  1.56G|            const char c = *(q - 1);
  279|  1.56G|            if (c == '\n' || c == '\r') break;
  ------------------
  |  Branch (279:17): [True: 2.42M, False: 1.56G]
  |  Branch (279:30): [True: 2.60M, False: 1.56G]
  ------------------
  280|  1.56G|            --q;
  281|       |            // Walking backward, the last one seen is the earliest one on the line.
  282|  1.56G|            if (c == '\t')
  ------------------
  |  Branch (282:17): [True: 366k, False: 1.56G]
  ------------------
  283|   366k|               first_tab = q;
  284|  1.56G|            else if (c != ' ')
  ------------------
  |  Branch (284:22): [True: 1.54G, False: 21.5M]
  ------------------
  285|  1.54G|               first_content = q;
  286|  1.56G|         }
  287|  8.20M|         if (extends && q == floor) {
  ------------------
  |  Branch (287:14): [True: 6.54M, False: 1.65M]
  |  Branch (287:25): [True: 2.66M, False: 3.88M]
  ------------------
  288|       |            // The new bytes continue the memoized line, so anything it already found is earlier.
  289|  2.66M|            if (memo_first_tab) first_tab = memo_first_tab;
  ------------------
  |  Branch (289:17): [True: 20.4k, False: 2.63M]
  ------------------
  290|  2.66M|            if (memo_first_content) first_content = memo_first_content;
  ------------------
  |  Branch (290:17): [True: 1.46M, False: 1.19M]
  ------------------
  291|  2.66M|         }
  292|  5.54M|         else {
  293|  5.54M|            memo_line_begin = q;
  294|  5.54M|         }
  295|  8.20M|         memo_verified_end = p;
  296|  8.20M|         memo_first_tab = first_tab;
  297|  8.20M|         memo_first_content = first_content;
  298|  8.20M|      }
_ZN3glz4yaml12yaml_context10pop_indentEv:
  116|  4.70M|      {
  117|  4.70M|         if (!indent_stack.empty()) {
  ------------------
  |  Branch (117:14): [True: 4.70M, False: 0]
  ------------------
  118|  4.70M|            indent_stack.pop_back();
  119|  4.70M|         }
  120|  4.70M|      }
_ZN3glz4yaml17tag_valid_for_seqENS0_8yaml_tagE:
  884|  1.64M|   {
  885|  1.64M|      return tag == yaml_tag::none || tag == yaml_tag::seq;
  ------------------
  |  Branch (885:14): [True: 1.62M, False: 16.0k]
  |  Branch (885:39): [True: 16.0k, False: 36]
  ------------------
  886|  1.64M|   }
_ZN3glz4yaml12yaml_context20charge_key_expansionEm:
  194|  4.01M|      {
  195|  4.01M|         if (key_expansion_budget == 0) {
  ------------------
  |  Branch (195:14): [True: 0, False: 4.01M]
  ------------------
  196|      0|            return true; // unbudgeted
  197|      0|         }
  198|  4.01M|         if (bytes >= key_expansion_budget) {
  ------------------
  |  Branch (198:14): [True: 416, False: 4.01M]
  ------------------
  199|    416|            key_expansion_budget = 1; // latch: spent, and still not "unbudgeted"
  200|    416|            return false;
  201|    416|         }
  202|  4.01M|         key_expansion_budget -= bytes;
  203|  4.01M|         return true;
  204|  4.01M|      }
_ZN3glz4yaml14measure_indentILb0ERPKcS3_NS0_12yaml_contextEEEiOT0_T1_RT2_:
 1440|  10.9M|   {
 1441|  10.9M|      int32_t indent = 0;
 1442|  15.1M|      while (it != end && *it == ' ') {
  ------------------
  |  Branch (1442:14): [True: 14.9M, False: 130k]
  |  Branch (1442:27): [True: 4.14M, False: 10.8M]
  ------------------
 1443|  4.14M|         ++indent;
 1444|  4.14M|         ++it;
 1445|  4.14M|      }
 1446|       |      // YAML spec: "Tab characters must not be used for indentation"
 1447|       |      if constexpr (error_on_tab) {
 1448|       |         if (it != end && *it == '\t') {
 1449|       |            ctx.error = error_code::syntax_error;
 1450|       |         }
 1451|       |      }
 1452|  10.9M|      else {
 1453|       |         // In block scalar context: tabs after spaces are content, not indentation.
 1454|       |         // Only error when tab is the first character (pure tab indentation).
 1455|  10.9M|         if (indent == 0 && it != end && *it == '\t') {
  ------------------
  |  Branch (1455:14): [True: 9.88M, False: 1.08M]
  |  Branch (1455:29): [True: 9.75M, False: 130k]
  |  Branch (1455:42): [True: 240, False: 9.75M]
  ------------------
 1456|    240|            ctx.error = error_code::syntax_error;
 1457|    240|         }
 1458|  10.9M|      }
 1459|  10.9M|      return indent;
 1460|  10.9M|   }
_ZNK3glz4yaml12yaml_context16make_speculativeEv:
  358|  7.73M|      {
  359|  7.73M|         yaml_context c{};
  360|  7.73M|         c.indent_stack = indent_stack;
  361|  7.73M|         c.anchors = anchors;
  362|  7.73M|         c.active_alias_spans = active_alias_spans;
  363|       |         // Speculative work is real work: a probe that expands aliases spends the same budget,
  364|       |         // and the sites that adopt a probe's anchors adopt what it spent along with them.
  365|  7.73M|         c.alias_expansion_budget = alias_expansion_budget;
  366|       |         // Likewise for key text: a probe that built a complex key did the work whether or not
  367|       |         // its alternative is adopted, and an attempt that is never billed can be repeated free.
  368|  7.73M|         c.key_expansion_budget = key_expansion_budget;
  369|  7.73M|         c.sequence_item_value_context = sequence_item_value_context;
  370|  7.73M|         c.sequence_dash_indent = sequence_dash_indent;
  371|  7.73M|         c.explicit_mapping_key_context = explicit_mapping_key_context;
  372|  7.73M|         c.allow_indentless_sequence = allow_indentless_sequence;
  373|  7.73M|         c.stream_begin = stream_begin;
  374|       |         // The line memo only records what the buffer says, so a probe may keep using it.
  375|  7.73M|         c.memo_line_begin = memo_line_begin;
  376|  7.73M|         c.memo_verified_end = memo_verified_end;
  377|  7.73M|         c.memo_first_tab = memo_first_tab;
  378|  7.73M|         c.memo_first_content = memo_first_content;
  379|  7.73M|         c.secondary_tag_handle_overridden = secondary_tag_handle_overridden;
  380|       |         // Carry the recursion depth so a speculative type-probe shares the parent's budget
  381|       |         // and can't reset the stack-overflow guard partway down a deeply nested value.
  382|  7.73M|         c.depth = depth;
  383|  7.73M|         return c;
  384|  7.73M|      }
_ZNK3glz4yaml12yaml_context14current_indentEv:
  103|  69.7M|      int32_t current_indent() const noexcept { return indent_stack.empty() ? int32_t(-1) : indent_stack.back(); }
  ------------------
  |  Branch (103:56): [True: 43.8M, False: 25.8M]
  ------------------
_ZNK3glz4yaml12yaml_context18line_prefix_beforeEPKc:
  311|  9.70M|      {
  312|  9.70M|         const char* const begin = line_begin_of(p);
  313|  9.70M|         if (begin >= p) {
  ------------------
  |  Branch (313:14): [True: 2.37M, False: 7.32M]
  ------------------
  314|  2.37M|            return {};
  315|  2.37M|         }
  316|  7.32M|         return {int32_t(p - begin), memo_first_tab && memo_first_tab < p,
  ------------------
  |  Branch (316:38): [True: 319k, False: 7.01M]
  |  Branch (316:56): [True: 304k, False: 15.0k]
  ------------------
  317|  7.32M|                 memo_first_content && memo_first_content < p};
  ------------------
  |  Branch (317:18): [True: 6.11M, False: 1.21M]
  |  Branch (317:40): [True: 6.10M, False: 5.55k]
  ------------------
  318|  9.70M|      }
_ZN3glz4yaml12skip_newlineIRPKcS3_EEbOT_T0_:
  927|  52.7M|   {
  928|  52.7M|      if (it == end) return false;
  ------------------
  |  Branch (928:11): [True: 90.7k, False: 52.6M]
  ------------------
  929|       |
  930|  52.6M|      if (*it == '\r') {
  ------------------
  |  Branch (930:11): [True: 33.7M, False: 18.8M]
  ------------------
  931|  33.7M|         ++it;
  932|  33.7M|         if (it != end && *it == '\n') {
  ------------------
  |  Branch (932:14): [True: 32.9M, False: 835k]
  |  Branch (932:27): [True: 1.58M, False: 31.3M]
  ------------------
  933|  1.58M|            ++it;
  934|  1.58M|         }
  935|  33.7M|         return true;
  936|  33.7M|      }
  937|  18.8M|      else if (*it == '\n') {
  ------------------
  |  Branch (937:16): [True: 18.8M, False: 2.78k]
  ------------------
  938|  18.8M|         ++it;
  939|  18.8M|         return true;
  940|  18.8M|      }
  941|  2.78k|      return false;
  942|  52.6M|   }

_ZN3glz5parseILj450EE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   69|  39.3k|      {
   70|  39.3k|         if constexpr (requires { ctx.stream_begin; }) {
   71|  39.3k|            if (!ctx.stream_begin && it != end) {
  ------------------
  |  Branch (71:17): [True: 39.3k, False: 0]
  |  Branch (71:38): [True: 39.3k, False: 0]
  ------------------
   72|  39.3k|               ctx.stream_begin = &*it;
   73|       |               // Anchors and the line memo hold pointers into whatever buffer filled them, so a
   74|       |               // reused context must not carry a previous read's into this one.
   75|  39.3k|               if constexpr (requires { ctx.reset_read_state(); }) {
   76|  39.3k|                  ctx.reset_read_state();
   77|  39.3k|               }
   78|       |               // Seed the alias replay budget from the document this read was handed. Done here
   79|       |               // rather than in glz::read so every YAML entry point is covered, and only on the
   80|       |               // outermost parse so a nested document does not hand itself a fresh budget.
   81|  39.3k|               if constexpr (requires { ctx.alias_expansion_budget; } && requires { size_t(end - it); }) {
   82|  39.3k|                  const size_t scaled = size_t(end - it) * yaml::max_alias_expansion_factor;
   83|  39.3k|                  ctx.alias_expansion_budget =
   84|  39.3k|                     scaled > yaml::min_alias_expansion_bytes ? scaled : yaml::min_alias_expansion_bytes;
  ------------------
  |  Branch (84:22): [True: 293, False: 39.0k]
  ------------------
   85|  39.3k|               }
   86|       |               // Same treatment for the text complex keys materialize, seeded on its own budget so
   87|       |               // exhausting one reports which of the two ran away.
   88|  39.3k|               if constexpr (requires { ctx.key_expansion_budget; } && requires { size_t(end - it); }) {
   89|  39.3k|                  const size_t scaled = size_t(end - it) * yaml::max_key_expansion_factor;
   90|  39.3k|                  ctx.key_expansion_budget =
   91|  39.3k|                     scaled > yaml::min_key_expansion_bytes ? scaled : yaml::min_key_expansion_bytes;
  ------------------
  |  Branch (91:22): [True: 293, False: 39.0k]
  ------------------
   92|  39.3k|               }
   93|  39.3k|            }
   94|  39.3k|         }
   95|       |         // Skip YAML directives and document start marker (---) if present
   96|  39.3k|         yaml::skip_document_start(it, end, ctx);
   97|  39.3k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (97:14): [True: 285, False: 39.0k]
  ------------------
   98|    285|            return;
   99|    285|         }
  100|       |
  101|  39.0k|         using V = std::remove_cvref_t<T>;
  102|  39.0k|         if (it == end) {
  ------------------
  |  Branch (102:14): [True: 60, False: 38.9k]
  ------------------
  103|       |            // An empty document is a valid YAML null document.
  104|     60|            if constexpr (requires { value = nullptr; }) {
  105|     60|               value = nullptr;
  106|     60|               return;
  107|       |            }
  108|       |            else if constexpr (nullable_like<V>) {
  109|       |               value = {};
  110|       |               return;
  111|       |            }
  112|       |            else {
  113|       |               ctx.error = error_code::unexpected_end;
  114|       |               return;
  115|       |            }
  116|     60|         }
  117|       |
  118|       |         // A bare document boundary marker at root denotes an empty document.
  119|       |         // Examples: "---\n---\n", "# comment\n...\n"
  120|  39.0k|         if (yaml::at_document_start(it, end) || yaml::at_document_end(it, end)) {
  ------------------
  |  Branch (120:14): [True: 65, False: 38.9k]
  |  Branch (120:50): [True: 18, False: 38.9k]
  ------------------
  121|     23|            if constexpr (requires { value = nullptr; }) {
  122|     23|               value = nullptr;
  123|     23|               return;
  124|       |            }
  125|       |            else if constexpr (nullable_like<V>) {
  126|       |               value = {};
  127|       |               return;
  128|       |            }
  129|       |            else {
  130|       |               ctx.error = error_code::unexpected_end;
  131|       |               return;
  132|       |            }
  133|     23|         }
  134|       |
  135|      0|         from<YAML, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  136|       |
  137|       |         // A directive line (%YAML/%TAG/...) is only valid in the document prefix.
  138|       |         // If parsing stopped before the end and we encounter a directive in the
  139|       |         // remaining tail, treat it as malformed stream structure. This is a document-level
  140|       |         // concern, so only enforce it at the document root: a nested call (e.g. a tagged
  141|       |         // variant handing a custom alternative its body) is mid-document and its tail
  142|       |         // belongs to an enclosing node, not this value.
  143|  39.0k|         if constexpr (!check_partial_read(Opts)) {
  144|  39.0k|            if (!bool(ctx.error) && ctx.current_indent() < 0) {
  ------------------
  |  Branch (144:17): [True: 8.16k, False: 30.8k]
  |  Branch (144:37): [True: 8.16k, False: 0]
  ------------------
  145|  8.16k|               auto is_document_start = [&](auto pos) {
  146|  8.16k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  147|  8.16k|                     auto after = pos + 3;
  148|  8.16k|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  149|  8.16k|                            *after == '#';
  150|  8.16k|                  }
  151|  8.16k|                  return false;
  152|  8.16k|               };
  153|       |
  154|       |               // The scan below reads the tail a line at a time, which only means anything if the
  155|       |               // tail starts at one. A root node can stop mid-line -- a plain scalar ends at a
  156|       |               // ':' it is not allowed to take as a separator, a flow collection ends at its
  157|       |               // bracket -- and what sits after it there is leftover content on that line, not
  158|       |               // the opening of a new one. Only inline whitespace and a comment may follow. Let
  159|       |               // the line scan see anything else and it misreads it: a leftover ':' passes as an
  160|       |               // explicit-key continuation and the remainder of the document falls on the floor.
  161|  8.16k|               if constexpr (requires { ctx.line_prefix_before(it); }) {
  162|  8.16k|                  if (it != end && ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (162:23): [True: 1.46k, False: 6.69k]
  |  Branch (162:23): [True: 1.00k, False: 7.15k]
  |  Branch (162:36): [True: 1.00k, False: 459]
  ------------------
  163|  1.00k|                     auto rest = it;
  164|  1.87k|                     while (rest != end && (*rest == ' ' || *rest == '\t')) ++rest;
  ------------------
  |  Branch (164:29): [True: 1.82k, False: 52]
  |  Branch (164:45): [True: 507, False: 1.31k]
  |  Branch (164:61): [True: 362, False: 956]
  ------------------
  165|  1.00k|                     if (rest != end && *rest != '\n' && *rest != '\r' && *rest != '#') {
  ------------------
  |  Branch (165:26): [True: 956, False: 52]
  |  Branch (165:41): [True: 692, False: 264]
  |  Branch (165:58): [True: 402, False: 290]
  |  Branch (165:75): [True: 318, False: 84]
  ------------------
  166|    318|                        ctx.error = error_code::syntax_error;
  167|    318|                        return;
  168|    318|                     }
  169|  1.00k|                  }
  170|  8.16k|               }
  171|       |
  172|  7.84k|               auto tail_scan = it;
  173|  8.16k|               bool seen_document_end_marker = false;
  174|  41.0k|               while (tail_scan != end) {
  ------------------
  |  Branch (174:23): [True: 33.5k, False: 7.46k]
  ------------------
  175|  33.5k|                  auto line = tail_scan;
  176|  41.4k|                  while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (176:26): [True: 41.3k, False: 93]
  |  Branch (176:42): [True: 7.29k, False: 34.0k]
  |  Branch (176:58): [True: 627, False: 33.4k]
  ------------------
  177|  33.5k|                  if (line != tail_scan && line != end && *line != '\n' && *line != '\r' && *line != '#') {
  ------------------
  |  Branch (177:23): [True: 1.23k, False: 32.3k]
  |  Branch (177:44): [True: 1.14k, False: 93]
  |  Branch (177:59): [True: 806, False: 335]
  |  Branch (177:76): [True: 505, False: 301]
  |  Branch (177:93): [True: 131, False: 374]
  ------------------
  178|       |                     // Indented tail usually belongs to continuation content.
  179|       |                     // But a plain "key: value" pattern here indicates malformed
  180|       |                     // trailing mapping content after a completed root node.
  181|    131|                     const char first = *line;
  182|    131|                     const bool explicit_or_structural_start =
  183|    131|                        (first == ':' || first == '?' || first == '!' || first == '&' || first == '*' || first == '[' ||
  ------------------
  |  Branch (183:26): [True: 11, False: 120]
  |  Branch (183:42): [True: 3, False: 117]
  |  Branch (183:58): [True: 3, False: 114]
  |  Branch (183:74): [True: 3, False: 111]
  |  Branch (183:90): [True: 6, False: 105]
  |  Branch (183:106): [True: 4, False: 101]
  ------------------
  184|    101|                         first == '{' || first == '"' || first == '\'' || first == '-');
  ------------------
  |  Branch (184:26): [True: 2, False: 99]
  |  Branch (184:42): [True: 3, False: 96]
  |  Branch (184:58): [True: 2, False: 94]
  |  Branch (184:75): [True: 7, False: 87]
  ------------------
  185|    131|                     if (!explicit_or_structural_start) {
  ------------------
  |  Branch (185:26): [True: 87, False: 44]
  ------------------
  186|     87|                        auto scan = line;
  187|  1.03k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (187:32): [True: 986, False: 50]
  |  Branch (187:47): [True: 979, False: 7]
  |  Branch (187:64): [True: 977, False: 2]
  ------------------
  188|    977|                           if (*scan == ':') {
  ------------------
  |  Branch (188:32): [True: 305, False: 672]
  ------------------
  189|    305|                              auto after = scan + 1;
  190|    305|                              if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (190:35): [True: 21, False: 284]
  |  Branch (190:51): [True: 2, False: 282]
  |  Branch (190:68): [True: 2, False: 280]
  |  Branch (190:86): [True: 1, False: 279]
  |  Branch (190:104): [True: 2, False: 277]
  ------------------
  191|     28|                                 ctx.error = error_code::syntax_error;
  192|     28|                                 return;
  193|     28|                              }
  194|    305|                           }
  195|    949|                           ++scan;
  196|    949|                        }
  197|     87|                     }
  198|    103|                     return;
  199|    131|                  }
  200|  33.4k|                  if (line == end) {
  ------------------
  |  Branch (200:23): [True: 93, False: 33.3k]
  ------------------
  201|     93|                     return;
  202|     93|                  }
  203|  33.3k|                  if (*line == ':' || *line == '?') {
  ------------------
  |  Branch (203:23): [True: 28, False: 33.3k]
  |  Branch (203:39): [True: 14, False: 33.2k]
  ------------------
  204|     42|                     return; // Explicit key/value continuation.
  205|     42|                  }
  206|  33.2k|                  if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (206:23): [True: 13.5k, False: 19.7k]
  |  Branch (206:40): [True: 6.04k, False: 13.7k]
  ------------------
  207|  19.5k|                     tail_scan = line;
  208|  19.5k|                     yaml::skip_newline(tail_scan, end);
  209|  19.5k|                     continue;
  210|  19.5k|                  }
  211|  13.7k|                  if (*line == '#') {
  ------------------
  |  Branch (211:23): [True: 10.2k, False: 3.46k]
  ------------------
  212|  81.7k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (212:29): [True: 81.6k, False: 132]
  |  Branch (212:49): [True: 79.4k, False: 2.21k]
  |  Branch (212:71): [True: 71.4k, False: 7.92k]
  ------------------
  213|  10.2k|                     yaml::skip_newline(tail_scan, end);
  214|  10.2k|                     continue;
  215|  10.2k|                  }
  216|  3.46k|                  if (yaml::at_document_end(line, end)) {
  ------------------
  |  Branch (216:23): [True: 3.03k, False: 435]
  ------------------
  217|  3.03k|                     seen_document_end_marker = true;
  218|  23.1k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (218:29): [True: 23.1k, False: 85]
  |  Branch (218:49): [True: 20.9k, False: 2.11k]
  |  Branch (218:71): [True: 20.1k, False: 834]
  ------------------
  219|  3.03k|                     yaml::skip_newline(tail_scan, end);
  220|  3.03k|                     continue;
  221|  3.03k|                  }
  222|    435|                  if (is_document_start(line)) {
  ------------------
  |  Branch (222:23): [True: 121, False: 314]
  ------------------
  223|       |                     // Additional documents are accepted, but document-start lines
  224|       |                     // that use non-standard tag handles (e.g. !prefix!Type) are
  225|       |                     // malformed in this single-document reader unless re-declared
  226|       |                     // for that document. Reject this shape in the stream tail.
  227|    121|                     auto header = line + 3;
  228|    754|                     while (header != end && (*header == ' ' || *header == '\t')) ++header;
  ------------------
  |  Branch (228:29): [True: 725, False: 29]
  |  Branch (228:47): [True: 337, False: 388]
  |  Branch (228:65): [True: 296, False: 92]
  ------------------
  229|    121|                     if (header != end && *header == '!') {
  ------------------
  |  Branch (229:26): [True: 92, False: 29]
  |  Branch (229:43): [True: 47, False: 45]
  ------------------
  230|     47|                        auto tag_end = header + 1;
  231|   710k|                        while (tag_end != end && *tag_end != ' ' && *tag_end != '\t' && *tag_end != '\n' &&
  ------------------
  |  Branch (231:32): [True: 710k, False: 18]
  |  Branch (231:50): [True: 710k, False: 19]
  |  Branch (231:69): [True: 710k, False: 3]
  |  Branch (231:89): [True: 710k, False: 1]
  ------------------
  232|   710k|                               *tag_end != '\r' && *tag_end != '#') {
  ------------------
  |  Branch (232:32): [True: 710k, False: 2]
  |  Branch (232:52): [True: 710k, False: 4]
  ------------------
  233|   710k|                           ++tag_end;
  234|   710k|                        }
  235|     47|                        std::string_view tag_token(header, static_cast<size_t>(tag_end - header));
  236|     47|                        const auto second_bang = tag_token.find('!', 1);
  237|     47|                        if (second_bang != std::string_view::npos) {
  ------------------
  |  Branch (237:29): [True: 31, False: 16]
  ------------------
  238|     31|                           std::string_view handle = tag_token.substr(0, second_bang + 1);
  239|     31|                           if (handle != "!" && handle != "!!") {
  ------------------
  |  Branch (239:32): [True: 31, False: 0]
  |  Branch (239:49): [True: 28, False: 3]
  ------------------
  240|     28|                              ctx.error = error_code::syntax_error;
  241|     28|                              return;
  242|     28|                           }
  243|     31|                        }
  244|     47|                     }
  245|     93|                     return; // Additional documents are allowed in the stream tail.
  246|    121|                  }
  247|    314|                  if (line != end && *line == '%') {
  ------------------
  |  Branch (247:23): [True: 314, False: 0]
  |  Branch (247:38): [True: 9, False: 305]
  ------------------
  248|       |                     // YAML directives are only valid in document prefixes. A directive
  249|       |                     // encountered mid-document (without a prior ...) is malformed.
  250|      9|                     if (!seen_document_end_marker) {
  ------------------
  |  Branch (250:26): [True: 7, False: 2]
  ------------------
  251|      7|                        ctx.error = error_code::syntax_error;
  252|      7|                        return;
  253|      7|                     }
  254|      2|                     return;
  255|      9|                  }
  256|    305|                  if (seen_document_end_marker) {
  ------------------
  |  Branch (256:23): [True: 48, False: 257]
  ------------------
  257|     48|                     return; // Implicit next document after explicit document end marker.
  258|     48|                  }
  259|    257|                  ctx.error = error_code::syntax_error;
  260|    257|                  return;
  261|    305|               }
  262|  8.16k|            }
  263|  39.0k|         }
  264|  39.0k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|   583k|      {
  275|   583k|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|   583k|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|   583k|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|   583k|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_:
 5725|   754k|      {
 5726|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5727|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5728|   754k|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5729|   754k|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5730|   754k|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5731|   754k|                       "the internally tagged shape, so it is rejected here instead.");
 5732|   754k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5732:14): [True: 0, False: 754k]
  ------------------
 5733|      0|            return;
 5734|       |
 5735|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5736|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5737|       |         // indent stack does not cover.
 5738|   754k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5739|   754k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5739:14): [True: 17, False: 754k]
  ------------------
 5740|     17|            return;
 5741|       |
 5742|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5743|       |         // For nested values, only skip inline whitespace to preserve block structure
 5744|   754k|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5744:14): [True: 117k, False: 636k]
  ------------------
 5745|   117k|            yaml::skip_ws_newlines_comments(it, end);
 5746|   117k|         }
 5747|   636k|         else {
 5748|   636k|            yaml::skip_inline_ws(it, end);
 5749|   636k|         }
 5750|       |
 5751|   754k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5751:14): [True: 110, False: 754k]
  ------------------
 5752|    110|            ctx.error = error_code::unexpected_end;
 5753|    110|            return;
 5754|    110|         }
 5755|       |
 5756|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5757|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5758|       |         // same variant definitions round-trip across both formats.
 5759|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5760|       |            using V = std::remove_cvref_t<T>;
 5761|       |            const bool value_is_mapping =
 5762|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5763|       |            if (value_is_mapping) {
 5764|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5765|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5766|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5767|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5768|       |               auto tag_ctx = ctx.make_speculative();
 5769|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5770|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5771|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5772|       |               if (index < ids_v<V>.size()) {
 5773|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5774|       |                  emplace_runtime_variant(value, index);
 5775|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5776|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5777|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5778|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5779|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5780|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5781|       |                     return;
 5782|       |                  }
 5783|       |                  std::visit(
 5784|       |                     [&](auto&& alt) {
 5785|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5786|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5787|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5788|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5789|       |                        }
 5790|       |                        else if constexpr (custom_read<Alt>) {
 5791|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5792|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5793|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5794|       |                           // entry, then hand the remaining mapping to the custom handler.
 5795|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5796|       |                              ctx.error = error_code::feature_not_supported;
 5797|       |                              ctx.custom_error_message =
 5798|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5799|       |                           }
 5800|       |                           else {
 5801|       |                              ctx.scratch.clear();
 5802|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5803|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5804|       |                                    ctx.error = error_code::feature_not_supported;
 5805|       |                                    ctx.custom_error_message =
 5806|       |                                       "the tag must be the first key for a custom variant alternative";
 5807|       |                                 }
 5808|       |                                 else {
 5809|       |                                    yaml::skip_inline_ws(it, end);
 5810|       |                                    if (it == end || *it != ':') {
 5811|       |                                       ctx.error = error_code::syntax_error;
 5812|       |                                    }
 5813|       |                                    else {
 5814|       |                                       ++it;
 5815|       |                                       yaml::skip_inline_ws(it, end);
 5816|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5817|       |                                       if (!bool(ctx.error)) {
 5818|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5819|       |                                          // was the whole mapping: leave the alternative default.
 5820|       |                                          auto probe = it;
 5821|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5822|       |                                          if (probe == end) {
 5823|       |                                             it = probe;
 5824|       |                                          }
 5825|       |                                          else {
 5826|       |                                             // Publish the mapping's column so the custom handler's block
 5827|       |                                             // mapping (which would otherwise discover its own indent) reads
 5828|       |                                             // the remaining entries at the variant's indent and dedents
 5829|       |                                             // correctly in every context (root, sequence, nested).
 5830|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5831|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5832|       |                                             ctx.forced_block_mapping_indent = -1;
 5833|       |                                          }
 5834|       |                                       }
 5835|       |                                    }
 5836|       |                                 }
 5837|       |                              }
 5838|       |                           }
 5839|       |                        }
 5840|       |                        else {
 5841|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5842|       |                           // the value, but the mapping must still be consumed.
 5843|       |                           walk_tagged_mapping<Opts>(
 5844|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5845|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5846|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5847|       |                              });
 5848|       |                        }
 5849|       |                     },
 5850|       |                     value);
 5851|       |                  ctx.pop_indent();
 5852|       |                  return;
 5853|       |               }
 5854|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5855|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5856|       |               // otherwise the deduction path reports no_matching_variant_type.
 5857|       |            }
 5858|       |         }
 5859|       |
 5860|   754k|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5861|   754k|            using V = std::remove_cvref_t<T>;
 5862|   754k|            using counts = yaml_variant_type_count<V>;
 5863|   754k|            const char c = *it;
 5864|   754k|            auto is_plain_scalar_boundary = [](const char ch) {
 5865|   754k|               switch (ch) {
 5866|   754k|               case ' ':
 5867|   754k|               case '\t':
 5868|   754k|               case '\n':
 5869|   754k|               case '\r':
 5870|   754k|               case ',':
 5871|   754k|               case ']':
 5872|   754k|               case '}':
 5873|   754k|                  return true;
 5874|   754k|               default:
 5875|   754k|                  return false;
 5876|   754k|               }
 5877|   754k|            };
 5878|       |
 5879|   754k|            auto has_indented_block_continuation = [&](auto word_end) {
 5880|   754k|               if constexpr (yaml::check_flow_context(Opts)) {
 5881|   754k|                  return false;
 5882|   754k|               }
 5883|   754k|               if (ctx.current_indent() < 0) {
 5884|   754k|                  return false;
 5885|   754k|               }
 5886|   754k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5887|   754k|                  return false;
 5888|   754k|               }
 5889|       |
 5890|   754k|               auto look = word_end;
 5891|   754k|               yaml::skip_newline(look, end);
 5892|   754k|               while (look != end) {
 5893|   754k|                  int32_t line_indent = 0;
 5894|   754k|                  while (look != end && *look == ' ') {
 5895|   754k|                     ++line_indent;
 5896|   754k|                     ++look;
 5897|   754k|                  }
 5898|   754k|                  if (look != end && *look == '\t') {
 5899|   754k|                     return false;
 5900|   754k|                  }
 5901|   754k|                  if (look == end || *look == '\n' || *look == '\r') {
 5902|   754k|                     if (look != end) {
 5903|   754k|                        yaml::skip_newline(look, end);
 5904|   754k|                        continue;
 5905|   754k|                     }
 5906|   754k|                     return false;
 5907|   754k|                  }
 5908|   754k|                  if (*look == '#') {
 5909|   754k|                     yaml::skip_comment(look, end);
 5910|   754k|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5911|   754k|                        yaml::skip_newline(look, end);
 5912|   754k|                        continue;
 5913|   754k|                     }
 5914|   754k|                     return false;
 5915|   754k|                  }
 5916|       |
 5917|       |                  // If the next non-empty line is an implicit mapping entry,
 5918|       |                  // don't treat it as scalar continuation for auto-deduced
 5919|       |                  // booleans/nulls.
 5920|   754k|                  {
 5921|   754k|                     auto scan = look;
 5922|   754k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5923|   754k|                        if (*scan == ':') {
 5924|   754k|                           auto after_colon = scan + 1;
 5925|   754k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5926|   754k|                               *after_colon == '\n' || *after_colon == '\r') {
 5927|   754k|                              return false;
 5928|   754k|                           }
 5929|   754k|                        }
 5930|   754k|                        ++scan;
 5931|   754k|                     }
 5932|   754k|                  }
 5933|       |
 5934|   754k|                  return line_indent > ctx.current_indent();
 5935|   754k|               }
 5936|   754k|               return false;
 5937|   754k|            };
 5938|   754k|            auto is_word_boundary = [&](const auto ptr) {
 5939|   754k|               if (ptr == end) {
 5940|   754k|                  return true;
 5941|   754k|               }
 5942|   754k|               if (*ptr == ':') {
 5943|   754k|                  auto next = ptr + 1;
 5944|   754k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5945|   754k|               }
 5946|   754k|               return is_plain_scalar_boundary(*ptr);
 5947|   754k|            };
 5948|       |
 5949|   754k|            switch (c) {
 5950|   126k|            case '&': {
  ------------------
  |  Branch (5950:13): [True: 126k, False: 627k]
  ------------------
 5951|       |               // Anchor before value: parse name, then re-dispatch
 5952|   126k|               ++it;
 5953|   126k|               auto aname = yaml::parse_anchor_name(it, end);
 5954|   126k|               if (aname.empty()) {
  ------------------
  |  Branch (5954:20): [True: 168, False: 126k]
  ------------------
 5955|    168|                  ctx.error = error_code::syntax_error;
 5956|    168|                  return;
 5957|    168|               }
 5958|   126k|               yaml::skip_inline_ws(it, end);
 5959|   126k|               bool anchor_on_same_line = true;
 5960|   126k|               bool value_is_indentless_sequence = false;
 5961|   126k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5961:20): [True: 1.34k, False: 125k]
  |  Branch (5961:33): [True: 7.26k, False: 117k]
  |  Branch (5961:48): [True: 13.6k, False: 104k]
  |  Branch (5961:63): [True: 6.97k, False: 97.3k]
  ------------------
 5962|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5963|       |                  // next line (indented past current context) or if this is an empty node.
 5964|  29.2k|                  bool value_on_next_line = false;
 5965|  29.2k|                  if (it != end) {
  ------------------
  |  Branch (5965:23): [True: 27.8k, False: 1.34k]
  ------------------
 5966|  27.8k|                     auto peek = it;
 5967|       |                     // Skip comment if present
 5968|  27.8k|                     if (*peek == '#') {
  ------------------
  |  Branch (5968:26): [True: 6.97k, False: 20.9k]
  ------------------
 5969|  96.5k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5969:32): [True: 95.9k, False: 625]
  |  Branch (5969:47): [True: 93.7k, False: 2.17k]
  |  Branch (5969:64): [True: 89.5k, False: 4.17k]
  ------------------
 5970|  6.97k|                     }
 5971|       |                     // Skip newline
 5972|  27.8k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5972:26): [True: 27.2k, False: 625]
  |  Branch (5972:42): [True: 9.43k, False: 17.8k]
  |  Branch (5972:59): [True: 17.8k, False: 0]
  ------------------
 5973|  27.2k|                        yaml::skip_newline(peek, end);
 5974|       |                        // Skip blank lines
 5975|  55.1k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5975:32): [True: 50.7k, False: 4.38k]
  |  Branch (5975:48): [True: 8.43k, False: 42.3k]
  |  Branch (5975:65): [True: 19.4k, False: 22.8k]
  ------------------
 5976|  27.8k|                           yaml::skip_newline(peek, end);
 5977|  27.8k|                        }
 5978|       |                        // Measure indent of next content line
 5979|  27.2k|                        int32_t next_indent = 0;
 5980|  79.5k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5980:32): [True: 74.7k, False: 4.82k]
  |  Branch (5980:47): [True: 52.2k, False: 22.4k]
  ------------------
 5981|  52.2k|                           ++next_indent;
 5982|  52.2k|                           ++peek;
 5983|  52.2k|                        }
 5984|  27.2k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5984:29): [True: 22.4k, False: 4.82k]
  |  Branch (5984:44): [True: 21.8k, False: 569]
  |  Branch (5984:61): [True: 21.3k, False: 484]
  ------------------
 5985|  21.3k|                           const bool indentless_sequence =
 5986|  21.3k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5986:31): [True: 19.3k, False: 2.07k]
  |  Branch (5986:69): [True: 7.76k, False: 11.5k]
  ------------------
 5987|  7.76k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5987:32): [True: 286, False: 7.48k]
  ------------------
 5988|  7.48k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5988:32): [True: 7.08k, False: 398]
  ------------------
 5989|  7.37k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5989:32): [True: 2.55k, False: 4.81k]
  ------------------
 5990|  4.81k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5990:33): [True: 3.53k, False: 1.28k]
  |  Branch (5990:61): [True: 2.03k, False: 1.50k]
  ------------------
 5991|  21.3k|                           value_is_indentless_sequence = indentless_sequence;
 5992|  21.3k|                           const bool same_indent_property_node =
 5993|  21.3k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5993:31): [True: 6.59k, False: 14.8k]
  ------------------
 5994|  6.59k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5994:32): [True: 473, False: 6.11k]
  |  Branch (5994:48): [True: 1.48k, False: 4.63k]
  |  Branch (5994:64): [True: 263, False: 4.37k]
  |  Branch (5994:80): [True: 336, False: 4.03k]
  |  Branch (5994:96): [True: 278, False: 3.75k]
  ------------------
 5995|  3.75k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5995:32): [True: 447, False: 3.31k]
  |  Branch (5995:48): [True: 257, False: 3.05k]
  |  Branch (5995:65): [True: 265, False: 2.78k]
  |  Branch (5995:81): [True: 56, False: 2.73k]
  ------------------
 5996|  21.3k|                           value_on_next_line =
 5997|  21.3k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5997:31): [True: 8.64k, False: 12.7k]
  |  Branch (5997:71): [True: 4.58k, False: 8.16k]
  |  Branch (5997:94): [True: 3.85k, False: 4.30k]
  ------------------
 5998|  21.3k|                        }
 5999|  27.2k|                     }
 6000|  27.8k|                  }
 6001|  29.2k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6001:23): [True: 12.1k, False: 17.0k]
  ------------------
 6002|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6003|  12.1k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6004|  12.1k|                     return;
 6005|  12.1k|                  }
 6006|       |                  // Value is on next line — advance past newline/blank lines to the content
 6007|  17.0k|                  if (*it == '#') {
  ------------------
  |  Branch (6007:23): [True: 4.55k, False: 12.5k]
  ------------------
 6008|  55.2k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6008:29): [True: 55.2k, False: 0]
  |  Branch (6008:42): [True: 53.6k, False: 1.67k]
  |  Branch (6008:57): [True: 50.7k, False: 2.87k]
  ------------------
 6009|  4.55k|                  }
 6010|  17.0k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6010:23): [True: 17.0k, False: 0]
  ------------------
 6011|  28.1k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6011:26): [True: 28.1k, False: 0]
  |  Branch (6011:40): [True: 7.87k, False: 20.3k]
  |  Branch (6011:55): [True: 3.21k, False: 17.0k]
  ------------------
 6012|  11.0k|                     yaml::skip_newline(it, end);
 6013|  11.0k|                  }
 6014|  17.0k|                  yaml::skip_inline_ws(it, end);
 6015|  17.0k|                  anchor_on_same_line = false;
 6016|  17.0k|               }
 6017|       |
 6018|   114k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6019|   114k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (6019:23): [True: 97.3k, False: 17.0k]
  |  Branch (6019:46): [True: 4.31k, False: 93.0k]
  ------------------
 6020|  4.31k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (6020:24): [True: 5, False: 4.30k]
  |  Branch (6020:43): [True: 15, False: 4.29k]
  ------------------
 6021|       |                     // "&anchor - item" is malformed in block context.
 6022|     20|                     ctx.error = error_code::syntax_error;
 6023|     20|                     return;
 6024|     20|                  }
 6025|   114k|               }
 6026|       |
 6027|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6028|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6029|   114k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6029:20): [True: 114k, False: 31]
  |  Branch (6029:33): [True: 747, False: 113k]
  |  Branch (6029:47): [True: 95, False: 652]
  ------------------
 6030|     95|                  ctx.error = error_code::syntax_error;
 6031|     95|                  return;
 6032|     95|               }
 6033|       |
 6034|   114k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6035|   114k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (6035:23): [True: 17.0k, False: 97.2k]
  |  Branch (6035:47): [True: 17.0k, False: 11]
  |  Branch (6035:60): [True: 2.36k, False: 14.6k]
  ------------------
 6036|  2.36k|                     auto probe = it + 1;
 6037|  2.36k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6038|  2.36k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (6038:26): [True: 24, False: 2.34k]
  ------------------
 6039|     24|                        ctx.error = error_code::syntax_error;
 6040|     24|                        return;
 6041|     24|                     }
 6042|  2.34k|                     yaml::skip_inline_ws(probe, end);
 6043|       |                     // Allow nested anchor usage only when it clearly starts a
 6044|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 6045|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 6046|  2.34k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (6046:26): [True: 51, False: 2.28k]
  ------------------
 6047|     51|                        ctx.error = error_code::syntax_error;
 6048|     51|                        return;
 6049|     51|                     }
 6050|  2.34k|                  }
 6051|   114k|               }
 6052|       |
 6053|   114k|               const char* anchor_start = &*it;
 6054|   114k|               const int32_t anchor_indent = ctx.current_indent();
 6055|       |
 6056|   114k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6057|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 6058|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 6059|       |                  // next line, the anchor applies to the entire next-line content.
 6060|   114k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6060:23): [True: 97.2k, False: 17.0k]
  |  Branch (6060:46): [True: 45.3k, False: 51.9k]
  ------------------
 6061|  45.3k|                     auto key_start = it;
 6062|  45.3k|                     if (*key_start == '!') {
  ------------------
  |  Branch (6062:26): [True: 941, False: 44.3k]
  ------------------
 6063|    941|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6064|    941|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (6064:29): [True: 6, False: 935]
  |  Branch (6064:67): [True: 12, False: 923]
  ------------------
 6065|     18|                           ctx.error = error_code::syntax_error;
 6066|     18|                           return;
 6067|     18|                        }
 6068|    923|                        yaml::skip_inline_ws(key_start, end);
 6069|    923|                        if (key_start == end) {
  ------------------
  |  Branch (6069:29): [True: 3, False: 920]
  ------------------
 6070|      3|                           ctx.error = error_code::unexpected_end;
 6071|      3|                           return;
 6072|      3|                        }
 6073|    920|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (6073:29): [True: 1, False: 919]
  |  Branch (6073:51): [True: 1, False: 918]
  ------------------
 6074|      2|                           ctx.error = error_code::syntax_error;
 6075|      2|                           return;
 6076|      2|                        }
 6077|       |
 6078|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 6079|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 6080|       |                        // key-span registration below while the untagged spelling was rejected;
 6081|       |                        // an alias node carries no other properties either way.
 6082|    918|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (6082:29): [True: 153, False: 765]
  |  Branch (6082:50): [True: 6, False: 147]
  ------------------
 6083|      6|                           ctx.error = error_code::syntax_error;
 6084|      6|                           return;
 6085|      6|                        }
 6086|    918|                     }
 6087|       |
 6088|       |                     // Find the key span by scanning to the key-value separator
 6089|  45.2k|                     auto key_scan = key_start;
 6090|  45.2k|                     auto key_end = key_start;
 6091|  45.2k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6091:26): [True: 609, False: 44.6k]
  |  Branch (6091:46): [True: 397, False: 44.2k]
  ------------------
 6092|       |                        // Quoted key: skip to closing quote
 6093|  1.00k|                        const char quote = *key_scan;
 6094|  1.00k|                        ++key_scan;
 6095|  7.92k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6095:32): [True: 7.91k, False: 4]
  |  Branch (6095:51): [True: 6.91k, False: 1.00k]
  ------------------
 6096|  6.91k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6096:32): [True: 600, False: 6.31k]
  |  Branch (6096:53): [True: 275, False: 325]
  ------------------
 6097|    275|                              ++key_scan;
 6098|    275|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6098:35): [True: 275, False: 0]
  ------------------
 6099|    275|                           }
 6100|  6.63k|                           else {
 6101|  6.63k|                              ++key_scan;
 6102|  6.63k|                           }
 6103|  6.91k|                        }
 6104|  1.00k|                        if (key_scan == end) {
  ------------------
  |  Branch (6104:29): [True: 4, False: 1.00k]
  ------------------
 6105|      4|                           ctx.error = error_code::syntax_error;
 6106|      4|                           return;
 6107|      4|                        }
 6108|  1.00k|                        ++key_scan; // past closing quote
 6109|  1.00k|                        key_end = key_scan;
 6110|  1.00k|                        yaml::skip_inline_ws(key_scan, end);
 6111|  1.00k|                     }
 6112|  44.2k|                     else {
 6113|       |                        // Plain key: scan to ':'
 6114|   818k|                        while (key_scan != end) {
  ------------------
  |  Branch (6114:32): [True: 818k, False: 1]
  ------------------
 6115|   818k|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6115:32): [True: 85.9k, False: 732k]
  ------------------
 6116|  85.9k|                              auto next = key_scan + 1;
 6117|  85.9k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6117:35): [True: 5.07k, False: 80.8k]
  |  Branch (6117:50): [True: 31.6k, False: 49.2k]
  |  Branch (6117:66): [True: 1.73k, False: 47.4k]
  |  Branch (6117:83): [True: 3.12k, False: 44.3k]
  |  Branch (6117:100): [True: 2.74k, False: 41.6k]
  ------------------
 6118|  44.2k|                                 break;
 6119|  44.2k|                              }
 6120|  85.9k|                           }
 6121|   773k|                           ++key_scan;
 6122|   773k|                        }
 6123|  44.2k|                        key_end = key_scan;
 6124|  52.0k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6124:32): [True: 48.8k, False: 3.24k]
  |  Branch (6124:57): [True: 7.13k, False: 41.6k]
  |  Branch (6124:82): [True: 632, False: 41.0k]
  ------------------
 6125|  7.76k|                           --key_end;
 6126|  7.76k|                        }
 6127|  44.2k|                     }
 6128|  45.2k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6128:26): [True: 2, False: 45.2k]
  |  Branch (6128:45): [True: 39, False: 45.2k]
  ------------------
 6129|     41|                        ctx.error = error_code::syntax_error;
 6130|     41|                        return;
 6131|     41|                     }
 6132|       |                     // Store anchor with just the key text span
 6133|  45.2k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6134|  45.2k|                     it = key_start;
 6135|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6136|  45.2k|                     if constexpr (counts::n_object > 0) {
 6137|  45.2k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6138|  45.2k|                                                                                                        end);
 6139|       |                     }
 6140|       |                     else {
 6141|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6142|       |                     }
 6143|  45.2k|                     return;
 6144|  45.2k|                  }
 6145|   114k|               }
 6146|       |
 6147|  69.0k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6148|   114k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6149|   114k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6150|   114k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6151|   114k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6151:20): [True: 65.4k, False: 48.8k]
  ------------------
 6152|  65.4k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6153|  65.4k|               }
 6154|   114k|               return;
 6155|   114k|            }
 6156|  91.4k|            case '*': {
  ------------------
  |  Branch (6156:13): [True: 91.4k, False: 662k]
  ------------------
 6157|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6158|  91.4k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|  91.4k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6159:23): [True: 8.61k, False: 82.8k]
  ------------------
 6160|  8.61k|                     if constexpr (counts::n_object > 0) {
 6161|  8.61k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|  8.61k|                                                                                                        end);
 6163|  8.61k|                        return;
 6164|       |                     }
 6165|       |                     else {
 6166|       |                        ctx.error = error_code::syntax_error;
 6167|       |                        return;
 6168|       |                     }
 6169|  8.61k|                  }
 6170|  91.4k|               }
 6171|       |
 6172|       |               // Alias value: look up anchor and replay
 6173|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6174|  91.4k|               return;
 6175|   114k|            }
 6176|   131k|            case '!': {
  ------------------
  |  Branch (6176:13): [True: 131k, False: 622k]
  ------------------
 6177|       |               // Tag - parse it and dispatch based on tag type
 6178|   131k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6179|   131k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6179:20): [True: 89, False: 131k]
  ------------------
 6180|     89|                  ctx.error = error_code::syntax_error;
 6181|     89|                  return;
 6182|     89|               }
 6183|   131k|               yaml::skip_inline_ws(it, end);
 6184|   131k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6184:20): [True: 131k, False: 611]
  |  Branch (6184:33): [True: 7.88k, False: 123k]
  ------------------
 6185|  7.88k|                  yaml::skip_comment(it, end);
 6186|  7.88k|               }
 6187|   131k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6187:20): [True: 130k, False: 935]
  |  Branch (6187:34): [True: 70.1k, False: 60.6k]
  |  Branch (6187:49): [True: 8.81k, False: 51.7k]
  ------------------
 6188|  78.9k|                  auto content = it;
 6189|  78.9k|                  yaml::skip_newline(content, end);
 6190|  78.9k|                  yaml::skip_to_content(content, end);
 6191|       |
 6192|  78.9k|                  bool consume_following_content = false;
 6193|  78.9k|                  auto content_token = content;
 6194|  78.9k|                  if (content != end) {
  ------------------
  |  Branch (6194:23): [True: 77.5k, False: 1.42k]
  ------------------
 6195|  77.5k|                     auto indent_probe = content;
 6196|  77.5k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6197|  77.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6197:26): [True: 2, False: 77.5k]
  ------------------
 6198|      2|                        return;
 6199|  77.5k|                     content_token = indent_probe;
 6200|       |
 6201|       |                     // A tag at the end of a sequence/map entry has an empty value
 6202|       |                     // unless the next non-empty content is nested under the current node.
 6203|  77.5k|                     bool tagged_indentless_sequence = false;
 6204|  77.5k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6204:26): [True: 47.5k, False: 30.0k]
  |  Branch (6204:56): [True: 47.5k, False: 0]
  |  Branch (6204:79): [True: 47.1k, False: 418]
  ------------------
 6205|  47.1k|                        const auto after_dash = indent_probe + 1;
 6206|  47.1k|                        if (after_dash == end ||
  ------------------
  |  Branch (6206:29): [True: 142, False: 46.9k]
  ------------------
 6207|  46.9k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6207:29): [True: 46.7k, False: 227]
  ------------------
 6208|  46.8k|                           tagged_indentless_sequence =
 6209|  46.8k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6209:31): [True: 568, False: 46.3k]
  ------------------
 6210|  46.3k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6210:32): [True: 41.4k, False: 4.89k]
  |  Branch (6210:60): [True: 41.3k, False: 61]
  ------------------
 6211|  46.8k|                        }
 6212|  47.1k|                     }
 6213|       |
 6214|  77.5k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6214:50): [True: 1.57k, False: 75.9k]
  ------------------
 6215|  75.9k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6215:50): [True: 7.60k, False: 68.3k]
  |  Branch (6215:93): [True: 41.9k, False: 26.4k]
  ------------------
 6216|  77.5k|                  }
 6217|       |
 6218|  78.9k|                  if (consume_following_content) {
  ------------------
  |  Branch (6218:23): [True: 51.1k, False: 27.8k]
  ------------------
 6219|  51.1k|                     it = content_token;
 6220|  51.1k|                  }
 6221|  27.8k|                  else {
 6222|  27.8k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6222:26): [True: 3.15k, False: 24.7k]
  ------------------
 6223|  3.15k|                        if constexpr (counts::n_str > 0) {
 6224|  3.15k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6225|  3.15k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6226|  3.15k|                           value = StrType{};
 6227|  3.15k|                           return;
 6228|  3.15k|                        }
 6229|  3.15k|                     }
 6230|  27.8k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6230:26): [True: 244, False: 27.6k]
  ------------------
 6231|    244|                        if constexpr (counts::n_null > 0) {
 6232|    244|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6233|    244|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6234|    244|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6234:32): [True: 0, False: 244]
  ------------------
 6235|    244|                           return;
 6236|    244|                        }
 6237|    244|                     }
 6238|  27.8k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6238:26): [True: 23.7k, False: 4.08k]
  ------------------
 6239|  23.7k|                        if constexpr (counts::n_null > 0) {
 6240|  23.7k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6241|  23.7k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6242|  23.7k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6242:32): [True: 0, False: 23.7k]
  ------------------
 6243|  23.7k|                           return;
 6244|  23.7k|                        }
 6245|  23.7k|                     }
 6246|  27.8k|                  }
 6247|  78.9k|               }
 6248|   131k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6249|       |                  // In block context, a comma immediately after a tag token is malformed
 6250|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6251|   131k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6251:23): [True: 103k, False: 28.1k]
  |  Branch (6251:36): [True: 14, False: 103k]
  ------------------
 6252|     14|                     ctx.error = error_code::syntax_error;
 6253|     14|                     return;
 6254|     14|                  }
 6255|   131k|                  if constexpr (counts::n_object > 0) {
 6256|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6257|   131k|                     const bool starts_block_sequence_entry =
 6258|   131k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6258:26): [True: 103k, False: 28.1k]
  |  Branch (6258:39): [True: 48.6k, False: 54.9k]
  ------------------
 6259|  48.6k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6259:26): [True: 373, False: 48.2k]
  |  Branch (6259:45): [True: 47.4k, False: 824]
  ------------------
 6260|   131k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6260:26): [True: 56.6k, False: 75.0k]
  |  Branch (6260:58): [True: 15.0k, False: 41.5k]
  ------------------
 6261|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6262|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6263|  15.0k|                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6264|  15.0k|                        return;
 6265|  15.0k|                     }
 6266|   131k|                  }
 6267|   131k|               }
 6268|   131k|               if (it == end) {
  ------------------
  |  Branch (6268:20): [True: 935, False: 130k]
  ------------------
 6269|    935|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6269:23): [True: 264, False: 671]
  ------------------
 6270|    264|                     if constexpr (counts::n_str > 0) {
 6271|    264|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6272|    264|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6273|    264|                        value = StrType{};
 6274|    264|                        return;
 6275|    264|                     }
 6276|    264|                  }
 6277|    935|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6277:23): [True: 646, False: 289]
  ------------------
 6278|    646|                     if constexpr (counts::n_null > 0) {
 6279|    646|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6280|    646|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6281|    646|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6281:29): [True: 0, False: 646]
  ------------------
 6282|    646|                        return;
 6283|    646|                     }
 6284|    646|                  }
 6285|      0|                  ctx.error = error_code::unexpected_end;
 6286|    935|                  return;
 6287|    935|               }
 6288|   130k|               switch (tag) {
 6289|    926|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6289:16): [True: 926, False: 129k]
  ------------------
 6290|    926|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6291|    926|                  return;
 6292|    955|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6292:16): [True: 955, False: 129k]
  ------------------
 6293|  1.09k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6293:16): [True: 135, False: 130k]
  ------------------
 6294|  1.09k|                  if constexpr (counts::n_num > 0) {
 6295|  1.09k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6296|  1.09k|                     return;
 6297|       |                  }
 6298|       |                  else { // else used to fix MSVC unreachable code warning
 6299|       |                     ctx.error = error_code::syntax_error;
 6300|       |                     return;
 6301|       |                  }
 6302|  10.6k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6302:16): [True: 9.53k, False: 121k]
  ------------------
 6303|  10.6k|                  if constexpr (counts::n_bool > 0) {
 6304|  10.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6305|  10.6k|                     return;
 6306|       |                  }
 6307|       |                  else { // else used to fix MSVC unreachable code warning
 6308|       |                     ctx.error = error_code::syntax_error;
 6309|       |                     return;
 6310|       |                  }
 6311|  10.7k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6311:16): [True: 131, False: 130k]
  ------------------
 6312|  10.7k|                  if constexpr (counts::n_null > 0) {
 6313|  10.7k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6314|  10.7k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6315|  10.7k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6315:26): [True: 0, False: 10.7k]
  ------------------
 6316|  10.7k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6317|  10.7k|                     return;
 6318|       |                  }
 6319|       |                  else { // else used to fix MSVC unreachable code warning
 6320|       |                     ctx.error = error_code::syntax_error;
 6321|       |                     return;
 6322|       |                  }
 6323|  14.9k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6323:16): [True: 4.21k, False: 126k]
  ------------------
 6324|  14.9k|                  if constexpr (counts::n_object > 0) {
 6325|  14.9k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6326|  14.9k|                                                                                                     end);
 6327|  14.9k|                     return;
 6328|       |                  }
 6329|       |                  else { // else used to fix MSVC unreachable code warning
 6330|       |                     ctx.error = error_code::syntax_error;
 6331|       |                     return;
 6332|       |                  }
 6333|  66.7k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6333:16): [True: 51.7k, False: 79.0k]
  ------------------
 6334|  66.7k|                  if constexpr (counts::n_array > 0) {
 6335|  66.7k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6336|  66.7k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6337|  66.7k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6337:29): [True: 51.7k, False: 14.9k]
  |  Branch (6337:42): [True: 46.9k, False: 4.82k]
  ------------------
 6338|  46.9k|                           ctx.allow_indentless_sequence = true;
 6339|  46.9k|                        }
 6340|  66.7k|                     }
 6341|  66.7k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6342|  66.7k|                                                                                                    end);
 6343|  66.7k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6344|  66.7k|                     return;
 6345|       |                  }
 6346|       |                  else { // else used to fix MSVC unreachable code warning
 6347|       |                     ctx.error = error_code::syntax_error;
 6348|       |                     return;
 6349|       |                  }
 6350|  87.5k|               default: {
  ------------------
  |  Branch (6350:16): [True: 20.8k, False: 109k]
  ------------------
 6351|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6352|       |                  // Preserve collection kinds, otherwise treat as string content.
 6353|  87.5k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6353:23): [True: 20.8k, False: 66.7k]
  |  Branch (6353:36): [True: 6.24k, False: 14.6k]
  ------------------
 6354|  6.24k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6355|  6.24k|                     return;
 6356|  6.24k|                  }
 6357|       |
 6358|  81.3k|                  if constexpr (counts::n_array > 0) {
 6359|  81.3k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6359:26): [True: 14.6k, False: 66.7k]
  |  Branch (6359:39): [True: 348, False: 14.2k]
  ------------------
 6360|    348|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6361|    348|                                                                                                       end);
 6362|    348|                        return;
 6363|    348|                     }
 6364|  81.3k|                  }
 6365|  81.3k|                  if constexpr (counts::n_object > 0) {
 6366|  81.3k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6366:26): [True: 14.2k, False: 67.0k]
  |  Branch (6366:39): [True: 484, False: 13.7k]
  ------------------
 6367|    484|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6368|    484|                                                                                                        end);
 6369|    484|                        return;
 6370|    484|                     }
 6371|  81.3k|                  }
 6372|       |
 6373|  81.3k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6374|  81.3k|                     if constexpr (counts::n_array > 0) {
 6375|  81.3k|                        const bool starts_block_sequence_entry =
 6376|  81.3k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6376:29): [True: 13.7k, False: 67.5k]
  |  Branch (6376:42): [True: 1.08k, False: 12.6k]
  ------------------
 6377|  1.08k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6377:29): [True: 234, False: 851]
  |  Branch (6377:48): [True: 688, False: 163]
  ------------------
 6378|  81.3k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6378:29): [True: 922, False: 80.4k]
  ------------------
 6379|    922|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6380|    922|                                                                                                          it, end);
 6381|    922|                           return;
 6382|    922|                        }
 6383|  81.3k|                     }
 6384|  81.3k|                     if constexpr (counts::n_object > 0) {
 6385|  81.3k|                        const bool starts_explicit_mapping_indicator =
 6386|  81.3k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6386:29): [True: 12.8k, False: 68.4k]
  |  Branch (6386:43): [True: 1.29k, False: 11.5k]
  |  Branch (6386:57): [True: 392, False: 11.1k]
  ------------------
 6387|  1.68k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6387:29): [True: 277, False: 1.40k]
  |  Branch (6387:48): [True: 953, False: 455]
  ------------------
 6388|  81.3k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6388:29): [True: 1.23k, False: 80.0k]
  ------------------
 6389|  1.23k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6390|  1.23k|                                                                                                           it, end);
 6391|  1.23k|                           return;
 6392|  1.23k|                        }
 6393|  80.0k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6393:29): [True: 0, False: 80.0k]
  ------------------
 6394|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6395|      0|                                                                                                           it, end);
 6396|      0|                           return;
 6397|      0|                        }
 6398|  80.0k|                     }
 6399|  81.3k|                  }
 6400|       |
 6401|  81.3k|                  if constexpr (counts::n_str > 0) {
 6402|  81.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6403|  81.3k|                     return;
 6404|  81.3k|                  }
 6405|       |
 6406|       |                  // Fall back if no string alternative exists.
 6407|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6408|  81.3k|                  return;
 6409|  87.5k|               }
 6410|   130k|               }
 6411|      0|               return;
 6412|   130k|            }
 6413|  19.8k|            case '{':
  ------------------
  |  Branch (6413:13): [True: 19.8k, False: 734k]
  ------------------
 6414|  19.8k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6415|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6416|  19.8k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6416:23): [True: 8.86k, False: 11.0k]
  |  Branch (6416:51): [True: 988, False: 7.87k]
  ------------------
 6417|    988|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6418|    988|                                                                                                     end);
 6419|    988|                     return;
 6420|    988|                  }
 6421|  19.8k|               }
 6422|       |               // Flow mapping - object type
 6423|  18.9k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6424|  19.8k|               return;
 6425|  30.7k|            case '[':
  ------------------
  |  Branch (6425:13): [True: 30.7k, False: 723k]
  ------------------
 6426|  30.7k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6427|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6428|  30.7k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6428:23): [True: 19.3k, False: 11.4k]
  |  Branch (6428:51): [True: 600, False: 18.7k]
  ------------------
 6429|    600|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6430|    600|                                                                                                     end);
 6431|    600|                     return;
 6432|    600|                  }
 6433|  30.7k|               }
 6434|       |               // Flow sequence - array type
 6435|  30.1k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6436|  30.7k|               return;
 6437|  80.6k|            case '?':
  ------------------
  |  Branch (6437:13): [True: 80.6k, False: 673k]
  ------------------
 6438|       |               // Explicit mapping key indicator ("? key")
 6439|  80.6k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6439:20): [True: 80.4k, False: 281]
  |  Branch (6439:39): [True: 7, False: 80.4k]
  ------------------
 6440|      7|                  ctx.error = error_code::syntax_error;
 6441|      7|                  return;
 6442|      7|               }
 6443|  80.6k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6443:20): [True: 80.4k, False: 281]
  |  Branch (6443:40): [True: 31.0k, False: 49.3k]
  |  Branch (6443:56): [True: 30.6k, False: 18.7k]
  |  Branch (6443:73): [True: 14.1k, False: 4.58k]
  ------------------
 6444|  75.8k|                  if constexpr (counts::n_object > 0) {
 6445|  75.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6446|  75.8k|                                                                                                     end);
 6447|  75.8k|                     return;
 6448|  75.8k|                  }
 6449|  75.8k|               }
 6450|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6451|  80.6k|               return;
 6452|     13|            case '%':
  ------------------
  |  Branch (6452:13): [True: 13, False: 754k]
  ------------------
 6453|       |               // Reserved directive indicator is not a plain scalar start.
 6454|     13|               ctx.error = error_code::syntax_error;
 6455|     13|               return;
 6456|  1.82k|            case '"':
  ------------------
  |  Branch (6456:13): [True: 1.82k, False: 752k]
  ------------------
 6457|  2.68k|            case '\'':
  ------------------
  |  Branch (6457:13): [True: 855, False: 753k]
  ------------------
 6458|       |               // Could be a quoted string OR a quoted key in a block mapping
 6459|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6460|  2.68k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6461|  2.68k|               return;
 6462|  11.0k|            case 't':
  ------------------
  |  Branch (6462:13): [True: 11.0k, False: 742k]
  ------------------
 6463|  15.9k|            case 'T':
  ------------------
  |  Branch (6463:13): [True: 4.88k, False: 749k]
  ------------------
 6464|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6465|  15.9k|               if constexpr (counts::n_bool > 0) {
 6466|  15.9k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6466:23): [True: 15.5k, False: 439]
  |  Branch (6466:44): [True: 13.3k, False: 2.14k]
  |  Branch (6466:60): [True: 12.4k, False: 918]
  |  Branch (6466:76): [True: 11.4k, False: 1.03k]
  ------------------
 6467|  12.0k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6467:44): [True: 1.16k, False: 2.92k]
  |  Branch (6467:60): [True: 825, False: 342]
  |  Branch (6467:76): [True: 576, False: 249]
  ------------------
 6468|       |                     // Check what follows the word "true"
 6469|  12.0k|                     const auto after_true = it + 4;
 6470|  12.0k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6471|       |
 6472|  12.0k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6472:26): [True: 11.6k, False: 400]
  ------------------
 6473|  11.6k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6473:29): [True: 287, False: 11.3k]
  ------------------
 6474|    287|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|    287|                           return;
 6476|    287|                        }
 6477|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6478|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6479|  11.3k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6479:29): [True: 8.37k, False: 2.95k]
  |  Branch (6479:47): [True: 4.05k, False: 4.32k]
  ------------------
 6480|  4.05k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6480:30): [True: 2.75k, False: 1.30k]
  |  Branch (6480:47): [True: 477, False: 823]
  |  Branch (6480:63): [True: 270, False: 553]
  |  Branch (6480:80): [True: 281, False: 272]
  |  Branch (6480:97): [True: 272, False: 0]
  ------------------
 6481|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6482|  4.05k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6483|  4.05k|                           return;
 6484|  4.05k|                        }
 6485|  7.27k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6486|  7.27k|                                                                                                      end);
 6487|  7.27k|                        return;
 6488|  11.3k|                     }
 6489|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6490|  12.0k|                  }
 6491|  15.9k|               }
 6492|  4.35k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6493|  15.9k|               return;
 6494|  9.56k|            case 'f':
  ------------------
  |  Branch (6494:13): [True: 9.56k, False: 744k]
  ------------------
 6495|  14.4k|            case 'F':
  ------------------
  |  Branch (6495:13): [True: 4.92k, False: 749k]
  ------------------
 6496|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6497|  14.4k|               if constexpr (counts::n_bool > 0) {
 6498|  14.4k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6498:23): [True: 14.2k, False: 280]
  |  Branch (6498:44): [True: 9.31k, False: 4.89k]
  |  Branch (6498:60): [True: 8.91k, False: 400]
  |  Branch (6498:76): [True: 7.10k, False: 1.81k]
  |  Branch (6498:92): [True: 6.50k, False: 596]
  ------------------
 6499|  7.70k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6499:44): [True: 2.10k, False: 5.59k]
  |  Branch (6499:60): [True: 1.64k, False: 460]
  |  Branch (6499:76): [True: 1.20k, False: 435]
  |  Branch (6499:92): [True: 931, False: 276]
  ------------------
 6500|       |                     // Check what follows the word "false"
 6501|  7.43k|                     const auto after_false = it + 5;
 6502|  7.43k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6503|       |
 6504|  7.43k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6504:26): [True: 6.73k, False: 698]
  ------------------
 6505|  6.73k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6505:29): [True: 329, False: 6.40k]
  ------------------
 6506|    329|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|    329|                           return;
 6508|    329|                        }
 6509|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6510|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6511|  6.40k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6511:29): [True: 6.25k, False: 151]
  |  Branch (6511:47): [True: 2.19k, False: 4.06k]
  ------------------
 6512|  2.19k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6512:30): [True: 262, False: 1.93k]
  |  Branch (6512:47): [True: 299, False: 1.63k]
  |  Branch (6512:63): [True: 532, False: 1.09k]
  |  Branch (6512:80): [True: 267, False: 832]
  |  Branch (6512:97): [True: 832, False: 0]
  ------------------
 6513|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6514|  2.19k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6515|  2.19k|                           return;
 6516|  2.19k|                        }
 6517|  4.21k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6518|  4.21k|                                                                                                      end);
 6519|  4.21k|                        return;
 6520|  6.40k|                     }
 6521|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6522|  7.43k|                  }
 6523|  14.4k|               }
 6524|  7.74k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6525|  14.4k|               return;
 6526|  4.42k|            case 'n':
  ------------------
  |  Branch (6526:13): [True: 4.42k, False: 749k]
  ------------------
 6527|  11.3k|            case 'N':
  ------------------
  |  Branch (6527:13): [True: 6.89k, False: 747k]
  ------------------
 6528|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6529|  11.3k|               if constexpr (counts::n_null > 0) {
 6530|  11.3k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6530:23): [True: 10.9k, False: 323]
  |  Branch (6530:44): [True: 5.14k, False: 5.85k]
  |  Branch (6530:60): [True: 4.60k, False: 538]
  |  Branch (6530:76): [True: 4.37k, False: 235]
  ------------------
 6531|  8.79k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6531:44): [True: 5.03k, False: 1.58k]
  |  Branch (6531:60): [True: 4.67k, False: 363]
  |  Branch (6531:76): [True: 4.42k, False: 248]
  ------------------
 6532|       |                     // Check what follows the word "null"
 6533|  8.79k|                     const auto after_null = it + 4;
 6534|  8.79k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6535|       |
 6536|  8.79k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6536:26): [True: 7.07k, False: 1.72k]
  ------------------
 6537|  7.07k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6537:29): [True: 251, False: 6.81k]
  ------------------
 6538|    251|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|    251|                           return;
 6540|    251|                        }
 6541|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6542|       |                        // "null: value" should parse as {null: value}, not as the null type
 6543|  6.81k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6543:29): [True: 6.58k, False: 231]
  |  Branch (6543:47): [True: 1.77k, False: 4.80k]
  ------------------
 6544|  1.77k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6544:30): [True: 278, False: 1.50k]
  |  Branch (6544:47): [True: 318, False: 1.18k]
  |  Branch (6544:63): [True: 454, False: 729]
  |  Branch (6544:80): [True: 405, False: 324]
  |  Branch (6544:97): [True: 324, False: 0]
  ------------------
 6545|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6546|  1.77k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6547|  1.77k|                           return;
 6548|  1.77k|                        }
 6549|  5.04k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6550|  5.04k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6551|  5.04k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6551:29): [True: 0, False: 5.04k]
  ------------------
 6552|  5.04k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6553|  5.04k|                        return;
 6554|  6.81k|                     }
 6555|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6556|  8.79k|                  }
 6557|  11.3k|               }
 6558|  4.25k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6559|  11.3k|               return;
 6560|  1.02k|            case '~':
  ------------------
  |  Branch (6560:13): [True: 1.02k, False: 753k]
  ------------------
 6561|       |               // Null indicator
 6562|  1.02k|               if constexpr (counts::n_null > 0) {
 6563|  1.02k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6564|  1.02k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6565|  1.02k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6565:23): [True: 0, False: 1.02k]
  ------------------
 6566|  1.02k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6567|  1.02k|                  return;
 6568|  1.02k|               }
 6569|      0|               break; // Fall through to try other types
 6570|  45.4k|            case '-':
  ------------------
  |  Branch (6570:13): [True: 45.4k, False: 708k]
  ------------------
 6571|       |               // Could be negative number or block sequence indicator
 6572|  45.4k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6572:20): [True: 725, False: 44.7k]
  |  Branch (6572:41): [True: 37.7k, False: 6.99k]
  ------------------
 6573|       |                  // Block sequence indicator "- "
 6574|  38.4k|                  if constexpr (counts::n_array > 0) {
 6575|  38.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6576|  38.4k|                                                                                                    end);
 6577|  38.4k|                     return;
 6578|  38.4k|                  }
 6579|  38.4k|               }
 6580|  45.4k|               if constexpr (counts::n_num > 0) {
 6581|  45.4k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6581:23): [True: 6.99k, False: 38.4k]
  |  Branch (6581:43): [True: 626, False: 6.37k]
  |  Branch (6581:94): [True: 753, False: 5.62k]
  ------------------
 6582|  1.37k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6583|  1.37k|                     return;
 6584|  1.37k|                  }
 6585|  45.4k|               }
 6586|  44.0k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6587|  45.4k|               return;
 6588|  2.74k|            case '+':
  ------------------
  |  Branch (6588:13): [True: 2.74k, False: 751k]
  ------------------
 6589|  9.36k|            case '.':
  ------------------
  |  Branch (6589:13): [True: 6.62k, False: 747k]
  ------------------
 6590|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6591|       |               // Try parsing as number speculatively, fall back to string on failure
 6592|  9.36k|               if constexpr (counts::n_num > 0) {
 6593|  9.36k|                  auto start_it = it;
 6594|  9.36k|                  auto temp_ctx = ctx.make_speculative();
 6595|  9.36k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6596|  9.36k|                                                                                               end);
 6597|  9.36k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6598|  9.36k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6599|  9.36k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6599:23): [True: 2.99k, False: 6.37k]
  ------------------
 6600|  2.99k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6601|  2.99k|                     return; // Successfully parsed as number
 6602|  2.99k|                  }
 6603|  6.37k|                  it = start_it; // Restore and fall through to string
 6604|  6.37k|               }
 6605|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6606|  9.36k|               return;
 6607|   172k|            default:
  ------------------
  |  Branch (6607:13): [True: 172k, False: 581k]
  ------------------
 6608|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6609|   172k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6609:20): [True: 118k, False: 54.3k]
  |  Branch (6609:32): [True: 34.9k, False: 83.1k]
  ------------------
 6610|       |                  // Try block mapping first (e.g., "123key: value")
 6611|  34.9k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6611:23): [True: 9.72k, False: 25.2k]
  ------------------
 6612|  9.72k|                     return;
 6613|  9.72k|                  }
 6614|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6615|  25.2k|                  if constexpr (counts::n_num > 0) {
 6616|  25.2k|                     auto start_it = it;
 6617|  25.2k|                     auto temp_ctx = ctx.make_speculative();
 6618|  25.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6619|  25.2k|                                                                                                  end);
 6620|  25.2k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6621|  25.2k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6622|  25.2k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6622:26): [True: 2.35k, False: 22.8k]
  ------------------
 6623|  2.35k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6624|  2.35k|                        return; // Successfully parsed as number
 6625|  2.35k|                     }
 6626|  22.8k|                     it = start_it; // Restore and fall through to string
 6627|  22.8k|                  }
 6628|       |                  // Fall through to string
 6629|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6630|  25.2k|                  return;
 6631|  34.9k|               }
 6632|       |               // Plain scalar - try block mapping, then string
 6633|   137k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6634|   137k|               return;
 6635|   754k|            }
 6636|   754k|         }
 6637|       |
 6638|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6639|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6640|       |
 6641|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6642|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6643|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6644|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6645|   754k|         error_code expansion_error{};
 6646|   754k|         std::string_view expansion_message{};
 6647|       |
 6648|   754k|         auto try_parse = [&]<size_t I>() -> bool {
 6649|   754k|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6650|   754k|            auto start = it;
 6651|       |
 6652|   754k|            V v{};
 6653|   754k|            auto temp_ctx = ctx.make_speculative();
 6654|   754k|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6655|   754k|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6656|   754k|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6657|       |
 6658|   754k|            if (!bool(temp_ctx.error)) {
 6659|   754k|               value = std::move(v);
 6660|   754k|               ctx.anchors = std::move(temp_ctx.anchors);
 6661|   754k|               return true;
 6662|   754k|            }
 6663|       |
 6664|   754k|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6665|   754k|               expansion_error = temp_ctx.error;
 6666|   754k|               expansion_message = temp_ctx.custom_error_message;
 6667|   754k|            }
 6668|   754k|            it = start;
 6669|   754k|            return false;
 6670|   754k|         };
 6671|       |
 6672|   754k|         bool parsed = false;
 6673|   754k|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6674|   754k|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6675|   754k|         }(std::make_index_sequence<N>{});
 6676|       |
 6677|   754k|         if (!parsed) {
  ------------------
  |  Branch (6677:14): [True: 0, False: 754k]
  ------------------
 6678|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6678:17): [True: 0, False: 0]
  ------------------
 6679|      0|               ctx.error = expansion_error;
 6680|      0|               ctx.custom_error_message = expansion_message;
 6681|      0|            }
 6682|      0|            else {
 6683|      0|               ctx.error = error_code::no_matching_variant_type;
 6684|      0|            }
 6685|      0|         }
 6686|   754k|      }
_ZN3glz4yaml26alias_token_is_mapping_keyIPKcS3_EEbT_T0_:
  371|  8.42M|      {
  372|  8.42M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (372:14): [True: 0, False: 8.42M]
  |  Branch (372:27): [True: 7.83M, False: 584k]
  ------------------
  373|   584k|         ++it; // skip '*'
  374|   584k|         auto name = parse_anchor_name(it, end);
  375|   584k|         if (name.empty()) return false;
  ------------------
  |  Branch (375:14): [True: 912, False: 583k]
  ------------------
  376|   583k|         skip_inline_ws(it, end);
  377|   583k|         return (it != end && *it == ':') &&
  ------------------
  |  Branch (377:18): [True: 564k, False: 18.9k]
  |  Branch (377:31): [True: 138k, False: 425k]
  ------------------
  378|   138k|                ((it + 1) == end || whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (378:18): [True: 11.7k, False: 126k]
  |  Branch (378:37): [True: 98.7k, False: 28.1k]
  ------------------
  379|   584k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   288k|      {
 5284|   288k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   288k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   288k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   288k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   288k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 288k, False: 0]
  ------------------
 5294|   288k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   288k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4593|   290k|      {
 4594|   290k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4594:14): [True: 0, False: 290k]
  ------------------
 4595|      0|            return;
 4596|       |
 4597|   290k|         yaml::node_preamble_state preamble{};
 4598|   290k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4598:14): [True: 3.04k, False: 287k]
  ------------------
 4599|   290k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4600|  3.04k|            return;
 4601|       |
 4602|   287k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4603|   287k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4604|       |
 4605|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4606|       |         // value of a key that existed before the read and adds new keys, while
 4607|       |         // pre-existing keys the document does not mention are preserved (like a
 4608|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4609|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4610|       |         // mappings disallow duplicate keys and the conformance suite expects
 4611|       |         // first-wins, which falls out of emplace into an empty map. Any
 4612|       |         // pre-existing entry the document leaves untouched is restored on scope
 4613|       |         // exit (including error paths). When the target starts empty (the common
 4614|       |         // case) this is a no-op with negligible cost.
 4615|   287k|         std::remove_cvref_t<T> preexisting_entries;
 4616|   287k|         if (!value.empty()) {
  ------------------
  |  Branch (4616:14): [True: 0, False: 287k]
  ------------------
 4617|      0|            preexisting_entries = std::move(value);
 4618|      0|            value.clear();
 4619|      0|         }
 4620|   287k|         struct merge_restore_guard
 4621|   287k|         {
 4622|   287k|            std::remove_cvref_t<T>& target;
 4623|   287k|            std::remove_cvref_t<T>& saved;
 4624|   287k|            ~merge_restore_guard()
 4625|   287k|            {
 4626|       |               // emplace is a no-op for keys the document already wrote, so only
 4627|       |               // untouched pre-existing entries are put back.
 4628|   287k|               for (auto& entry : saved) {
 4629|   287k|                  target.emplace(entry.first, std::move(entry.second));
 4630|   287k|               }
 4631|   287k|            }
 4632|   287k|         } merge_restore{value, preexisting_entries};
 4633|       |
 4634|   287k|         const bool treat_as_block_mapping =
 4635|   287k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4635:13): [True: 287k, Folded]
  |  Branch (4635:48): [True: 23.8k, False: 263k]
  |  Branch (4635:62): [True: 496, False: 23.3k]
  ------------------
 4636|       |
 4637|   287k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4637:14): [True: 23.8k, False: 263k]
  |  Branch (4637:28): [True: 23.3k, False: 496]
  ------------------
 4638|       |            // Flow mapping
 4639|  23.3k|            ++it;
 4640|       |            // Skip whitespace and newlines after opening brace
 4641|  23.3k|            yaml::skip_ws_and_newlines(it, end);
 4642|       |
 4643|  23.3k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4643:17): [True: 22.7k, False: 589]
  |  Branch (4643:30): [True: 3.83k, False: 18.9k]
  ------------------
 4644|  3.83k|               ++it;
 4645|  3.83k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4646|  3.83k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4646:20): [True: 15, False: 3.82k]
  ------------------
 4647|     15|                  return;
 4648|  3.82k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4649|  3.82k|               return;
 4650|  3.83k|            }
 4651|       |
 4652|  62.6k|            while (it != end) {
  ------------------
  |  Branch (4652:20): [True: 60.8k, False: 1.81k]
  ------------------
 4653|       |               // Skip whitespace and newlines at start of each iteration
 4654|  60.8k|               yaml::skip_ws_and_newlines(it, end);
 4655|       |
 4656|  60.8k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4656:20): [True: 60.8k, False: 0]
  |  Branch (4656:33): [True: 3.25k, False: 57.5k]
  ------------------
 4657|  3.25k|                  ++it;
 4658|  3.25k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4659|  3.25k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4659:23): [True: 4, False: 3.25k]
  ------------------
 4660|      4|                     return;
 4661|  3.25k|                  break;
 4662|  3.25k|               }
 4663|       |
 4664|  57.5k|               bool explicit_flow_key = false;
 4665|  57.5k|               auto explicit_probe = it;
 4666|  57.5k|               yaml::skip_inline_ws(explicit_probe, end);
 4667|  57.5k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4667:20): [True: 57.5k, False: 0]
  |  Branch (4667:45): [True: 2.28k, False: 55.2k]
  ------------------
 4668|  2.28k|                  const auto after_q = explicit_probe + 1;
 4669|  2.28k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4669:23): [True: 7, False: 2.27k]
  |  Branch (4669:41): [True: 967, False: 1.31k]
  ------------------
 4670|  1.61k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4670:23): [True: 364, False: 946]
  |  Branch (4670:42): [True: 276, False: 670]
  ------------------
 4671|  1.61k|                     explicit_flow_key = true;
 4672|  1.61k|                     it = explicit_probe + 1;
 4673|  1.61k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4674|  1.61k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4674:26): [True: 2, False: 1.61k]
  ------------------
 4675|      2|                        return;
 4676|  1.61k|                  }
 4677|  2.28k|               }
 4678|       |               // Parse key
 4679|  57.5k|               key_t key{};
 4680|  57.5k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4681|  57.5k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4681:23): [True: 1.61k, False: 55.9k]
  |  Branch (4681:44): [True: 1.58k, False: 27]
  |  Branch (4681:58): [True: 263, False: 1.32k]
  |  Branch (4681:72): [True: 576, False: 746]
  |  Branch (4681:86): [True: 366, False: 380]
  ------------------
 4682|  1.20k|                     key.clear();
 4683|  1.20k|                  }
 4684|  56.3k|                  else {
 4685|  56.3k|                     auto key_probe = it;
 4686|  56.3k|                     yaml::skip_inline_ws(key_probe, end);
 4687|       |
 4688|       |                     // Use full node parsing only for structurally complex flow keys.
 4689|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4690|  56.3k|                     bool parse_complex_flow_key = false;
 4691|  56.3k|                     if (key_probe != end) {
  ------------------
  |  Branch (4691:26): [True: 56.3k, False: 27]
  ------------------
 4692|  56.3k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4692:29): [True: 597, False: 55.7k]
  |  Branch (4692:50): [True: 2.55k, False: 53.1k]
  ------------------
 4693|  3.15k|                           parse_complex_flow_key = true;
 4694|  3.15k|                        }
 4695|  53.1k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4695:34): [True: 6.01k, False: 47.1k]
  ------------------
 4696|  6.01k|                           ++key_probe;
 4697|  6.01k|                           yaml::parse_anchor_name(key_probe, end);
 4698|  6.01k|                           yaml::skip_inline_ws(key_probe, end);
 4699|  6.01k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4699:32): [True: 5.95k, False: 60]
  |  Branch (4699:53): [True: 429, False: 5.52k]
  |  Branch (4699:74): [True: 499, False: 5.03k]
  ------------------
 4700|    928|                              parse_complex_flow_key = true;
 4701|    928|                           }
 4702|  6.01k|                        }
 4703|  56.3k|                     }
 4704|       |
 4705|  56.3k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4705:26): [True: 4.08k, False: 52.2k]
  ------------------
 4706|  4.08k|                        glz::generic key_node{};
 4707|  4.08k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4708|  4.08k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4708:29): [True: 847, False: 3.23k]
  ------------------
 4709|    847|                           return;
 4710|  3.23k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4710:29): [True: 3, False: 3.23k]
  ------------------
 4711|      3|                           return;
 4712|  3.23k|                     }
 4713|  52.2k|                     else {
 4714|  52.2k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4714:29): [True: 1.10k, False: 51.1k]
  ------------------
 4715|  1.10k|                           return;
 4716|  1.10k|                        }
 4717|  52.2k|                     }
 4718|  56.3k|                  }
 4719|       |               }
 4720|       |               else {
 4721|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4722|       |                     ctx.error = error_code::syntax_error;
 4723|       |                     return;
 4724|       |                  }
 4725|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4726|       |                  if (bool(ctx.error)) [[unlikely]]
 4727|       |                     return;
 4728|       |               }
 4729|       |
 4730|       |               // Separation between flow key and ':' may include comments/newlines.
 4731|       |               // In flow context, newlines are allowed between key and ':'.
 4732|  55.6k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4733|  57.5k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4733:20): [True: 5, False: 57.5k]
  ------------------
 4734|      5|                  return;
 4735|       |
 4736|  57.5k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4737|  57.5k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4738|  57.5k|                     val = {};
 4739|  57.5k|                     return true;
 4740|  57.5k|                  }
 4741|  57.5k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4742|  57.5k|                     val = glz::generic{};
 4743|  57.5k|                     return true;
 4744|  57.5k|                  }
 4745|  57.5k|                  else {
 4746|  57.5k|                     static constexpr std::string_view null_value{"null"};
 4747|  57.5k|                     auto null_it = null_value.data();
 4748|  57.5k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4749|  57.5k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4750|  57.5k|                     return !bool(ctx.error);
 4751|  57.5k|                  }
 4752|  57.5k|               };
 4753|       |
 4754|  57.5k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4754:20): [True: 54.6k, False: 2.89k]
  |  Branch (4754:34): [True: 31.7k, False: 22.9k]
  |  Branch (4754:48): [True: 5.51k, False: 17.4k]
  ------------------
 4755|  37.2k|                  val_t val{};
 4756|  37.2k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4756:23): [True: 0, False: 37.2k]
  ------------------
 4757|      0|                     return;
 4758|       |
 4759|  37.2k|                  value.emplace(std::move(key), std::move(val));
 4760|       |
 4761|  37.2k|                  if (*it == '}') {
  ------------------
  |  Branch (4761:23): [True: 5.51k, False: 31.7k]
  ------------------
 4762|  5.51k|                     ++it;
 4763|  5.51k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4764|  5.51k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4764:26): [True: 13, False: 5.50k]
  ------------------
 4765|     13|                        return;
 4766|  5.50k|                     break;
 4767|  5.51k|                  }
 4768|       |
 4769|  31.7k|                  ++it; // skip comma
 4770|  31.7k|                  yaml::skip_ws_and_newlines(it, end);
 4771|  31.7k|                  continue;
 4772|  37.2k|               }
 4773|       |
 4774|  20.3k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4774:20): [True: 2.89k, False: 17.4k]
  |  Branch (4774:33): [True: 200, False: 17.2k]
  ------------------
 4775|  1.14k|                  ctx.error = error_code::syntax_error;
 4776|  1.14k|                  return;
 4777|  1.14k|               }
 4778|  19.1k|               ++it;
 4779|       |
 4780|  19.1k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4781|  19.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4781:20): [True: 3, False: 19.1k]
  ------------------
 4782|      3|                  return;
 4783|       |
 4784|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4785|  19.1k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4785:20): [True: 17.1k, False: 2.00k]
  |  Branch (4785:34): [True: 3.30k, False: 13.8k]
  |  Branch (4785:48): [True: 3.28k, False: 10.5k]
  ------------------
 4786|  6.59k|                  val_t val{};
 4787|  6.59k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4787:23): [True: 0, False: 6.59k]
  ------------------
 4788|      0|                     return;
 4789|       |
 4790|  6.59k|                  value.emplace(std::move(key), std::move(val));
 4791|       |
 4792|  6.59k|                  if (*it == '}') {
  ------------------
  |  Branch (4792:23): [True: 3.28k, False: 3.30k]
  ------------------
 4793|  3.28k|                     ++it;
 4794|  3.28k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4795|  3.28k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4795:26): [True: 4, False: 3.27k]
  ------------------
 4796|      4|                        return;
 4797|  3.27k|                     break;
 4798|  3.28k|                  }
 4799|       |
 4800|  3.30k|                  ++it; // skip comma
 4801|  3.30k|                  yaml::skip_ws_and_newlines(it, end);
 4802|  3.30k|                  continue;
 4803|  6.59k|               }
 4804|       |
 4805|       |               // Parse value
 4806|  12.5k|               val_t val{};
 4807|  12.5k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4808|  12.5k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 325, False: 12.2k]
  ------------------
 4809|    325|                  return;
 4810|       |
 4811|  12.2k|               value.emplace(std::move(key), std::move(val));
 4812|       |
 4813|  12.2k|               yaml::skip_inline_ws(it, end);
 4814|       |
 4815|  12.2k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4815:20): [True: 10.1k, False: 2.10k]
  |  Branch (4815:33): [True: 1.66k, False: 8.48k]
  ------------------
 4816|  1.66k|                  ++it;
 4817|  1.66k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4818|  1.66k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4818:23): [True: 10, False: 1.65k]
  ------------------
 4819|     10|                     return;
 4820|  1.65k|                  break;
 4821|  1.66k|               }
 4822|  10.5k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4822:25): [True: 8.48k, False: 2.10k]
  |  Branch (4822:38): [True: 7.06k, False: 1.41k]
  ------------------
 4823|  7.06k|                  ++it;
 4824|       |                  // Skip whitespace and newlines after comma
 4825|  7.06k|                  yaml::skip_ws_and_newlines(it, end);
 4826|  7.06k|               }
 4827|  3.52k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4827:25): [True: 1.41k, False: 2.10k]
  |  Branch (4827:39): [True: 418, False: 1.00k]
  |  Branch (4827:54): [True: 940, False: 61]
  ------------------
 4828|       |                  // Newlines may precede either the closing brace or the
 4829|       |                  // separator comma for the next entry.
 4830|  1.35k|                  yaml::skip_ws_and_newlines(it, end);
 4831|  1.35k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4831:23): [True: 1.28k, False: 70]
  |  Branch (4831:36): [True: 267, False: 1.02k]
  ------------------
 4832|    267|                     ++it;
 4833|    267|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4834|    267|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4834:26): [True: 2, False: 265]
  ------------------
 4835|      2|                        return;
 4836|    265|                     break;
 4837|    267|                  }
 4838|  1.09k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4838:23): [True: 1.02k, False: 70]
  |  Branch (4838:36): [True: 991, False: 30]
  ------------------
 4839|    991|                     ++it;
 4840|    991|                     yaml::skip_ws_and_newlines(it, end);
 4841|    991|                     continue;
 4842|    991|                  }
 4843|    100|                  ctx.error = error_code::syntax_error;
 4844|    100|                  return;
 4845|  1.09k|               }
 4846|  2.17k|               else {
 4847|  2.17k|                  ctx.error = error_code::syntax_error;
 4848|  2.17k|                  return;
 4849|  2.17k|               }
 4850|  12.2k|            }
 4851|  19.5k|         }
 4852|   263k|         else {
 4853|       |            // Block mapping - use shared loop with map-specific callback
 4854|   263k|            yaml::parse_block_mapping_loop<Opts>(
 4855|   263k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4856|   263k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|   263k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4858|   263k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   263k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   263k|                           if (ctx.stream_begin) {
 4866|   263k|                              auto is_line_content_start = [&](auto pos) {
 4867|   263k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   263k|                              };
 4869|       |
 4870|   263k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   263k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   263k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   263k|                                 return line != end && *line == ':';
 4874|   263k|                              };
 4875|       |
 4876|   263k|                              if (!is_line_content_start(it) &&
 4877|   263k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4878|   263k|                                  !line_has_explicit_value_indicator(it)) {
 4879|   263k|                                 ctx.error = error_code::syntax_error;
 4880|   263k|                                 return false;
 4881|   263k|                              }
 4882|   263k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   263k|                           }
 4884|   263k|                        }
 4885|       |
 4886|   263k|                        if (*it == '-' &&
 4887|   263k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4888|   263k|                            !line_starts_with_explicit_value_indicator) {
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|   263k|                           ctx.error = error_code::syntax_error;
 4891|   263k|                           return false;
 4892|   263k|                        }
 4893|       |
 4894|   263k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4895|   263k|                           return false;
 4896|   263k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   263k|                        ctx.pop_indent();
 4898|   263k|                     }
 4899|   263k|                     else {
 4900|   263k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|   263k|                        if (nested_indent >= 0) {
 4902|   263k|                           yaml::skip_to_content(it, end);
 4903|   263k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4904|   263k|                              ctx.error = error_code::syntax_error;
 4905|   263k|                              return false;
 4906|   263k|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|   263k|                           const int32_t value_indent =
 4910|   263k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4911|   263k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4912|   263k|                              return false;
 4913|   263k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|   263k|                           ctx.pop_indent();
 4915|   263k|                        }
 4916|   263k|                     }
 4917|   263k|                     return !bool(ctx.error);
 4918|   263k|                  };
 4919|       |
 4920|       |                  // Explicit key entry form:
 4921|       |                  // ? key
 4922|       |                  // : value
 4923|   263k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4924|   263k|                     ctx.error = error_code::syntax_error;
 4925|   263k|                     return false;
 4926|   263k|                  }
 4927|   263k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4928|   263k|                     ++it; // skip '?'
 4929|   263k|                     yaml::skip_inline_ws(it, end);
 4930|       |
 4931|   263k|                     const int32_t explicit_value_indicator_indent =
 4932|   263k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4933|       |
 4934|   263k|                     key_t key{};
 4935|   263k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4936|   263k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   263k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   263k|                        };
 4939|       |
 4940|   263k|                        auto key_it = it;
 4941|   263k|                        yaml::skip_inline_ws(key_it, end);
 4942|       |
 4943|   263k|                        auto content = key_it;
 4944|   263k|                        yaml::skip_to_content(content, end);
 4945|   263k|                        bool handled_anchor_only_empty_key = false;
 4946|       |
 4947|       |                        // Anchor on an empty explicit key node:
 4948|       |                        //   ? &a
 4949|       |                        //   : value
 4950|   263k|                        if (content != end && *content == '&') {
 4951|   263k|                           auto anchor_probe = content + 1;
 4952|   263k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4953|   263k|                           if (!anchor_name.empty()) {
 4954|   263k|                              auto after_anchor = anchor_probe;
 4955|   263k|                              yaml::skip_inline_ws(after_anchor, end);
 4956|       |
 4957|   263k|                              auto value_indicator = after_anchor;
 4958|   263k|                              if (value_indicator != end && *value_indicator == ':') {
 4959|   263k|                                 key.clear();
 4960|   263k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4961|   263k|                                 it = value_indicator;
 4962|   263k|                                 handled_anchor_only_empty_key = true;
 4963|   263k|                              }
 4964|   263k|                              else {
 4965|   263k|                                 if (value_indicator != end && *value_indicator == '#') {
 4966|   263k|                                    yaml::skip_comment(value_indicator, end);
 4967|   263k|                                 }
 4968|   263k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4969|   263k|                                    yaml::skip_newline(value_indicator, end);
 4970|   263k|                                    auto value_line = value_indicator;
 4971|   263k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4972|   263k|                                    if (bool(ctx.error)) [[unlikely]]
 4973|   263k|                                       return false;
 4974|   263k|                                    if (value_line != end && *value_line == ':' &&
 4975|   263k|                                        value_indent == explicit_value_indicator_indent) {
 4976|   263k|                                       key.clear();
 4977|   263k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4978|   263k|                                       it = value_line;
 4979|   263k|                                       handled_anchor_only_empty_key = true;
 4980|   263k|                                    }
 4981|   263k|                                    else if (value_line != end && *value_line == ':') {
 4982|       |                                       // In explicit-key form ("? &a"), a following ':'
 4983|       |                                       // starts the outer value indicator only at the same
 4984|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4985|   263k|                                       ctx.error = error_code::syntax_error;
 4986|   263k|                                       return false;
 4987|   263k|                                    }
 4988|   263k|                                 }
 4989|   263k|                              }
 4990|   263k|                           }
 4991|   263k|                        }
 4992|       |
 4993|   263k|                        const bool key_content_spans_lines = [&] {
 4994|   263k|                           auto scan = key_it;
 4995|   263k|                           while (scan != content && scan != end) {
 4996|   263k|                              if (*scan == '\n' || *scan == '\r') return true;
 4997|   263k|                              ++scan;
 4998|   263k|                           }
 4999|   263k|                           return false;
 5000|   263k|                        }();
 5001|       |
 5002|   263k|                        if (handled_anchor_only_empty_key) {
 5003|       |                           // 'it' already points to the explicit value indicator ':'
 5004|   263k|                        }
 5005|   263k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5006|   263k|                           key.clear();
 5007|   263k|                           it = content;
 5008|   263k|                        }
 5009|   263k|                        else {
 5010|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5011|       |                           // Parse the key node structurally (not via plain-key scanning)
 5012|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5013|       |                           // as complex keys, not split into implicit key/value pairs.
 5014|   263k|                           auto key_node_it = content;
 5015|   263k|                           auto key_node_end = end;
 5016|   263k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5017|       |                              // In explicit-key form, a following standalone ':'
 5018|       |                              // line (same or lower indentation) belongs to the
 5019|       |                              // outer mapping value, not the key node itself.
 5020|   263k|                              auto scan = content;
 5021|   263k|                              while (scan != end) {
 5022|   263k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5023|   263k|                                    ++scan;
 5024|   263k|                                 }
 5025|   263k|                                 if (scan == end) {
 5026|   263k|                                    break;
 5027|   263k|                                 }
 5028|       |
 5029|   263k|                                 yaml::skip_newline(scan, end);
 5030|   263k|                                 auto line_start = scan;
 5031|       |
 5032|   263k|                                 int32_t indicator_indent = 0;
 5033|   263k|                                 while (scan != end && *scan == ' ') {
 5034|   263k|                                    ++indicator_indent;
 5035|   263k|                                    ++scan;
 5036|   263k|                                 }
 5037|       |
 5038|   263k|                                 if (scan != end && *scan == ':') {
 5039|   263k|                                    const auto after_colon = scan + 1;
 5040|   263k|                                    if ((after_colon == end ||
 5041|   263k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5042|   263k|                                        indicator_indent <= line_indent) {
 5043|   263k|                                       key_node_end = line_start;
 5044|   263k|                                       break;
 5045|   263k|                                    }
 5046|   263k|                                 }
 5047|   263k|                              }
 5048|   263k|                           }
 5049|       |
 5050|   263k|                           glz::generic key_node{};
 5051|   263k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5052|   263k|                           ctx.explicit_mapping_key_context = true;
 5053|   263k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5054|   263k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5055|   263k|                           if (bool(ctx.error)) [[unlikely]]
 5056|   263k|                              return false;
 5057|   263k|                           it = key_node_it;
 5058|   263k|                           if (!to_string_key(key_node)) [[unlikely]]
 5059|   263k|                              return false;
 5060|   263k|                        }
 5061|   263k|                     }
 5062|   263k|                     else {
 5063|   263k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5064|   263k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5065|   263k|                           if (bool(ctx.error)) [[unlikely]]
 5066|   263k|                              return false;
 5067|   263k|                        }
 5068|   263k|                     }
 5069|       |
 5070|   263k|                     yaml::skip_inline_ws(it, end);
 5071|   263k|                     yaml::skip_comment(it, end);
 5072|       |
 5073|       |                     // Value indicator may appear on the next line at the same indent.
 5074|   263k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5075|   263k|                        auto probe = it;
 5076|   263k|                        bool found_value_indicator = false;
 5077|       |
 5078|   263k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5079|   263k|                           yaml::skip_newline(probe, end);
 5080|       |
 5081|   263k|                           auto value_line = probe;
 5082|   263k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5083|   263k|                           if (bool(ctx.error)) [[unlikely]]
 5084|   263k|                              return false;
 5085|       |
 5086|   263k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5087|   263k|                              probe = value_line;
 5088|   263k|                              continue; // blank line
 5089|   263k|                           }
 5090|   263k|                           if (*value_line == '#') {
 5091|   263k|                              yaml::skip_comment(value_line, end);
 5092|   263k|                              probe = value_line;
 5093|   263k|                              continue; // comment-only line
 5094|   263k|                           }
 5095|   263k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5096|   263k|                              it = value_line;
 5097|   263k|                              found_value_indicator = true;
 5098|   263k|                           }
 5099|   263k|                           break;
 5100|   263k|                        }
 5101|       |
 5102|   263k|                        if (found_value_indicator) {
 5103|   263k|                           yaml::skip_inline_ws(it, end);
 5104|   263k|                        }
 5105|   263k|                     }
 5106|       |
 5107|   263k|                     val_t val{};
 5108|   263k|                     if (it != end && *it == ':') {
 5109|   263k|                        ++it;
 5110|   263k|                        if (it != end && *it == '\t') {
 5111|   263k|                           ctx.error = error_code::syntax_error;
 5112|   263k|                           return false;
 5113|   263k|                        }
 5114|   263k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5115|   263k|                           auto probe = it;
 5116|   263k|                           yaml::skip_newline(probe, end);
 5117|   263k|                           while (probe != end && *probe == ' ') ++probe;
 5118|   263k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5119|   263k|                              ctx.error = error_code::syntax_error;
 5120|   263k|                              return false;
 5121|   263k|                           }
 5122|   263k|                        }
 5123|   263k|                        yaml::skip_inline_ws(it, end);
 5124|   263k|                        if (!parse_map_value(val)) [[unlikely]]
 5125|   263k|                           return false;
 5126|   263k|                     }
 5127|       |
 5128|   263k|                     value.emplace(std::move(key), std::move(val));
 5129|   263k|                     return true;
 5130|   263k|                  }
 5131|       |
 5132|   263k|                  key_t key{};
 5133|   263k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5134|   263k|                     auto key_probe = it;
 5135|   263k|                     yaml::skip_inline_ws(key_probe, end);
 5136|   263k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5137|   263k|                     if (complex_flow_key) {
 5138|   263k|                        glz::generic key_node{};
 5139|   263k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5140|   263k|                        if (bool(ctx.error)) [[unlikely]]
 5141|   263k|                           return false;
 5142|   263k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5143|   263k|                           return false;
 5144|   263k|                     }
 5145|   263k|                     else {
 5146|   263k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5147|   263k|                           return false;
 5148|   263k|                        }
 5149|   263k|                     }
 5150|   263k|                  }
 5151|   263k|                  else {
 5152|   263k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5153|   263k|                     if (bool(ctx.error)) [[unlikely]]
 5154|   263k|                        return false;
 5155|   263k|                  }
 5156|       |
 5157|   263k|                  yaml::skip_inline_ws(it, end);
 5158|       |
 5159|   263k|                  if (it == end || *it != ':') {
 5160|   263k|                     ctx.error = error_code::syntax_error;
 5161|   263k|                     return false;
 5162|   263k|                  }
 5163|   263k|                  ++it;
 5164|   263k|                  yaml::skip_inline_ws(it, end);
 5165|       |
 5166|   263k|                  val_t val{};
 5167|   263k|                  if (!parse_map_value(val)) [[unlikely]]
 5168|   263k|                     return false;
 5169|       |
 5170|   263k|                  value.emplace(std::move(key), std::move(val));
 5171|   263k|                  return true;
 5172|   263k|               });
 5173|   263k|         }
 5174|       |
 5175|   279k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5176|   279k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   290k|      {
  466|   290k|         skip_inline_ws(it, end);
  467|       |
  468|   290k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 5, False: 290k]
  ------------------
  469|      5|            if constexpr (!AllowEmptyInput) {
  470|      5|               ctx.error = error_code::unexpected_end;
  471|      5|            }
  472|      5|            return true;
  473|      5|         }
  474|       |
  475|   290k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   290k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 290k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|   290k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 290k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   290k|         skip_inline_ws(it, end);
  486|       |
  487|   290k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 4, False: 290k]
  ------------------
  488|      4|            if constexpr (!AllowEmptyInput) {
  489|      4|               ctx.error = error_code::unexpected_end;
  490|      4|            }
  491|      4|            return true;
  492|      4|         }
  493|       |
  494|   290k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.03k, False: 287k]
  ------------------
  495|  3.03k|            return true;
  496|  3.03k|         }
  497|       |
  498|   287k|         return false;
  499|   290k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4599|   290k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   290k|      {
  409|   290k|         state.has_anchor = false;
  410|   290k|         state.anchor_name.clear();
  411|   290k|         state.anchor_start = nullptr;
  412|   290k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   290k|         if constexpr (Policy.allow_alias) {
  415|   290k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   290k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 281k, False: 9.15k]
  ------------------
  417|   281k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 3.01k, False: 278k]
  ------------------
  418|   281k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   290k|         }
  424|       |
  425|   290k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 287k, False: 3.01k]
  |  Branch (425:27): [True: 19.0k, False: 268k]
  ------------------
  426|  19.0k|            ++it;
  427|  19.0k|            auto name = parse_anchor_name(it, end);
  428|  19.0k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 16, False: 18.9k]
  ------------------
  429|     16|               ctx.error = error_code::syntax_error;
  430|     16|               return true;
  431|     16|            }
  432|  18.9k|            skip_inline_ws(it, end);
  433|  18.9k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 4, False: 18.9k]
  ------------------
  434|      4|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|      4|                  ctx.error = error_code::unexpected_end;
  436|      4|               }
  437|      4|               return true;
  438|      4|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  18.9k|            state.has_anchor = true;
  446|  18.9k|            state.anchor_name = std::string(name);
  447|  18.9k|            state.anchor_start = &*it;
  448|  18.9k|         }
  449|       |
  450|   290k|         return false;
  451|   290k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   281k|      {
  301|   281k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 281k]
  |  Branch (301:27): [True: 278k, False: 3.01k]
  ------------------
  302|       |
  303|  3.01k|         ++it; // skip '*'
  304|  3.01k|         auto name = parse_anchor_name(it, end);
  305|  3.01k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 10, False: 3.00k]
  ------------------
  306|     10|            ctx.error = error_code::syntax_error;
  307|     10|            return true;
  308|     10|         }
  309|       |
  310|  3.00k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.00k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 29, False: 2.97k]
  ------------------
  312|     29|            ctx.error = error_code::syntax_error; // undefined alias
  313|     29|            return true;
  314|     29|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  2.97k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.97k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 780, False: 2.19k]
  ------------------
  322|    780|            return true;
  323|    780|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  2.19k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 17, False: 2.18k]
  ------------------
  329|     17|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     17|            return true;
  331|     17|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  2.18k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.18k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 2.17k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  2.17k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.17k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  2.17k|         auto replay_it = span.begin;
  348|  2.17k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.17k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.17k|         ctx.indent_stack.clear();
  353|  2.17k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.46k, False: 714]
  ------------------
  354|  1.46k|            ctx.push_indent(span.base_indent - 1);
  355|  1.46k|         }
  356|       |
  357|  2.17k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.17k|         using V = std::remove_cvref_t<T>;
  360|  2.17k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.17k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.17k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.17k|         return true;
  367|  2.17k|      }
_ZN3glz4yaml40inline_value_has_plain_mapping_indicatorIPKcS3_EEbT_T0_:
 3104|  3.25M|      {
 3105|  3.25M|         const auto stop = yaml::implicit_key_scan_end(pos, end);
 3106|       |         // See `line_could_be_block_mapping` for why a quote is an indicator only where a node can
 3107|       |         // begin. The value segment is itself a node position, so the scan starts at one.
 3108|  3.25M|         bool at_node_start = true;
 3109|  3.25M|         int flow_depth = 0;
 3110|  24.5M|         while (pos != stop) {
  ------------------
  |  Branch (3110:17): [True: 24.2M, False: 280k]
  ------------------
 3111|  24.2M|            const char c = *pos;
 3112|  24.2M|            if (c == '\n' || c == '\r' || c == '#') return false;
  ------------------
  |  Branch (3112:17): [True: 741k, False: 23.5M]
  |  Branch (3112:30): [True: 452k, False: 23.0M]
  |  Branch (3112:43): [True: 1.25M, False: 21.8M]
  ------------------
 3113|  21.8M|            if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (3113:17): [True: 4.50M, False: 17.3M]
  |  Branch (3113:29): [True: 661k, False: 16.6M]
  ------------------
 3114|  5.16M|               ++pos;
 3115|  5.16M|               continue;
 3116|  5.16M|            }
 3117|  16.6M|            const bool node_start = std::exchange(at_node_start, false);
 3118|       |
 3119|  16.6M|            if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (3119:18): [True: 140k, False: 16.5M]
  |  Branch (3119:30): [True: 36.1k, False: 16.4M]
  |  Branch (3119:44): [True: 49.5k, False: 126k]
  ------------------
 3120|       |               // A quote in a plain scalar must not make the probe scan a later line, and the
 3121|       |               // '' escape must not be mistaken for the end of a single-quoted scalar.
 3122|  49.5k|               if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
  ------------------
  |  Branch (3122:20): [True: 4.01k, False: 45.5k]
  ------------------
 3123|  45.5k|               continue;
 3124|  49.5k|            }
 3125|  16.5M|            if ((c == '[' || c == '{') && (node_start || flow_depth > 0)) {
  ------------------
  |  Branch (3125:18): [True: 232k, False: 16.3M]
  |  Branch (3125:30): [True: 557k, False: 15.8M]
  |  Branch (3125:44): [True: 624k, False: 166k]
  |  Branch (3125:58): [True: 73.6k, False: 92.8k]
  ------------------
 3126|   697k|               ++flow_depth;
 3127|   697k|               at_node_start = true;
 3128|   697k|               ++pos;
 3129|   697k|               continue;
 3130|   697k|            }
 3131|  15.8M|            if ((c == ']' || c == '}') && flow_depth > 0) {
  ------------------
  |  Branch (3131:18): [True: 130k, False: 15.7M]
  |  Branch (3131:30): [True: 282k, False: 15.4M]
  |  Branch (3131:43): [True: 185k, False: 226k]
  ------------------
 3132|   185k|               --flow_depth;
 3133|   185k|               ++pos;
 3134|   185k|               continue;
 3135|   185k|            }
 3136|  15.7M|            if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (3136:17): [True: 844k, False: 14.8M]
  |  Branch (3136:29): [True: 518k, False: 325k]
  ------------------
 3137|   518k|               const auto next = pos + 1;
 3138|   518k|               return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (3138:23): [True: 5.32k, False: 513k]
  |  Branch (3138:40): [True: 164k, False: 348k]
  |  Branch (3138:56): [True: 11.4k, False: 337k]
  |  Branch (3138:73): [True: 14.4k, False: 322k]
  |  Branch (3138:90): [True: 51.4k, False: 271k]
  ------------------
 3139|   518k|            }
 3140|  15.1M|            if (flow_depth > 0 && (c == ',' || c == ':')) {
  ------------------
  |  Branch (3140:17): [True: 3.14M, False: 12.0M]
  |  Branch (3140:36): [True: 161k, False: 2.97M]
  |  Branch (3140:48): [True: 325k, False: 2.65M]
  ------------------
 3141|   487k|               at_node_start = true;
 3142|   487k|               ++pos;
 3143|   487k|               continue;
 3144|   487k|            }
 3145|  14.7M|            if (node_start && yaml::skip_probe_node_property(pos, stop)) {
  ------------------
  |  Branch (3145:17): [True: 5.06M, False: 9.63M]
  |  Branch (3145:31): [True: 2.29M, False: 2.77M]
  ------------------
 3146|  2.29M|               at_node_start = true;
 3147|  2.29M|               continue;
 3148|  2.29M|            }
 3149|  12.4M|            ++pos;
 3150|  12.4M|         }
 3151|   280k|         return false;
 3152|  3.25M|      }
_ZN3glz4yaml32validate_flow_node_adjacent_tailINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_:
  947|  3.86M|      {
  948|  3.86M|         if (it == end) return;
  ------------------
  |  Branch (948:14): [True: 1.32M, False: 2.53M]
  ------------------
  949|  2.53M|         const char c = *it;
  950|       |         // After a flow collection closes, the next character must be a structural
  951|       |         // separator or whitespace/comment. Adjacent plain content is malformed.
  952|  2.53M|         if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '#' || c == ',' || c == ']' || c == '}' ||
  ------------------
  |  Branch (952:14): [True: 324k, False: 2.21M]
  |  Branch (952:26): [True: 69.7k, False: 2.14M]
  |  Branch (952:39): [True: 52.6k, False: 2.09M]
  |  Branch (952:52): [True: 127k, False: 1.96M]
  |  Branch (952:65): [True: 65.1k, False: 1.89M]
  |  Branch (952:77): [True: 1.33M, False: 564k]
  |  Branch (952:89): [True: 37.0k, False: 527k]
  |  Branch (952:101): [True: 76.1k, False: 450k]
  ------------------
  953|  2.53M|             c == ':') {
  ------------------
  |  Branch (953:14): [True: 448k, False: 2.82k]
  ------------------
  954|  2.53M|            return;
  955|  2.53M|         }
  956|  2.82k|         ctx.error = error_code::syntax_error;
  957|  2.82k|      }
_ZN3glz4yaml20finalize_node_anchorINS0_12yaml_contextEPKcEEvRNS0_19node_property_stateERT_T0_:
  455|  17.0M|      {
  456|  17.0M|         if (state.has_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (456:14): [True: 366k, False: 16.7M]
  |  Branch (456:34): [True: 336k, False: 30.3k]
  ------------------
  457|   336k|            ctx.anchors[std::move(state.anchor_name)] = {state.anchor_start, &*it, state.anchor_indent};
  458|   336k|         }
  459|  17.0M|      }
_ZN3glz4yaml25skip_flow_ws_and_newlinesINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_Pb:
  869|  27.9M|      {
  870|  27.9M|         bool at_line_start = false;
  871|  27.9M|         bool saw_separation_ws = false;
  872|  27.9M|         bool line_has_indent = false;
  873|  41.5M|         while (it != end) {
  ------------------
  |  Branch (873:17): [True: 41.0M, False: 493k]
  ------------------
  874|  41.0M|            if (*it == ' ') {
  ------------------
  |  Branch (874:17): [True: 8.77M, False: 32.2M]
  ------------------
  875|  8.77M|               ++it;
  876|  8.77M|               saw_separation_ws = true;
  877|  8.77M|               if (at_line_start) line_has_indent = true;
  ------------------
  |  Branch (877:20): [True: 2.57M, False: 6.19M]
  ------------------
  878|  8.77M|               continue;
  879|  8.77M|            }
  880|  32.2M|            if (*it == '\t') {
  ------------------
  |  Branch (880:17): [True: 451k, False: 31.7M]
  ------------------
  881|   451k|               if (at_line_start && !line_has_indent) {
  ------------------
  |  Branch (881:20): [True: 126k, False: 325k]
  |  Branch (881:37): [True: 82.6k, False: 43.5k]
  ------------------
  882|  82.6k|                  auto probe = it;
  883|   198k|                  while (probe != end && (*probe == ' ' || *probe == '\t')) ++probe;
  ------------------
  |  Branch (883:26): [True: 195k, False: 2.12k]
  |  Branch (883:43): [True: 13.2k, False: 182k]
  |  Branch (883:60): [True: 102k, False: 80.5k]
  ------------------
  884|  82.6k|                  if (probe != end && *probe != '\n' && *probe != '\r' && *probe != '#') {
  ------------------
  |  Branch (884:23): [True: 80.5k, False: 2.12k]
  |  Branch (884:39): [True: 67.3k, False: 13.2k]
  |  Branch (884:57): [True: 13.2k, False: 54.1k]
  |  Branch (884:75): [True: 8.99k, False: 4.21k]
  ------------------
  885|  8.99k|                     const char c = *probe;
  886|  8.99k|                     const bool allowed_flow_delim = (c == ']' || c == '}' || c == '[' || c == '{' || c == ',');
  ------------------
  |  Branch (886:55): [True: 320, False: 8.67k]
  |  Branch (886:67): [True: 4.76k, False: 3.90k]
  |  Branch (886:79): [True: 240, False: 3.66k]
  |  Branch (886:91): [True: 504, False: 3.16k]
  |  Branch (886:103): [True: 2.93k, False: 224]
  ------------------
  887|  8.99k|                     if (!allowed_flow_delim) {
  ------------------
  |  Branch (887:26): [True: 224, False: 8.76k]
  ------------------
  888|    224|                        ctx.error = error_code::syntax_error;
  889|    224|                        return;
  890|    224|                     }
  891|  8.99k|                  }
  892|  82.6k|               }
  893|   451k|               ++it;
  894|   451k|               saw_separation_ws = true;
  895|   451k|               if (at_line_start) line_has_indent = true;
  ------------------
  |  Branch (895:20): [True: 125k, False: 325k]
  ------------------
  896|   451k|               continue;
  897|   451k|            }
  898|  31.7M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (898:17): [True: 1.00M, False: 30.7M]
  |  Branch (898:32): [True: 3.03M, False: 27.7M]
  ------------------
  899|  4.03M|               skip_newline(it, end);
  900|  4.03M|               if (saw_line_break) *saw_line_break = true;
  ------------------
  |  Branch (900:20): [True: 18.2k, False: 4.02M]
  ------------------
  901|  4.03M|               at_line_start = true;
  902|  4.03M|               saw_separation_ws = true;
  903|  4.03M|               line_has_indent = false;
  904|  4.03M|               continue;
  905|  4.03M|            }
  906|  27.7M|            if (*it == '#') {
  ------------------
  |  Branch (906:17): [True: 285k, False: 27.4M]
  ------------------
  907|       |               // In flow style, comments require separation from the previous token.
  908|       |               // Allow comment-only lines and comments after inline whitespace, but
  909|       |               // reject adjacency forms like ",#comment" (CVW2).
  910|   285k|               bool separated_by_prev_ws = false;
  911|   285k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
  912|   285k|                  if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (912:23): [True: 285k, False: 0]
  |  Branch (912:43): [True: 285k, False: 0]
  ------------------
  913|   285k|                     const char prev = *(it - 1);
  914|   285k|                     separated_by_prev_ws = (prev == ' ' || prev == '\t');
  ------------------
  |  Branch (914:46): [True: 129k, False: 156k]
  |  Branch (914:61): [True: 25.6k, False: 130k]
  ------------------
  915|   285k|                  }
  916|   285k|               }
  917|   285k|               if (!(at_line_start || saw_separation_ws || separated_by_prev_ws)) {
  ------------------
  |  Branch (917:22): [True: 145k, False: 140k]
  |  Branch (917:39): [True: 49.5k, False: 90.7k]
  |  Branch (917:60): [True: 61.4k, False: 29.2k]
  ------------------
  918|  29.2k|                  break;
  919|  29.2k|               }
  920|   256k|               skip_comment(it, end);
  921|   256k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (921:20): [True: 254k, False: 2.21k]
  |  Branch (921:34): [True: 130k, False: 123k]
  |  Branch (921:49): [True: 123k, False: 570]
  ------------------
  922|   253k|                  skip_newline(it, end);
  923|   253k|                  if (saw_line_break) *saw_line_break = true;
  ------------------
  |  Branch (923:23): [True: 1.46k, False: 252k]
  ------------------
  924|   253k|                  at_line_start = true;
  925|   253k|                  saw_separation_ws = true;
  926|   253k|                  continue;
  927|   253k|               }
  928|  2.78k|               continue;
  929|   256k|            }
  930|       |
  931|       |            // In block context, multiline flow nodes require indentation on content
  932|       |            // continuation lines (except structural tokens).
  933|  27.4M|            if (at_line_start && ctx.current_indent() >= 0 && !line_has_indent) {
  ------------------
  |  Branch (933:17): [True: 2.91M, False: 24.5M]
  |  Branch (933:34): [True: 152k, False: 2.76M]
  |  Branch (933:63): [True: 72.8k, False: 79.8k]
  ------------------
  934|  72.8k|               const char c = *it;
  935|  72.8k|               const bool structural = (c == ']' || c == '}' || c == ',');
  ------------------
  |  Branch (935:41): [True: 4.43k, False: 68.3k]
  |  Branch (935:53): [True: 15.8k, False: 52.5k]
  |  Branch (935:65): [True: 51.9k, False: 616]
  ------------------
  936|  72.8k|               if (!structural) {
  ------------------
  |  Branch (936:20): [True: 616, False: 72.2k]
  ------------------
  937|    616|                  ctx.error = error_code::syntax_error;
  938|    616|                  return;
  939|    616|               }
  940|  72.8k|            }
  941|  27.4M|            break;
  942|  27.4M|         }
  943|  27.9M|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  2.01M|      {
  275|  2.01M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  2.01M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  2.01M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  2.01M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_:
 5725|  2.72M|      {
 5726|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5727|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5728|  2.72M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5729|  2.72M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5730|  2.72M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5731|  2.72M|                       "the internally tagged shape, so it is rejected here instead.");
 5732|  2.72M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5732:14): [True: 0, False: 2.72M]
  ------------------
 5733|      0|            return;
 5734|       |
 5735|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5736|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5737|       |         // indent stack does not cover.
 5738|  2.72M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5739|  2.72M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5739:14): [True: 30, False: 2.72M]
  ------------------
 5740|     30|            return;
 5741|       |
 5742|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5743|       |         // For nested values, only skip inline whitespace to preserve block structure
 5744|  2.72M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5744:14): [True: 2.21M, False: 518k]
  ------------------
 5745|  2.21M|            yaml::skip_ws_newlines_comments(it, end);
 5746|  2.21M|         }
 5747|   518k|         else {
 5748|   518k|            yaml::skip_inline_ws(it, end);
 5749|   518k|         }
 5750|       |
 5751|  2.72M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5751:14): [True: 351, False: 2.72M]
  ------------------
 5752|    351|            ctx.error = error_code::unexpected_end;
 5753|    351|            return;
 5754|    351|         }
 5755|       |
 5756|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5757|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5758|       |         // same variant definitions round-trip across both formats.
 5759|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5760|       |            using V = std::remove_cvref_t<T>;
 5761|       |            const bool value_is_mapping =
 5762|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5763|       |            if (value_is_mapping) {
 5764|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5765|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5766|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5767|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5768|       |               auto tag_ctx = ctx.make_speculative();
 5769|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5770|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5771|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5772|       |               if (index < ids_v<V>.size()) {
 5773|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5774|       |                  emplace_runtime_variant(value, index);
 5775|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5776|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5777|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5778|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5779|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5780|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5781|       |                     return;
 5782|       |                  }
 5783|       |                  std::visit(
 5784|       |                     [&](auto&& alt) {
 5785|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5786|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5787|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5788|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5789|       |                        }
 5790|       |                        else if constexpr (custom_read<Alt>) {
 5791|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5792|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5793|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5794|       |                           // entry, then hand the remaining mapping to the custom handler.
 5795|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5796|       |                              ctx.error = error_code::feature_not_supported;
 5797|       |                              ctx.custom_error_message =
 5798|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5799|       |                           }
 5800|       |                           else {
 5801|       |                              ctx.scratch.clear();
 5802|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5803|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5804|       |                                    ctx.error = error_code::feature_not_supported;
 5805|       |                                    ctx.custom_error_message =
 5806|       |                                       "the tag must be the first key for a custom variant alternative";
 5807|       |                                 }
 5808|       |                                 else {
 5809|       |                                    yaml::skip_inline_ws(it, end);
 5810|       |                                    if (it == end || *it != ':') {
 5811|       |                                       ctx.error = error_code::syntax_error;
 5812|       |                                    }
 5813|       |                                    else {
 5814|       |                                       ++it;
 5815|       |                                       yaml::skip_inline_ws(it, end);
 5816|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5817|       |                                       if (!bool(ctx.error)) {
 5818|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5819|       |                                          // was the whole mapping: leave the alternative default.
 5820|       |                                          auto probe = it;
 5821|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5822|       |                                          if (probe == end) {
 5823|       |                                             it = probe;
 5824|       |                                          }
 5825|       |                                          else {
 5826|       |                                             // Publish the mapping's column so the custom handler's block
 5827|       |                                             // mapping (which would otherwise discover its own indent) reads
 5828|       |                                             // the remaining entries at the variant's indent and dedents
 5829|       |                                             // correctly in every context (root, sequence, nested).
 5830|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5831|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5832|       |                                             ctx.forced_block_mapping_indent = -1;
 5833|       |                                          }
 5834|       |                                       }
 5835|       |                                    }
 5836|       |                                 }
 5837|       |                              }
 5838|       |                           }
 5839|       |                        }
 5840|       |                        else {
 5841|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5842|       |                           // the value, but the mapping must still be consumed.
 5843|       |                           walk_tagged_mapping<Opts>(
 5844|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5845|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5846|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5847|       |                              });
 5848|       |                        }
 5849|       |                     },
 5850|       |                     value);
 5851|       |                  ctx.pop_indent();
 5852|       |                  return;
 5853|       |               }
 5854|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5855|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5856|       |               // otherwise the deduction path reports no_matching_variant_type.
 5857|       |            }
 5858|       |         }
 5859|       |
 5860|  2.72M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5861|  2.72M|            using V = std::remove_cvref_t<T>;
 5862|  2.72M|            using counts = yaml_variant_type_count<V>;
 5863|  2.72M|            const char c = *it;
 5864|  2.72M|            auto is_plain_scalar_boundary = [](const char ch) {
 5865|  2.72M|               switch (ch) {
 5866|  2.72M|               case ' ':
 5867|  2.72M|               case '\t':
 5868|  2.72M|               case '\n':
 5869|  2.72M|               case '\r':
 5870|  2.72M|               case ',':
 5871|  2.72M|               case ']':
 5872|  2.72M|               case '}':
 5873|  2.72M|                  return true;
 5874|  2.72M|               default:
 5875|  2.72M|                  return false;
 5876|  2.72M|               }
 5877|  2.72M|            };
 5878|       |
 5879|  2.72M|            auto has_indented_block_continuation = [&](auto word_end) {
 5880|  2.72M|               if constexpr (yaml::check_flow_context(Opts)) {
 5881|  2.72M|                  return false;
 5882|  2.72M|               }
 5883|  2.72M|               if (ctx.current_indent() < 0) {
 5884|  2.72M|                  return false;
 5885|  2.72M|               }
 5886|  2.72M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5887|  2.72M|                  return false;
 5888|  2.72M|               }
 5889|       |
 5890|  2.72M|               auto look = word_end;
 5891|  2.72M|               yaml::skip_newline(look, end);
 5892|  2.72M|               while (look != end) {
 5893|  2.72M|                  int32_t line_indent = 0;
 5894|  2.72M|                  while (look != end && *look == ' ') {
 5895|  2.72M|                     ++line_indent;
 5896|  2.72M|                     ++look;
 5897|  2.72M|                  }
 5898|  2.72M|                  if (look != end && *look == '\t') {
 5899|  2.72M|                     return false;
 5900|  2.72M|                  }
 5901|  2.72M|                  if (look == end || *look == '\n' || *look == '\r') {
 5902|  2.72M|                     if (look != end) {
 5903|  2.72M|                        yaml::skip_newline(look, end);
 5904|  2.72M|                        continue;
 5905|  2.72M|                     }
 5906|  2.72M|                     return false;
 5907|  2.72M|                  }
 5908|  2.72M|                  if (*look == '#') {
 5909|  2.72M|                     yaml::skip_comment(look, end);
 5910|  2.72M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5911|  2.72M|                        yaml::skip_newline(look, end);
 5912|  2.72M|                        continue;
 5913|  2.72M|                     }
 5914|  2.72M|                     return false;
 5915|  2.72M|                  }
 5916|       |
 5917|       |                  // If the next non-empty line is an implicit mapping entry,
 5918|       |                  // don't treat it as scalar continuation for auto-deduced
 5919|       |                  // booleans/nulls.
 5920|  2.72M|                  {
 5921|  2.72M|                     auto scan = look;
 5922|  2.72M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5923|  2.72M|                        if (*scan == ':') {
 5924|  2.72M|                           auto after_colon = scan + 1;
 5925|  2.72M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5926|  2.72M|                               *after_colon == '\n' || *after_colon == '\r') {
 5927|  2.72M|                              return false;
 5928|  2.72M|                           }
 5929|  2.72M|                        }
 5930|  2.72M|                        ++scan;
 5931|  2.72M|                     }
 5932|  2.72M|                  }
 5933|       |
 5934|  2.72M|                  return line_indent > ctx.current_indent();
 5935|  2.72M|               }
 5936|  2.72M|               return false;
 5937|  2.72M|            };
 5938|  2.72M|            auto is_word_boundary = [&](const auto ptr) {
 5939|  2.72M|               if (ptr == end) {
 5940|  2.72M|                  return true;
 5941|  2.72M|               }
 5942|  2.72M|               if (*ptr == ':') {
 5943|  2.72M|                  auto next = ptr + 1;
 5944|  2.72M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5945|  2.72M|               }
 5946|  2.72M|               return is_plain_scalar_boundary(*ptr);
 5947|  2.72M|            };
 5948|       |
 5949|  2.72M|            switch (c) {
 5950|   541k|            case '&': {
  ------------------
  |  Branch (5950:13): [True: 541k, False: 2.18M]
  ------------------
 5951|       |               // Anchor before value: parse name, then re-dispatch
 5952|   541k|               ++it;
 5953|   541k|               auto aname = yaml::parse_anchor_name(it, end);
 5954|   541k|               if (aname.empty()) {
  ------------------
  |  Branch (5954:20): [True: 199, False: 540k]
  ------------------
 5955|    199|                  ctx.error = error_code::syntax_error;
 5956|    199|                  return;
 5957|    199|               }
 5958|   540k|               yaml::skip_inline_ws(it, end);
 5959|   540k|               bool anchor_on_same_line = true;
 5960|   540k|               bool value_is_indentless_sequence = false;
 5961|   540k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5961:20): [True: 4.72k, False: 536k]
  |  Branch (5961:33): [True: 22.9k, False: 513k]
  |  Branch (5961:48): [True: 43.7k, False: 469k]
  |  Branch (5961:63): [True: 6.47k, False: 463k]
  ------------------
 5962|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5963|       |                  // next line (indented past current context) or if this is an empty node.
 5964|  77.8k|                  bool value_on_next_line = false;
 5965|  77.8k|                  if (it != end) {
  ------------------
  |  Branch (5965:23): [True: 73.1k, False: 4.72k]
  ------------------
 5966|  73.1k|                     auto peek = it;
 5967|       |                     // Skip comment if present
 5968|  73.1k|                     if (*peek == '#') {
  ------------------
  |  Branch (5968:26): [True: 6.47k, False: 66.6k]
  ------------------
 5969|  57.9k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5969:32): [True: 57.7k, False: 254]
  |  Branch (5969:47): [True: 55.3k, False: 2.40k]
  |  Branch (5969:64): [True: 51.4k, False: 3.81k]
  ------------------
 5970|  6.47k|                     }
 5971|       |                     // Skip newline
 5972|  73.1k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5972:26): [True: 72.9k, False: 254]
  |  Branch (5972:42): [True: 25.3k, False: 47.5k]
  |  Branch (5972:59): [True: 47.5k, False: 0]
  ------------------
 5973|  72.9k|                        yaml::skip_newline(peek, end);
 5974|       |                        // Skip blank lines
 5975|   133k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5975:32): [True: 130k, False: 2.28k]
  |  Branch (5975:48): [True: 30.1k, False: 100k]
  |  Branch (5975:65): [True: 30.0k, False: 70.6k]
  ------------------
 5976|  60.2k|                           yaml::skip_newline(peek, end);
 5977|  60.2k|                        }
 5978|       |                        // Measure indent of next content line
 5979|  72.9k|                        int32_t next_indent = 0;
 5980|   142k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5980:32): [True: 138k, False: 3.46k]
  |  Branch (5980:47): [True: 69.1k, False: 69.4k]
  ------------------
 5981|  69.1k|                           ++next_indent;
 5982|  69.1k|                           ++peek;
 5983|  69.1k|                        }
 5984|  72.9k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5984:29): [True: 69.4k, False: 3.46k]
  |  Branch (5984:44): [True: 67.7k, False: 1.73k]
  |  Branch (5984:61): [True: 67.2k, False: 457]
  ------------------
 5985|  67.2k|                           const bool indentless_sequence =
 5986|  67.2k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5986:31): [True: 66.2k, False: 1.02k]
  |  Branch (5986:69): [True: 17.7k, False: 48.5k]
  ------------------
 5987|  17.7k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5987:32): [True: 505, False: 17.2k]
  ------------------
 5988|  17.2k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5988:32): [True: 16.7k, False: 486]
  ------------------
 5989|  17.2k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5989:32): [True: 993, False: 16.2k]
  ------------------
 5990|  16.2k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5990:33): [True: 11.6k, False: 4.59k]
  |  Branch (5990:61): [True: 11.2k, False: 435]
  ------------------
 5991|  67.2k|                           value_is_indentless_sequence = indentless_sequence;
 5992|  67.2k|                           const bool same_indent_property_node =
 5993|  67.2k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5993:31): [True: 8.14k, False: 59.1k]
  ------------------
 5994|  8.14k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5994:32): [True: 262, False: 7.87k]
  |  Branch (5994:48): [True: 1.21k, False: 6.66k]
  |  Branch (5994:64): [True: 143, False: 6.51k]
  |  Branch (5994:80): [True: 316, False: 6.20k]
  |  Branch (5994:96): [True: 308, False: 5.89k]
  ------------------
 5995|  5.89k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5995:32): [True: 830, False: 5.06k]
  |  Branch (5995:48): [True: 448, False: 4.61k]
  |  Branch (5995:65): [True: 223, False: 4.39k]
  |  Branch (5995:81): [True: 1.04k, False: 3.34k]
  ------------------
 5996|  67.2k|                           value_on_next_line =
 5997|  67.2k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5997:31): [True: 38.6k, False: 28.5k]
  |  Branch (5997:71): [True: 12.2k, False: 16.3k]
  |  Branch (5997:94): [True: 4.79k, False: 11.5k]
  ------------------
 5998|  67.2k|                        }
 5999|  72.9k|                     }
 6000|  73.1k|                  }
 6001|  77.8k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6001:23): [True: 22.2k, False: 55.6k]
  ------------------
 6002|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6003|  22.2k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6004|  22.2k|                     return;
 6005|  22.2k|                  }
 6006|       |                  // Value is on next line — advance past newline/blank lines to the content
 6007|  55.6k|                  if (*it == '#') {
  ------------------
  |  Branch (6007:23): [True: 3.56k, False: 52.1k]
  ------------------
 6008|  40.7k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6008:29): [True: 40.7k, False: 0]
  |  Branch (6008:42): [True: 38.4k, False: 2.25k]
  |  Branch (6008:57): [True: 37.1k, False: 1.30k]
  ------------------
 6009|  3.56k|                  }
 6010|  55.6k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6010:23): [True: 55.6k, False: 0]
  ------------------
 6011|  89.0k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6011:26): [True: 89.0k, False: 0]
  |  Branch (6011:40): [True: 9.15k, False: 79.9k]
  |  Branch (6011:55): [True: 24.2k, False: 55.6k]
  ------------------
 6012|  33.4k|                     yaml::skip_newline(it, end);
 6013|  33.4k|                  }
 6014|  55.6k|                  yaml::skip_inline_ws(it, end);
 6015|  55.6k|                  anchor_on_same_line = false;
 6016|  55.6k|               }
 6017|       |
 6018|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6019|       |                  if (anchor_on_same_line && *it == '-' &&
 6020|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 6021|       |                     // "&anchor - item" is malformed in block context.
 6022|       |                     ctx.error = error_code::syntax_error;
 6023|       |                     return;
 6024|       |                  }
 6025|       |               }
 6026|       |
 6027|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6028|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6029|   518k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6029:20): [True: 518k, False: 11]
  |  Branch (6029:33): [True: 532, False: 518k]
  |  Branch (6029:47): [True: 91, False: 441]
  ------------------
 6030|     91|                  ctx.error = error_code::syntax_error;
 6031|     91|                  return;
 6032|     91|               }
 6033|       |
 6034|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6035|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 6036|       |                     auto probe = it + 1;
 6037|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6038|       |                     if (nested_anchor_name.empty()) {
 6039|       |                        ctx.error = error_code::syntax_error;
 6040|       |                        return;
 6041|       |                     }
 6042|       |                     yaml::skip_inline_ws(probe, end);
 6043|       |                     // Allow nested anchor usage only when it clearly starts a
 6044|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 6045|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 6046|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 6047|       |                        ctx.error = error_code::syntax_error;
 6048|       |                        return;
 6049|       |                     }
 6050|       |                  }
 6051|       |               }
 6052|       |
 6053|   518k|               const char* anchor_start = &*it;
 6054|   518k|               const int32_t anchor_indent = ctx.current_indent();
 6055|       |
 6056|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6057|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 6058|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 6059|       |                  // next line, the anchor applies to the entire next-line content.
 6060|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 6061|       |                     auto key_start = it;
 6062|       |                     if (*key_start == '!') {
 6063|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6064|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 6065|       |                           ctx.error = error_code::syntax_error;
 6066|       |                           return;
 6067|       |                        }
 6068|       |                        yaml::skip_inline_ws(key_start, end);
 6069|       |                        if (key_start == end) {
 6070|       |                           ctx.error = error_code::unexpected_end;
 6071|       |                           return;
 6072|       |                        }
 6073|       |                        if (*key_start == '\n' || *key_start == '\r') {
 6074|       |                           ctx.error = error_code::syntax_error;
 6075|       |                           return;
 6076|       |                        }
 6077|       |
 6078|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 6079|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 6080|       |                        // key-span registration below while the untagged spelling was rejected;
 6081|       |                        // an alias node carries no other properties either way.
 6082|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 6083|       |                           ctx.error = error_code::syntax_error;
 6084|       |                           return;
 6085|       |                        }
 6086|       |                     }
 6087|       |
 6088|       |                     // Find the key span by scanning to the key-value separator
 6089|       |                     auto key_scan = key_start;
 6090|       |                     auto key_end = key_start;
 6091|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6092|       |                        // Quoted key: skip to closing quote
 6093|       |                        const char quote = *key_scan;
 6094|       |                        ++key_scan;
 6095|       |                        while (key_scan != end && *key_scan != quote) {
 6096|       |                           if (*key_scan == '\\' && quote == '"') {
 6097|       |                              ++key_scan;
 6098|       |                              if (key_scan != end) ++key_scan;
 6099|       |                           }
 6100|       |                           else {
 6101|       |                              ++key_scan;
 6102|       |                           }
 6103|       |                        }
 6104|       |                        if (key_scan == end) {
 6105|       |                           ctx.error = error_code::syntax_error;
 6106|       |                           return;
 6107|       |                        }
 6108|       |                        ++key_scan; // past closing quote
 6109|       |                        key_end = key_scan;
 6110|       |                        yaml::skip_inline_ws(key_scan, end);
 6111|       |                     }
 6112|       |                     else {
 6113|       |                        // Plain key: scan to ':'
 6114|       |                        while (key_scan != end) {
 6115|       |                           if (*key_scan == ':') {
 6116|       |                              auto next = key_scan + 1;
 6117|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6118|       |                                 break;
 6119|       |                              }
 6120|       |                           }
 6121|       |                           ++key_scan;
 6122|       |                        }
 6123|       |                        key_end = key_scan;
 6124|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6125|       |                           --key_end;
 6126|       |                        }
 6127|       |                     }
 6128|       |                     if (key_scan == end || *key_scan != ':') {
 6129|       |                        ctx.error = error_code::syntax_error;
 6130|       |                        return;
 6131|       |                     }
 6132|       |                     // Store anchor with just the key text span
 6133|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6134|       |                     it = key_start;
 6135|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6136|       |                     if constexpr (counts::n_object > 0) {
 6137|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6138|       |                                                                                                        end);
 6139|       |                     }
 6140|       |                     else {
 6141|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6142|       |                     }
 6143|       |                     return;
 6144|       |                  }
 6145|       |               }
 6146|       |
 6147|   518k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6148|   518k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6149|   518k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6150|   518k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6151|   518k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6151:20): [True: 505k, False: 12.9k]
  ------------------
 6152|   505k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6153|   505k|               }
 6154|   518k|               return;
 6155|   518k|            }
 6156|   169k|            case '*': {
  ------------------
  |  Branch (6156:13): [True: 169k, False: 2.55M]
  ------------------
 6157|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6158|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6160|       |                     if constexpr (counts::n_object > 0) {
 6161|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|       |                                                                                                        end);
 6163|       |                        return;
 6164|       |                     }
 6165|       |                     else {
 6166|       |                        ctx.error = error_code::syntax_error;
 6167|       |                        return;
 6168|       |                     }
 6169|       |                  }
 6170|       |               }
 6171|       |
 6172|       |               // Alias value: look up anchor and replay
 6173|   169k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6174|   169k|               return;
 6175|   518k|            }
 6176|   190k|            case '!': {
  ------------------
  |  Branch (6176:13): [True: 190k, False: 2.53M]
  ------------------
 6177|       |               // Tag - parse it and dispatch based on tag type
 6178|   190k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6179|   190k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6179:20): [True: 60, False: 190k]
  ------------------
 6180|     60|                  ctx.error = error_code::syntax_error;
 6181|     60|                  return;
 6182|     60|               }
 6183|   190k|               yaml::skip_inline_ws(it, end);
 6184|   190k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6184:20): [True: 189k, False: 1.03k]
  |  Branch (6184:33): [True: 12.2k, False: 176k]
  ------------------
 6185|  12.2k|                  yaml::skip_comment(it, end);
 6186|  12.2k|               }
 6187|   190k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6187:20): [True: 188k, False: 1.57k]
  |  Branch (6187:34): [True: 13.7k, False: 174k]
  |  Branch (6187:49): [True: 29.9k, False: 144k]
  ------------------
 6188|  43.7k|                  auto content = it;
 6189|  43.7k|                  yaml::skip_newline(content, end);
 6190|  43.7k|                  yaml::skip_to_content(content, end);
 6191|       |
 6192|  43.7k|                  bool consume_following_content = false;
 6193|  43.7k|                  auto content_token = content;
 6194|  43.7k|                  if (content != end) {
  ------------------
  |  Branch (6194:23): [True: 40.1k, False: 3.62k]
  ------------------
 6195|  40.1k|                     auto indent_probe = content;
 6196|  40.1k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6197|  40.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6197:26): [True: 3, False: 40.1k]
  ------------------
 6198|      3|                        return;
 6199|  40.1k|                     content_token = indent_probe;
 6200|       |
 6201|       |                     // A tag at the end of a sequence/map entry has an empty value
 6202|       |                     // unless the next non-empty content is nested under the current node.
 6203|  40.1k|                     bool tagged_indentless_sequence = false;
 6204|  40.1k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6204:26): [True: 7.48k, False: 32.6k]
  |  Branch (6204:56): [True: 7.48k, False: 0]
  |  Branch (6204:79): [True: 6.88k, False: 602]
  ------------------
 6205|  6.88k|                        const auto after_dash = indent_probe + 1;
 6206|  6.88k|                        if (after_dash == end ||
  ------------------
  |  Branch (6206:29): [True: 390, False: 6.49k]
  ------------------
 6207|  6.54k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6207:29): [True: 6.15k, False: 339]
  ------------------
 6208|  6.54k|                           tagged_indentless_sequence =
 6209|  6.54k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6209:31): [True: 393, False: 6.15k]
  ------------------
 6210|  6.15k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6210:32): [True: 3.89k, False: 2.25k]
  |  Branch (6210:60): [True: 454, False: 3.44k]
  ------------------
 6211|  6.54k|                        }
 6212|  6.88k|                     }
 6213|       |
 6214|  40.1k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6214:50): [True: 18.8k, False: 21.2k]
  ------------------
 6215|  21.2k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6215:50): [True: 11.8k, False: 9.43k]
  |  Branch (6215:93): [True: 847, False: 8.58k]
  ------------------
 6216|  40.1k|                  }
 6217|       |
 6218|  43.7k|                  if (consume_following_content) {
  ------------------
  |  Branch (6218:23): [True: 31.5k, False: 12.2k]
  ------------------
 6219|  31.5k|                     it = content_token;
 6220|  31.5k|                  }
 6221|  12.2k|                  else {
 6222|  12.2k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6222:26): [True: 355, False: 11.8k]
  ------------------
 6223|    355|                        if constexpr (counts::n_str > 0) {
 6224|    355|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6225|    355|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6226|    355|                           value = StrType{};
 6227|    355|                           return;
 6228|    355|                        }
 6229|    355|                     }
 6230|  12.2k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6230:26): [True: 323, False: 11.8k]
  ------------------
 6231|    323|                        if constexpr (counts::n_null > 0) {
 6232|    323|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6233|    323|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6234|    323|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6234:32): [True: 0, False: 323]
  ------------------
 6235|    323|                           return;
 6236|    323|                        }
 6237|    323|                     }
 6238|  12.2k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6238:26): [True: 10.7k, False: 1.45k]
  ------------------
 6239|  10.7k|                        if constexpr (counts::n_null > 0) {
 6240|  10.7k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6241|  10.7k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6242|  10.7k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6242:32): [True: 0, False: 10.7k]
  ------------------
 6243|  10.7k|                           return;
 6244|  10.7k|                        }
 6245|  10.7k|                     }
 6246|  12.2k|                  }
 6247|  43.7k|               }
 6248|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6249|       |                  // In block context, a comma immediately after a tag token is malformed
 6250|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6251|       |                  if (it != end && *it == ',') {
 6252|       |                     ctx.error = error_code::syntax_error;
 6253|       |                     return;
 6254|       |                  }
 6255|       |                  if constexpr (counts::n_object > 0) {
 6256|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6257|       |                     const bool starts_block_sequence_entry =
 6258|       |                        (it != end && *it == '-') &&
 6259|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6260|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6261|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6262|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6263|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6264|       |                        return;
 6265|       |                     }
 6266|       |                  }
 6267|       |               }
 6268|   190k|               if (it == end) {
  ------------------
  |  Branch (6268:20): [True: 1.57k, False: 188k]
  ------------------
 6269|  1.57k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6269:23): [True: 361, False: 1.21k]
  ------------------
 6270|    361|                     if constexpr (counts::n_str > 0) {
 6271|    361|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6272|    361|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6273|    361|                        value = StrType{};
 6274|    361|                        return;
 6275|    361|                     }
 6276|    361|                  }
 6277|  1.57k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6277:23): [True: 1.20k, False: 373]
  ------------------
 6278|  1.20k|                     if constexpr (counts::n_null > 0) {
 6279|  1.20k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6280|  1.20k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6281|  1.20k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6281:29): [True: 0, False: 1.20k]
  ------------------
 6282|  1.20k|                        return;
 6283|  1.20k|                     }
 6284|  1.20k|                  }
 6285|      0|                  ctx.error = error_code::unexpected_end;
 6286|  1.57k|                  return;
 6287|  1.57k|               }
 6288|   188k|               switch (tag) {
 6289|    470|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6289:16): [True: 470, False: 188k]
  ------------------
 6290|    470|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6291|    470|                  return;
 6292|  1.99k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6292:16): [True: 1.99k, False: 186k]
  ------------------
 6293|  4.15k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6293:16): [True: 2.16k, False: 186k]
  ------------------
 6294|  4.15k|                  if constexpr (counts::n_num > 0) {
 6295|  4.15k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6296|  4.15k|                     return;
 6297|       |                  }
 6298|       |                  else { // else used to fix MSVC unreachable code warning
 6299|       |                     ctx.error = error_code::syntax_error;
 6300|       |                     return;
 6301|       |                  }
 6302|  19.3k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6302:16): [True: 15.1k, False: 173k]
  ------------------
 6303|  19.3k|                  if constexpr (counts::n_bool > 0) {
 6304|  19.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6305|  19.3k|                     return;
 6306|       |                  }
 6307|       |                  else { // else used to fix MSVC unreachable code warning
 6308|       |                     ctx.error = error_code::syntax_error;
 6309|       |                     return;
 6310|       |                  }
 6311|  19.9k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6311:16): [True: 653, False: 187k]
  ------------------
 6312|  19.9k|                  if constexpr (counts::n_null > 0) {
 6313|  19.9k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6314|  19.9k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6315|  19.9k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6315:26): [True: 0, False: 19.9k]
  ------------------
 6316|  19.9k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6317|  19.9k|                     return;
 6318|       |                  }
 6319|       |                  else { // else used to fix MSVC unreachable code warning
 6320|       |                     ctx.error = error_code::syntax_error;
 6321|       |                     return;
 6322|       |                  }
 6323|  38.6k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6323:16): [True: 18.6k, False: 169k]
  ------------------
 6324|  38.6k|                  if constexpr (counts::n_object > 0) {
 6325|  38.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6326|  38.6k|                                                                                                     end);
 6327|  38.6k|                     return;
 6328|       |                  }
 6329|       |                  else { // else used to fix MSVC unreachable code warning
 6330|       |                     ctx.error = error_code::syntax_error;
 6331|       |                     return;
 6332|       |                  }
 6333|  53.8k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6333:16): [True: 15.2k, False: 173k]
  ------------------
 6334|  53.8k|                  if constexpr (counts::n_array > 0) {
 6335|  53.8k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6336|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                        if (it != end && *it == '-') {
 6338|       |                           ctx.allow_indentless_sequence = true;
 6339|       |                        }
 6340|       |                     }
 6341|  53.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6342|  53.8k|                                                                                                    end);
 6343|  53.8k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6344|  53.8k|                     return;
 6345|       |                  }
 6346|       |                  else { // else used to fix MSVC unreachable code warning
 6347|       |                     ctx.error = error_code::syntax_error;
 6348|       |                     return;
 6349|       |                  }
 6350|   176k|               default: {
  ------------------
  |  Branch (6350:16): [True: 122k, False: 65.7k]
  ------------------
 6351|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6352|       |                  // Preserve collection kinds, otherwise treat as string content.
 6353|   176k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6353:23): [True: 122k, False: 53.8k]
  |  Branch (6353:36): [True: 69.5k, False: 53.2k]
  ------------------
 6354|  69.5k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6355|  69.5k|                     return;
 6356|  69.5k|                  }
 6357|       |
 6358|   107k|                  if constexpr (counts::n_array > 0) {
 6359|   107k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6359:26): [True: 53.2k, False: 53.8k]
  |  Branch (6359:39): [True: 1.06k, False: 52.1k]
  ------------------
 6360|  1.06k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6361|  1.06k|                                                                                                       end);
 6362|  1.06k|                        return;
 6363|  1.06k|                     }
 6364|   107k|                  }
 6365|   107k|                  if constexpr (counts::n_object > 0) {
 6366|   107k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6366:26): [True: 52.1k, False: 54.8k]
  |  Branch (6366:39): [True: 1.01k, False: 51.1k]
  ------------------
 6367|  1.01k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6368|  1.01k|                                                                                                        end);
 6369|  1.01k|                        return;
 6370|  1.01k|                     }
 6371|   107k|                  }
 6372|       |
 6373|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6374|       |                     if constexpr (counts::n_array > 0) {
 6375|       |                        const bool starts_block_sequence_entry =
 6376|       |                           (it != end && *it == '-') &&
 6377|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6378|       |                        if (starts_block_sequence_entry) {
 6379|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6380|       |                                                                                                          it, end);
 6381|       |                           return;
 6382|       |                        }
 6383|       |                     }
 6384|       |                     if constexpr (counts::n_object > 0) {
 6385|       |                        const bool starts_explicit_mapping_indicator =
 6386|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6387|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6388|       |                        if (starts_explicit_mapping_indicator) {
 6389|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6390|       |                                                                                                           it, end);
 6391|       |                           return;
 6392|       |                        }
 6393|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6394|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6395|       |                                                                                                           it, end);
 6396|       |                           return;
 6397|       |                        }
 6398|       |                     }
 6399|       |                  }
 6400|       |
 6401|   107k|                  if constexpr (counts::n_str > 0) {
 6402|   107k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6403|   107k|                     return;
 6404|   107k|                  }
 6405|       |
 6406|       |                  // Fall back if no string alternative exists.
 6407|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6408|   107k|                  return;
 6409|   176k|               }
 6410|   188k|               }
 6411|      0|               return;
 6412|   188k|            }
 6413|   414k|            case '{':
  ------------------
  |  Branch (6413:13): [True: 414k, False: 2.31M]
  ------------------
 6414|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6415|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6416|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6417|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6418|       |                                                                                                     end);
 6419|       |                     return;
 6420|       |                  }
 6421|       |               }
 6422|       |               // Flow mapping - object type
 6423|   414k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6424|   414k|               return;
 6425|  35.8k|            case '[':
  ------------------
  |  Branch (6425:13): [True: 35.8k, False: 2.69M]
  ------------------
 6426|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6427|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6428|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6429|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6430|       |                                                                                                     end);
 6431|       |                     return;
 6432|       |                  }
 6433|       |               }
 6434|       |               // Flow sequence - array type
 6435|  35.8k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6436|  35.8k|               return;
 6437|   118k|            case '?':
  ------------------
  |  Branch (6437:13): [True: 118k, False: 2.60M]
  ------------------
 6438|       |               // Explicit mapping key indicator ("? key")
 6439|   118k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6439:20): [True: 118k, False: 372]
  |  Branch (6439:39): [True: 5, False: 118k]
  ------------------
 6440|      5|                  ctx.error = error_code::syntax_error;
 6441|      5|                  return;
 6442|      5|               }
 6443|   118k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6443:20): [True: 118k, False: 372]
  |  Branch (6443:40): [True: 38.8k, False: 79.4k]
  |  Branch (6443:56): [True: 61.3k, False: 18.1k]
  |  Branch (6443:73): [True: 8.81k, False: 9.32k]
  ------------------
 6444|   109k|                  if constexpr (counts::n_object > 0) {
 6445|   109k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6446|   109k|                                                                                                     end);
 6447|   109k|                     return;
 6448|   109k|                  }
 6449|   109k|               }
 6450|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6451|   118k|               return;
 6452|     19|            case '%':
  ------------------
  |  Branch (6452:13): [True: 19, False: 2.72M]
  ------------------
 6453|       |               // Reserved directive indicator is not a plain scalar start.
 6454|     19|               ctx.error = error_code::syntax_error;
 6455|     19|               return;
 6456|  7.71k|            case '"':
  ------------------
  |  Branch (6456:13): [True: 7.71k, False: 2.72M]
  ------------------
 6457|  10.2k|            case '\'':
  ------------------
  |  Branch (6457:13): [True: 2.54k, False: 2.72M]
  ------------------
 6458|       |               // Could be a quoted string OR a quoted key in a block mapping
 6459|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6460|  10.2k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6461|  10.2k|               return;
 6462|  16.1k|            case 't':
  ------------------
  |  Branch (6462:13): [True: 16.1k, False: 2.71M]
  ------------------
 6463|  25.5k|            case 'T':
  ------------------
  |  Branch (6463:13): [True: 9.47k, False: 2.71M]
  ------------------
 6464|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6465|  25.5k|               if constexpr (counts::n_bool > 0) {
 6466|  25.5k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6466:23): [True: 24.9k, False: 630]
  |  Branch (6466:44): [True: 15.0k, False: 9.93k]
  |  Branch (6466:60): [True: 13.3k, False: 1.72k]
  |  Branch (6466:76): [True: 10.0k, False: 3.25k]
  ------------------
 6467|  14.9k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6467:44): [True: 2.31k, False: 12.5k]
  |  Branch (6467:60): [True: 1.18k, False: 1.12k]
  |  Branch (6467:76): [True: 885, False: 299]
  ------------------
 6468|       |                     // Check what follows the word "true"
 6469|  10.9k|                     const auto after_true = it + 4;
 6470|  10.9k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6471|       |
 6472|  10.9k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6472:26): [True: 9.69k, False: 1.25k]
  ------------------
 6473|  9.69k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6473:29): [True: 0, False: 9.69k]
  ------------------
 6474|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|      0|                           return;
 6476|      0|                        }
 6477|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6478|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6479|  9.69k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6479:29): [True: 9.23k, False: 456]
  |  Branch (6479:47): [True: 5.56k, False: 3.67k]
  ------------------
 6480|  5.56k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6480:30): [True: 342, False: 5.21k]
  |  Branch (6480:47): [True: 1.28k, False: 3.93k]
  |  Branch (6480:63): [True: 1.38k, False: 2.55k]
  |  Branch (6480:80): [True: 389, False: 2.16k]
  |  Branch (6480:97): [True: 2.16k, False: 0]
  ------------------
 6481|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6482|  5.56k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6483|  5.56k|                           return;
 6484|  5.56k|                        }
 6485|  4.13k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6486|  4.13k|                                                                                                      end);
 6487|  4.13k|                        return;
 6488|  9.69k|                     }
 6489|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6490|  10.9k|                  }
 6491|  25.5k|               }
 6492|  15.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6493|  25.5k|               return;
 6494|  21.9k|            case 'f':
  ------------------
  |  Branch (6494:13): [True: 21.9k, False: 2.70M]
  ------------------
 6495|  26.2k|            case 'F':
  ------------------
  |  Branch (6495:13): [True: 4.33k, False: 2.72M]
  ------------------
 6496|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6497|  26.2k|               if constexpr (counts::n_bool > 0) {
 6498|  26.2k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6498:23): [True: 25.8k, False: 414]
  |  Branch (6498:44): [True: 16.0k, False: 9.77k]
  |  Branch (6498:60): [True: 12.9k, False: 3.13k]
  |  Branch (6498:76): [True: 11.6k, False: 1.27k]
  |  Branch (6498:92): [True: 10.3k, False: 1.35k]
  ------------------
 6499|  15.5k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6499:44): [True: 1.78k, False: 13.7k]
  |  Branch (6499:60): [True: 1.46k, False: 322]
  |  Branch (6499:76): [True: 973, False: 494]
  |  Branch (6499:92): [True: 525, False: 448]
  ------------------
 6500|       |                     // Check what follows the word "false"
 6501|  10.8k|                     const auto after_false = it + 5;
 6502|  10.8k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6503|       |
 6504|  10.8k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6504:26): [True: 9.01k, False: 1.83k]
  ------------------
 6505|  9.01k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6505:29): [True: 0, False: 9.01k]
  ------------------
 6506|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|      0|                           return;
 6508|      0|                        }
 6509|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6510|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6511|  9.01k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6511:29): [True: 8.60k, False: 414]
  |  Branch (6511:47): [True: 5.84k, False: 2.75k]
  ------------------
 6512|  5.84k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6512:30): [True: 301, False: 5.54k]
  |  Branch (6512:47): [True: 619, False: 4.92k]
  |  Branch (6512:63): [True: 3.13k, False: 1.79k]
  |  Branch (6512:80): [True: 935, False: 856]
  |  Branch (6512:97): [True: 856, False: 0]
  ------------------
 6513|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6514|  5.84k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6515|  5.84k|                           return;
 6516|  5.84k|                        }
 6517|  3.17k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6518|  3.17k|                                                                                                      end);
 6519|  3.17k|                        return;
 6520|  9.01k|                     }
 6521|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6522|  10.8k|                  }
 6523|  26.2k|               }
 6524|  17.2k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6525|  26.2k|               return;
 6526|  11.1k|            case 'n':
  ------------------
  |  Branch (6526:13): [True: 11.1k, False: 2.71M]
  ------------------
 6527|  22.7k|            case 'N':
  ------------------
  |  Branch (6527:13): [True: 11.5k, False: 2.71M]
  ------------------
 6528|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6529|  22.7k|               if constexpr (counts::n_null > 0) {
 6530|  22.7k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6530:23): [True: 22.0k, False: 703]
  |  Branch (6530:44): [True: 11.3k, False: 10.6k]
  |  Branch (6530:60): [True: 9.82k, False: 1.50k]
  |  Branch (6530:76): [True: 9.13k, False: 694]
  ------------------
 6531|  12.8k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6531:44): [True: 2.28k, False: 10.5k]
  |  Branch (6531:60): [True: 1.71k, False: 576]
  |  Branch (6531:76): [True: 1.39k, False: 317]
  ------------------
 6532|       |                     // Check what follows the word "null"
 6533|  10.5k|                     const auto after_null = it + 4;
 6534|  10.5k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6535|       |
 6536|  10.5k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6536:26): [True: 7.75k, False: 2.77k]
  ------------------
 6537|  7.75k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6537:29): [True: 0, False: 7.75k]
  ------------------
 6538|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|      0|                           return;
 6540|      0|                        }
 6541|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6542|       |                        // "null: value" should parse as {null: value}, not as the null type
 6543|  7.75k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6543:29): [True: 7.18k, False: 577]
  |  Branch (6543:47): [True: 2.80k, False: 4.38k]
  ------------------
 6544|  2.80k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6544:30): [True: 385, False: 2.41k]
  |  Branch (6544:47): [True: 231, False: 2.18k]
  |  Branch (6544:63): [True: 1.66k, False: 520]
  |  Branch (6544:80): [True: 300, False: 220]
  |  Branch (6544:97): [True: 220, False: 0]
  ------------------
 6545|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6546|  2.80k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6547|  2.80k|                           return;
 6548|  2.80k|                        }
 6549|  4.95k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6550|  4.95k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6551|  4.95k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6551:29): [True: 0, False: 4.95k]
  ------------------
 6552|  4.95k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6553|  4.95k|                        return;
 6554|  7.75k|                     }
 6555|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6556|  10.5k|                  }
 6557|  22.7k|               }
 6558|  14.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6559|  22.7k|               return;
 6560|  3.50k|            case '~':
  ------------------
  |  Branch (6560:13): [True: 3.50k, False: 2.72M]
  ------------------
 6561|       |               // Null indicator
 6562|  3.50k|               if constexpr (counts::n_null > 0) {
 6563|  3.50k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6564|  3.50k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6565|  3.50k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6565:23): [True: 0, False: 3.50k]
  ------------------
 6566|  3.50k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6567|  3.50k|                  return;
 6568|  3.50k|               }
 6569|      0|               break; // Fall through to try other types
 6570|  80.5k|            case '-':
  ------------------
  |  Branch (6570:13): [True: 80.5k, False: 2.64M]
  ------------------
 6571|       |               // Could be negative number or block sequence indicator
 6572|  80.5k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6572:20): [True: 4.04k, False: 76.4k]
  |  Branch (6572:41): [True: 57.1k, False: 19.3k]
  ------------------
 6573|       |                  // Block sequence indicator "- "
 6574|  61.1k|                  if constexpr (counts::n_array > 0) {
 6575|  61.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6576|  61.1k|                                                                                                    end);
 6577|  61.1k|                     return;
 6578|  61.1k|                  }
 6579|  61.1k|               }
 6580|  80.5k|               if constexpr (counts::n_num > 0) {
 6581|  80.5k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6581:23): [True: 19.3k, False: 61.1k]
  |  Branch (6581:43): [True: 1.25k, False: 18.0k]
  |  Branch (6581:94): [True: 1.52k, False: 16.5k]
  ------------------
 6582|  2.77k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6583|  2.77k|                     return;
 6584|  2.77k|                  }
 6585|  80.5k|               }
 6586|  77.7k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6587|  80.5k|               return;
 6588|  10.7k|            case '+':
  ------------------
  |  Branch (6588:13): [True: 10.7k, False: 2.71M]
  ------------------
 6589|  27.4k|            case '.':
  ------------------
  |  Branch (6589:13): [True: 16.6k, False: 2.71M]
  ------------------
 6590|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6591|       |               // Try parsing as number speculatively, fall back to string on failure
 6592|  27.4k|               if constexpr (counts::n_num > 0) {
 6593|  27.4k|                  auto start_it = it;
 6594|  27.4k|                  auto temp_ctx = ctx.make_speculative();
 6595|  27.4k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6596|  27.4k|                                                                                               end);
 6597|  27.4k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6598|  27.4k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6599|  27.4k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6599:23): [True: 3.14k, False: 24.3k]
  ------------------
 6600|  3.14k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6601|  3.14k|                     return; // Successfully parsed as number
 6602|  3.14k|                  }
 6603|  24.3k|                  it = start_it; // Restore and fall through to string
 6604|  24.3k|               }
 6605|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6606|  27.4k|               return;
 6607|  1.06M|            default:
  ------------------
  |  Branch (6607:13): [True: 1.06M, False: 1.66M]
  ------------------
 6608|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6609|  1.06M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6609:20): [True: 956k, False: 105k]
  |  Branch (6609:32): [True: 812k, False: 144k]
  ------------------
 6610|       |                  // Try block mapping first (e.g., "123key: value")
 6611|   812k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6611:23): [True: 6.42k, False: 806k]
  ------------------
 6612|  6.42k|                     return;
 6613|  6.42k|                  }
 6614|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6615|   806k|                  if constexpr (counts::n_num > 0) {
 6616|   806k|                     auto start_it = it;
 6617|   806k|                     auto temp_ctx = ctx.make_speculative();
 6618|   806k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6619|   806k|                                                                                                  end);
 6620|   806k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6621|   806k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6622|   806k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6622:26): [True: 769k, False: 36.6k]
  ------------------
 6623|   769k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6624|   769k|                        return; // Successfully parsed as number
 6625|   769k|                     }
 6626|  36.6k|                     it = start_it; // Restore and fall through to string
 6627|  36.6k|                  }
 6628|       |                  // Fall through to string
 6629|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6630|   806k|                  return;
 6631|   812k|               }
 6632|       |               // Plain scalar - try block mapping, then string
 6633|   249k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6634|   249k|               return;
 6635|  2.72M|            }
 6636|  2.72M|         }
 6637|       |
 6638|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6639|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6640|       |
 6641|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6642|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6643|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6644|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6645|  2.72M|         error_code expansion_error{};
 6646|  2.72M|         std::string_view expansion_message{};
 6647|       |
 6648|  2.72M|         auto try_parse = [&]<size_t I>() -> bool {
 6649|  2.72M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6650|  2.72M|            auto start = it;
 6651|       |
 6652|  2.72M|            V v{};
 6653|  2.72M|            auto temp_ctx = ctx.make_speculative();
 6654|  2.72M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6655|  2.72M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6656|  2.72M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6657|       |
 6658|  2.72M|            if (!bool(temp_ctx.error)) {
 6659|  2.72M|               value = std::move(v);
 6660|  2.72M|               ctx.anchors = std::move(temp_ctx.anchors);
 6661|  2.72M|               return true;
 6662|  2.72M|            }
 6663|       |
 6664|  2.72M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6665|  2.72M|               expansion_error = temp_ctx.error;
 6666|  2.72M|               expansion_message = temp_ctx.custom_error_message;
 6667|  2.72M|            }
 6668|  2.72M|            it = start;
 6669|  2.72M|            return false;
 6670|  2.72M|         };
 6671|       |
 6672|  2.72M|         bool parsed = false;
 6673|  2.72M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6674|  2.72M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6675|  2.72M|         }(std::make_index_sequence<N>{});
 6676|       |
 6677|  2.72M|         if (!parsed) {
  ------------------
  |  Branch (6677:14): [True: 0, False: 2.72M]
  ------------------
 6678|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6678:17): [True: 0, False: 0]
  ------------------
 6679|      0|               ctx.error = expansion_error;
 6680|      0|               ctx.custom_error_message = expansion_message;
 6681|      0|            }
 6682|      0|            else {
 6683|      0|               ctx.error = error_code::no_matching_variant_type;
 6684|      0|            }
 6685|      0|         }
 6686|  2.72M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|   238k|      {
  301|   238k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 238k]
  |  Branch (301:27): [True: 0, False: 238k]
  ------------------
  302|       |
  303|   238k|         ++it; // skip '*'
  304|   238k|         auto name = parse_anchor_name(it, end);
  305|   238k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 121, False: 238k]
  ------------------
  306|    121|            ctx.error = error_code::syntax_error;
  307|    121|            return true;
  308|    121|         }
  309|       |
  310|   238k|         auto anchor_it = ctx.anchors.find(name);
  311|   238k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 454, False: 238k]
  ------------------
  312|    454|            ctx.error = error_code::syntax_error; // undefined alias
  313|    454|            return true;
  314|    454|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|   238k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   238k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 40.4k, False: 197k]
  ------------------
  322|  40.4k|            return true;
  323|  40.4k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|   197k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 16, False: 197k]
  ------------------
  329|     16|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     16|            return true;
  331|     16|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|   197k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   197k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 197k]
  ------------------
  339|      2|            return true;
  340|       |
  341|   197k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 8, False: 197k]
  ------------------
  342|      8|            ctx.error = error_code::exceeded_max_expansion;
  343|      8|            ctx.custom_error_message = "alias expansion";
  344|      8|            return true;
  345|      8|         }
  346|       |
  347|   197k|         auto replay_it = span.begin;
  348|   197k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   197k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   197k|         ctx.indent_stack.clear();
  353|   197k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 15.4k, False: 182k]
  ------------------
  354|  15.4k|            ctx.push_indent(span.base_indent - 1);
  355|  15.4k|         }
  356|       |
  357|   197k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   197k|         using V = std::remove_cvref_t<T>;
  360|   197k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   197k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   197k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   197k|         return true;
  367|   197k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   316k|      {
 5284|   316k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   316k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   316k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   316k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   316k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 316k, False: 0]
  ------------------
 5294|   316k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   316k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1960|   324k|      {
 1961|   324k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 5.50k, False: 319k]
  ------------------
 1962|  5.50k|            return;
 1963|       |
 1964|   319k|         yaml::node_preamble_state preamble{};
 1965|   319k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 9.08k, False: 310k]
  ------------------
 1966|   319k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  9.08k|            return;
 1968|       |
 1969|   310k|         std::string str;
 1970|   310k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   310k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 310k, False: 0]
  ------------------
 1973|  5.42k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 5.42k, False: 304k]
  ------------------
 1974|  5.42k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  5.42k|            break;
 1976|  2.12k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 2.12k, False: 307k]
  ------------------
 1977|  2.12k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  2.12k|            break;
 1979|    810|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 810, False: 309k]
  ------------------
 1980|  5.12k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 4.31k, False: 305k]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  5.12k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  5.12k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 1.87k, False: 3.25k]
  ------------------
 1986|  5.12k|            break;
 1987|   297k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 297k, False: 12.6k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|       |               if (ctx.current_indent() >= 0) {
 1992|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|       |               }
 1994|       |               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|       |               }
 1998|       |            }
 1999|   297k|            else {
 2000|   297k|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|   297k|            }
 2002|   297k|            break;
 2003|   310k|         }
 2004|       |
 2005|   310k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 308k, False: 1.37k]
  ------------------
 2006|   308k|            value = std::move(str);
 2007|   308k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   308k|         }
 2009|   310k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   319k|      {
  466|   319k|         skip_inline_ws(it, end);
  467|       |
  468|   319k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 11, False: 319k]
  ------------------
  469|     11|            if constexpr (!AllowEmptyInput) {
  470|     11|               ctx.error = error_code::unexpected_end;
  471|     11|            }
  472|     11|            return true;
  473|     11|         }
  474|       |
  475|   319k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   319k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 15, False: 319k]
  ------------------
  477|     15|            ctx.error = error_code::syntax_error;
  478|     15|            return true;
  479|     15|         }
  480|   319k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 319k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   319k|         skip_inline_ws(it, end);
  486|       |
  487|   319k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 10, False: 319k]
  ------------------
  488|     10|            if constexpr (!AllowEmptyInput) {
  489|     10|               ctx.error = error_code::unexpected_end;
  490|     10|            }
  491|     10|            return true;
  492|     10|         }
  493|       |
  494|   319k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 9.05k, False: 310k]
  ------------------
  495|  9.05k|            return true;
  496|  9.05k|         }
  497|       |
  498|   310k|         return false;
  499|   319k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1966|   319k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   319k|      {
  409|   319k|         state.has_anchor = false;
  410|   319k|         state.anchor_name.clear();
  411|   319k|         state.anchor_start = nullptr;
  412|   319k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   319k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   319k|            else {
  421|   319k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 9.00k, False: 310k]
  ------------------
  422|   319k|            }
  423|   319k|         }
  424|       |
  425|   319k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 310k, False: 9.00k]
  |  Branch (425:27): [True: 8.14k, False: 302k]
  ------------------
  426|  8.14k|            ++it;
  427|  8.14k|            auto name = parse_anchor_name(it, end);
  428|  8.14k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 8.13k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  8.13k|            skip_inline_ws(it, end);
  433|  8.13k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 30, False: 8.10k]
  ------------------
  434|     30|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     30|                  ctx.error = error_code::unexpected_end;
  436|     30|               }
  437|     30|               return true;
  438|     30|            }
  439|  8.10k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  8.10k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 4, False: 8.09k]
  ------------------
  441|      4|                  ctx.error = error_code::syntax_error;
  442|      4|                  return true;
  443|      4|               }
  444|  8.10k|            }
  445|  8.09k|            state.has_anchor = true;
  446|  8.10k|            state.anchor_name = std::string(name);
  447|  8.10k|            state.anchor_start = &*it;
  448|  8.10k|         }
  449|       |
  450|   319k|         return false;
  451|   319k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   319k|      {
  301|   319k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 319k]
  |  Branch (301:27): [True: 310k, False: 9.00k]
  ------------------
  302|       |
  303|  9.00k|         ++it; // skip '*'
  304|  9.00k|         auto name = parse_anchor_name(it, end);
  305|  9.00k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 12, False: 8.99k]
  ------------------
  306|     12|            ctx.error = error_code::syntax_error;
  307|     12|            return true;
  308|     12|         }
  309|       |
  310|  8.99k|         auto anchor_it = ctx.anchors.find(name);
  311|  8.99k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 35, False: 8.95k]
  ------------------
  312|     35|            ctx.error = error_code::syntax_error; // undefined alias
  313|     35|            return true;
  314|     35|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  8.95k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  8.95k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.08k, False: 7.87k]
  ------------------
  322|  1.08k|            return true;
  323|  1.08k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  7.87k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 8, False: 7.86k]
  ------------------
  329|      8|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      8|            return true;
  331|      8|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  7.86k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  7.86k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 7.86k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  7.86k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 7, False: 7.85k]
  ------------------
  342|      7|            ctx.error = error_code::exceeded_max_expansion;
  343|      7|            ctx.custom_error_message = "alias expansion";
  344|      7|            return true;
  345|      7|         }
  346|       |
  347|  7.85k|         auto replay_it = span.begin;
  348|  7.85k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  7.85k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  7.85k|         ctx.indent_stack.clear();
  353|  7.85k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 878, False: 6.97k]
  ------------------
  354|    878|            ctx.push_indent(span.base_indent - 1);
  355|    878|         }
  356|       |
  357|  7.85k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  7.85k|         using V = std::remove_cvref_t<T>;
  360|  7.85k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  7.85k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  7.85k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  7.85k|         return true;
  367|  7.86k|      }
_ZN3glz4yaml26parse_double_quoted_stringINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_:
  505|  1.49M|      {
  506|  1.49M|         static constexpr size_t string_padding_bytes = 8;
  507|       |
  508|  1.49M|         if (it == end || *it != '"') [[unlikely]] {
  ------------------
  |  Branch (508:14): [True: 0, False: 1.49M]
  |  Branch (508:27): [True: 0, False: 1.49M]
  ------------------
  509|      0|            ctx.error = error_code::expected_quote;
  510|      0|            return;
  511|      0|         }
  512|       |
  513|  1.49M|         ++it; // skip opening quote
  514|  1.49M|         auto start = it;
  515|       |
  516|       |         // Pass 1: Find closing quote byte-by-byte (need to handle newlines and escapes)
  517|  49.7M|         while (it != end && *it != '"') {
  ------------------
  |  Branch (517:17): [True: 49.7M, False: 414]
  |  Branch (517:30): [True: 48.2M, False: 1.49M]
  ------------------
  518|  48.2M|            if (*it == '\\') {
  ------------------
  |  Branch (518:17): [True: 596k, False: 47.6M]
  ------------------
  519|   596k|               ++it;
  520|   596k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (520:20): [True: 34, False: 596k]
  ------------------
  521|     34|                  ctx.error = error_code::unexpected_end;
  522|     34|                  return;
  523|     34|               }
  524|   596k|            }
  525|  47.6M|            else if (forbidden_control_table[uint8_t(*it)]) [[unlikely]] {
  ------------------
  |  Branch (525:22): [True: 678, False: 47.6M]
  ------------------
  526|       |               // A raw control byte is invalid; the \xXX escape form above is how such a
  527|       |               // character is legitimately carried in a double-quoted scalar.
  528|    678|               ctx.error = error_code::invalid_control_character;
  529|    678|               return;
  530|    678|            }
  531|  48.2M|            ++it;
  532|  48.2M|         }
  533|       |
  534|  1.49M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (534:14): [True: 414, False: 1.49M]
  ------------------
  535|    414|            ctx.error = error_code::unexpected_end;
  536|    414|            return;
  537|    414|         }
  538|       |
  539|       |         // Allocate buffer with room for potential expansion and SWAR padding
  540|       |         // Some YAML escapes expand: \L, \P -> 3 bytes UTF-8
  541|  1.49M|         const auto input_len = static_cast<size_t>(it - start);
  542|  1.49M|         value.resize(input_len + (input_len / 2) + string_padding_bytes);
  543|  1.49M|         auto* dst = value.data();
  544|  1.49M|         auto* const dst_start = dst;
  545|       |
  546|       |         // Pass 2: Copy and process escapes and line folding
  547|  1.49M|         auto src = start;
  548|  1.49M|         const auto* const src_end = &*it;
  549|       |         // Track position past which we should not trim. Escape-produced characters
  550|       |         // (even whitespace like \t) are content and must not be trimmed by line folding.
  551|  1.49M|         auto* last_non_trimmable = dst;
  552|       |
  553|  40.2M|         while (src < src_end) {
  ------------------
  |  Branch (553:17): [True: 38.7M, False: 1.49M]
  ------------------
  554|       |            // Check for newline - needs line folding
  555|  38.7M|            if (*src == '\n' || *src == '\r') {
  ------------------
  |  Branch (555:17): [True: 82.4k, False: 38.6M]
  |  Branch (555:33): [True: 55.9k, False: 38.5M]
  ------------------
  556|       |               // Trim trailing LITERAL whitespace from output before processing newline.
  557|       |               // Escape-produced whitespace (e.g. from \t) is preserved.
  558|   138k|               dst = (std::max)(last_non_trimmable, dst_start);
  559|       |
  560|       |               // Skip the newline
  561|   138k|               if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (561:20): [True: 55.9k, False: 82.4k]
  |  Branch (561:36): [True: 55.3k, False: 626]
  |  Branch (561:59): [True: 2.73k, False: 52.6k]
  ------------------
  562|  2.73k|                  src += 2; // CRLF
  563|  2.73k|               }
  564|   135k|               else {
  565|   135k|                  ++src;
  566|   135k|               }
  567|       |
  568|       |               // Skip leading indentation on the next line.
  569|   138k|               int indent_count = 0;
  570|   138k|               if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (570:20): [True: 80, False: 138k]
  ------------------
  571|   138k|               if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (571:20): [True: 120k, False: 18.1k]
  |  Branch (571:41): [True: 70, False: 120k]
  ------------------
  572|     70|                  ctx.error = error_code::syntax_error;
  573|     70|                  return;
  574|     70|               }
  575|       |
  576|       |               // Check if this is a blank line (another newline follows)
  577|   138k|               if (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (577:20): [True: 136k, False: 1.55k]
  |  Branch (577:38): [True: 13.4k, False: 123k]
  |  Branch (577:54): [True: 26.0k, False: 97.1k]
  ------------------
  578|       |                  // Blank line(s) - output newlines for each blank line
  579|   169k|                  while (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (579:26): [True: 166k, False: 2.82k]
  |  Branch (579:44): [True: 86.9k, False: 79.3k]
  |  Branch (579:60): [True: 42.7k, False: 36.5k]
  ------------------
  580|   129k|                     *dst++ = '\n';
  581|       |                     // Skip the newline
  582|   129k|                     if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (582:26): [True: 42.7k, False: 86.9k]
  |  Branch (582:42): [True: 42.0k, False: 718]
  |  Branch (582:65): [True: 4.31k, False: 37.7k]
  ------------------
  583|  4.31k|                        src += 2; // CRLF
  584|  4.31k|                     }
  585|   125k|                     else {
  586|   125k|                        ++src;
  587|   125k|                     }
  588|   129k|                     int blank_indent_count = 0;
  589|   129k|                     if (!yaml::skip_folded_line_indent(src, src_end, ctx, &blank_indent_count)) return;
  ------------------
  |  Branch (589:26): [True: 74, False: 129k]
  ------------------
  590|   129k|                     if (blank_indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (590:26): [True: 123k, False: 6.16k]
  |  Branch (590:53): [True: 82, False: 123k]
  ------------------
  591|     82|                        ctx.error = error_code::syntax_error;
  592|     82|                        return;
  593|     82|                     }
  594|   129k|                  }
  595|       |                  // Don't add space - we're now at content after blank line(s)
  596|  39.5k|               }
  597|  98.7k|               else {
  598|       |                  // Single newline - fold to space
  599|  98.7k|                  *dst++ = ' ';
  600|  98.7k|               }
  601|   138k|               last_non_trimmable = dst;
  602|   138k|               continue;
  603|   138k|            }
  604|       |
  605|  38.5M|            if (*src == '\\') {
  ------------------
  |  Branch (605:17): [True: 174k, False: 38.4M]
  ------------------
  606|   174k|               ++src;
  607|   174k|               if (src >= src_end) [[unlikely]] {
  ------------------
  |  Branch (607:20): [True: 0, False: 174k]
  ------------------
  608|       |                  // Shouldn't happen - we validated in pass 1
  609|      0|                  ctx.error = error_code::syntax_error;
  610|      0|                  return;
  611|      0|               }
  612|       |
  613|   174k|               const auto esc = uint8_t(*src);
  614|       |
  615|       |               // Check for escaped newline (line continuation - no space)
  616|   174k|               if (esc == '\n' || esc == '\r') {
  ------------------
  |  Branch (616:20): [True: 74.5k, False: 100k]
  |  Branch (616:35): [True: 19.0k, False: 81.0k]
  ------------------
  617|       |                  // Skip the newline
  618|  93.6k|                  if (esc == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (618:23): [True: 19.0k, False: 74.5k]
  |  Branch (618:38): [True: 2.87k, False: 16.1k]
  |  Branch (618:61): [True: 344, False: 2.52k]
  ------------------
  619|    344|                     src += 2; // CRLF
  620|    344|                  }
  621|  93.3k|                  else {
  622|  93.3k|                     ++src;
  623|  93.3k|                  }
  624|       |
  625|  93.6k|                  int indent_count = 0;
  626|  93.6k|                  if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (626:23): [True: 24, False: 93.6k]
  ------------------
  627|  93.6k|                  if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (627:23): [True: 91.5k, False: 2.05k]
  |  Branch (627:44): [True: 96, False: 91.4k]
  ------------------
  628|     96|                     ctx.error = error_code::syntax_error;
  629|     96|                     return;
  630|     96|                  }
  631|       |                  // No output - this is line continuation without space
  632|  93.5k|                  last_non_trimmable = dst;
  633|  93.5k|                  continue;
  634|  93.6k|               }
  635|       |
  636|       |               // Check simple escape table first
  637|  81.0k|               if (yaml_escape_is_simple[esc]) {
  ------------------
  |  Branch (637:20): [True: 47.3k, False: 33.7k]
  ------------------
  638|  47.3k|                  *dst++ = yaml_unescape_table[esc];
  639|  47.3k|                  ++src;
  640|  47.3k|               }
  641|       |               // Handle escapes requiring special processing
  642|  33.7k|               else if (yaml_escape_needs_special[esc]) {
  ------------------
  |  Branch (642:25): [True: 8.33k, False: 25.3k]
  ------------------
  643|  8.33k|                  ++src; // skip escape char
  644|  8.33k|                  switch (esc) {
  645|    434|                  case 'x': {
  ------------------
  |  Branch (645:19): [True: 434, False: 7.89k]
  ------------------
  646|       |                     // \xXX - 2 hex digits
  647|    434|                     if (static_cast<size_t>(src_end - src) < 2) [[unlikely]] {
  ------------------
  |  Branch (647:26): [True: 10, False: 424]
  ------------------
  648|     10|                        ctx.error = error_code::syntax_error;
  649|     10|                        return;
  650|     10|                     }
  651|    424|                     const uint32_t hi = digit_hex_table[uint8_t(src[0])];
  652|    424|                     const uint32_t lo = digit_hex_table[uint8_t(src[1])];
  653|    424|                     if ((hi | lo) & 0xF0) [[unlikely]] {
  ------------------
  |  Branch (653:26): [True: 34, False: 390]
  ------------------
  654|     34|                        ctx.error = error_code::syntax_error;
  655|     34|                        return;
  656|     34|                     }
  657|    390|                     const uint32_t codepoint = (hi << 4) | lo;
  658|    390|                     src += 2;
  659|    390|                     dst += code_point_to_utf8(codepoint, dst);
  660|    390|                     break;
  661|    424|                  }
  662|  1.61k|                  case 'u': {
  ------------------
  |  Branch (662:19): [True: 1.61k, False: 6.71k]
  ------------------
  663|       |                     // \uXXXX - 4 hex digits
  664|  1.61k|                     if (static_cast<size_t>(src_end - src) < 4) [[unlikely]] {
  ------------------
  |  Branch (664:26): [True: 10, False: 1.60k]
  ------------------
  665|     10|                        ctx.error = error_code::syntax_error;
  666|     10|                        return;
  667|     10|                     }
  668|  1.60k|                     const uint32_t codepoint = hex_to_u32(src);
  669|  1.60k|                     if (codepoint == 0xFFFFFFFFu || (codepoint >= 0xD800 && codepoint <= 0xDFFF)) [[unlikely]] {
  ------------------
  |  Branch (669:26): [True: 54, False: 1.54k]
  |  Branch (669:55): [True: 584, False: 964]
  |  Branch (669:78): [True: 30, False: 554]
  ------------------
  670|     84|                        ctx.error = error_code::syntax_error;
  671|     84|                        return;
  672|     84|                     }
  673|  1.51k|                     src += 4;
  674|  1.51k|                     dst += code_point_to_utf8(codepoint, dst);
  675|  1.51k|                     break;
  676|  1.60k|                  }
  677|  2.07k|                  case 'U': {
  ------------------
  |  Branch (677:19): [True: 2.07k, False: 6.25k]
  ------------------
  678|       |                     // \UXXXXXXXX - 8 hex digits
  679|  2.07k|                     if (static_cast<size_t>(src_end - src) < 8) [[unlikely]] {
  ------------------
  |  Branch (679:26): [True: 14, False: 2.06k]
  ------------------
  680|     14|                        ctx.error = error_code::syntax_error;
  681|     14|                        return;
  682|     14|                     }
  683|  2.06k|                     const uint32_t hi = hex_to_u32(src);
  684|  2.06k|                     const uint32_t lo = hex_to_u32(src + 4);
  685|  2.06k|                     if ((hi | lo) == 0xFFFFFFFFu) [[unlikely]] {
  ------------------
  |  Branch (685:26): [True: 66, False: 1.99k]
  ------------------
  686|     66|                        ctx.error = error_code::syntax_error;
  687|     66|                        return;
  688|     66|                     }
  689|  1.99k|                     const uint32_t codepoint = (hi << 16) | lo;
  690|  1.99k|                     src += 8;
  691|  1.99k|                     if (codepoint >= 0xD800 && codepoint <= 0xDFFF) [[unlikely]] {
  ------------------
  |  Branch (691:26): [True: 512, False: 1.48k]
  |  Branch (691:49): [True: 6, False: 506]
  ------------------
  692|      6|                        ctx.error = error_code::syntax_error;
  693|      6|                        return;
  694|      6|                     }
  695|  1.99k|                     if (codepoint <= 0x10FFFF) {
  ------------------
  |  Branch (695:26): [True: 1.69k, False: 296]
  ------------------
  696|  1.69k|                        dst += code_point_to_utf8(codepoint, dst);
  697|  1.69k|                     }
  698|  1.99k|                     break;
  699|  1.99k|                  }
  700|    306|                  case 'N': {
  ------------------
  |  Branch (700:19): [True: 306, False: 8.02k]
  ------------------
  701|       |                     // Next line U+0085
  702|    306|                     dst += code_point_to_utf8(0x0085, dst);
  703|    306|                     break;
  704|  1.99k|                  }
  705|    190|                  case '_': {
  ------------------
  |  Branch (705:19): [True: 190, False: 8.14k]
  ------------------
  706|       |                     // Non-breaking space U+00A0
  707|    190|                     dst += code_point_to_utf8(0x00A0, dst);
  708|    190|                     break;
  709|  1.99k|                  }
  710|    956|                  case 'L': {
  ------------------
  |  Branch (710:19): [True: 956, False: 7.37k]
  ------------------
  711|       |                     // Line separator U+2028
  712|    956|                     dst += code_point_to_utf8(0x2028, dst);
  713|    956|                     break;
  714|  1.99k|                  }
  715|  2.75k|                  case 'P': {
  ------------------
  |  Branch (715:19): [True: 2.75k, False: 5.57k]
  ------------------
  716|       |                     // Paragraph separator U+2029
  717|  2.75k|                     dst += code_point_to_utf8(0x2029, dst);
  718|  2.75k|                     break;
  719|  1.99k|                  }
  720|      0|                  default:
  ------------------
  |  Branch (720:19): [True: 0, False: 8.33k]
  ------------------
  721|      0|                     break;
  722|  8.33k|                  }
  723|  8.33k|               }
  724|  25.3k|               else {
  725|       |                  // Preserve unknown escapes for compatibility, but reject a subset that
  726|       |                  // YAML test-suite marks as malformed in double-quoted scalars.
  727|  25.3k|                  if (esc == '.' || esc == '\'') {
  ------------------
  |  Branch (727:23): [True: 34, False: 25.3k]
  |  Branch (727:37): [True: 10, False: 25.3k]
  ------------------
  728|     44|                     ctx.error = error_code::syntax_error;
  729|     44|                     return;
  730|     44|                  }
  731|  25.3k|                  *dst++ = '\\';
  732|  25.3k|                  *dst++ = static_cast<char>(esc);
  733|  25.3k|                  ++src;
  734|  25.3k|               }
  735|       |               // All escape-produced characters are content, not trimmable
  736|  80.7k|               last_non_trimmable = dst;
  737|  80.7k|            }
  738|  38.4M|            else {
  739|  38.4M|               const char ch = *src++;
  740|  38.4M|               *dst++ = ch;
  741|       |               // Only update non-trimmable for non-whitespace literal characters
  742|  38.4M|               if (ch != ' ' && ch != '\t') {
  ------------------
  |  Branch (742:20): [True: 38.1M, False: 291k]
  |  Branch (742:33): [True: 38.0M, False: 55.5k]
  ------------------
  743|  38.0M|                  last_non_trimmable = dst;
  744|  38.0M|               }
  745|  38.4M|            }
  746|  38.5M|         }
  747|       |
  748|       |         // Resize to actual length
  749|  1.49M|         value.resize(static_cast<size_t>(dst - dst_start));
  750|  1.49M|         ++it; // skip closing quote
  751|  1.49M|      }
_ZN3glz4yaml26parse_single_quoted_stringINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_:
  758|  33.7k|      {
  759|  33.7k|         static constexpr size_t string_padding_bytes = 8;
  760|       |
  761|  33.7k|         if (it == end || *it != '\'') [[unlikely]] {
  ------------------
  |  Branch (761:14): [True: 0, False: 33.7k]
  |  Branch (761:27): [True: 0, False: 33.7k]
  ------------------
  762|      0|            ctx.error = error_code::expected_quote;
  763|      0|            return;
  764|      0|         }
  765|       |
  766|  33.7k|         ++it; // skip opening quote
  767|  33.7k|         auto start = it;
  768|       |
  769|       |         // Pass 1: Find closing quote (handling '' escapes)
  770|  8.06M|         while (it != end) {
  ------------------
  |  Branch (770:17): [True: 8.06M, False: 378]
  ------------------
  771|  8.06M|            if (*it == '\'') {
  ------------------
  |  Branch (771:17): [True: 36.8k, False: 8.02M]
  ------------------
  772|  36.8k|               if ((it + 1) != end && *(it + 1) == '\'') {
  ------------------
  |  Branch (772:20): [True: 29.6k, False: 7.17k]
  |  Branch (772:39): [True: 3.87k, False: 25.7k]
  ------------------
  773|  3.87k|                  it += 2; // Skip escaped quote
  774|  3.87k|               }
  775|  32.9k|               else {
  776|  32.9k|                  break; // Found closing quote
  777|  32.9k|               }
  778|  36.8k|            }
  779|  8.02M|            else {
  780|  8.02M|               if (forbidden_control_table[uint8_t(*it)]) [[unlikely]] {
  ------------------
  |  Branch (780:20): [True: 472, False: 8.02M]
  ------------------
  781|    472|                  ctx.error = error_code::invalid_control_character;
  782|    472|                  return;
  783|    472|               }
  784|  8.02M|               ++it;
  785|  8.02M|            }
  786|  8.06M|         }
  787|       |
  788|  33.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (788:14): [True: 378, False: 32.9k]
  ------------------
  789|    378|            ctx.error = error_code::unexpected_end;
  790|    378|            return;
  791|    378|         }
  792|       |
  793|  32.9k|         const auto input_len = static_cast<size_t>(it - start);
  794|  32.9k|         value.resize(input_len + string_padding_bytes);
  795|  32.9k|         auto* dst = value.data();
  796|  32.9k|         auto* const dst_start = dst;
  797|  32.9k|         auto src = start;
  798|  32.9k|         const auto* const src_end = &*it;
  799|       |
  800|       |         // Pass 2: Process content with line folding and '' escapes
  801|  7.78M|         while (src < src_end) {
  ------------------
  |  Branch (801:17): [True: 7.74M, False: 32.6k]
  ------------------
  802|       |            // Check for newline - needs line folding
  803|  7.74M|            if (*src == '\n' || *src == '\r') {
  ------------------
  |  Branch (803:17): [True: 80.8k, False: 7.66M]
  |  Branch (803:33): [True: 30.6k, False: 7.63M]
  ------------------
  804|       |               // Trim trailing whitespace from output before processing newline
  805|   126k|               while (dst > dst_start && (*(dst - 1) == ' ' || *(dst - 1) == '\t')) {
  ------------------
  |  Branch (805:23): [True: 124k, False: 1.03k]
  |  Branch (805:43): [True: 11.9k, False: 113k]
  |  Branch (805:64): [True: 2.52k, False: 110k]
  ------------------
  806|  14.4k|                  --dst;
  807|  14.4k|               }
  808|       |
  809|       |               // Skip the newline
  810|   111k|               if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (810:20): [True: 30.6k, False: 80.8k]
  |  Branch (810:36): [True: 29.5k, False: 1.16k]
  |  Branch (810:59): [True: 752, False: 28.7k]
  ------------------
  811|    752|                  src += 2; // CRLF
  812|    752|               }
  813|   110k|               else {
  814|   110k|                  ++src;
  815|   110k|               }
  816|       |
  817|       |               // Skip leading indentation on the next line.
  818|   111k|               int indent_count = 0;
  819|   111k|               if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (819:20): [True: 38, False: 111k]
  ------------------
  820|   111k|               if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (820:20): [True: 102k, False: 9.45k]
  |  Branch (820:41): [True: 76, False: 102k]
  ------------------
  821|     76|                  ctx.error = error_code::syntax_error;
  822|     76|                  return;
  823|     76|               }
  824|       |
  825|       |               // Check if this is a blank line (another newline follows)
  826|   111k|               if (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (826:20): [True: 108k, False: 3.32k]
  |  Branch (826:38): [True: 44.9k, False: 63.1k]
  |  Branch (826:54): [True: 18.8k, False: 44.3k]
  ------------------
  827|       |                  // Blank line(s) - output newlines for each blank line
  828|   180k|                  while (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (828:26): [True: 177k, False: 2.58k]
  |  Branch (828:44): [True: 73.0k, False: 104k]
  |  Branch (828:60): [True: 43.4k, False: 61.0k]
  ------------------
  829|   116k|                     *dst++ = '\n';
  830|       |                     // Skip the newline
  831|   116k|                     if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (831:26): [True: 43.4k, False: 73.0k]
  |  Branch (831:42): [True: 41.2k, False: 2.15k]
  |  Branch (831:65): [True: 1.63k, False: 39.6k]
  ------------------
  832|  1.63k|                        src += 2; // CRLF
  833|  1.63k|                     }
  834|   114k|                     else {
  835|   114k|                        ++src;
  836|   114k|                     }
  837|   116k|                     int blank_indent_count = 0;
  838|   116k|                     if (!yaml::skip_folded_line_indent(src, src_end, ctx, &blank_indent_count)) return;
  ------------------
  |  Branch (838:26): [True: 64, False: 116k]
  ------------------
  839|   116k|                     if (blank_indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (839:26): [True: 112k, False: 4.03k]
  |  Branch (839:53): [True: 88, False: 112k]
  ------------------
  840|     88|                        ctx.error = error_code::syntax_error;
  841|     88|                        return;
  842|     88|                     }
  843|   116k|                  }
  844|       |                  // Don't add space - we're now at content after blank line(s)
  845|  63.7k|               }
  846|  47.6k|               else {
  847|       |                  // Single newline - fold to space
  848|  47.6k|                  *dst++ = ' ';
  849|  47.6k|               }
  850|   111k|               continue;
  851|   111k|            }
  852|       |
  853|  7.63M|            if (*src == '\'') {
  ------------------
  |  Branch (853:17): [True: 3.27k, False: 7.63M]
  ------------------
  854|       |               // Must be '' (escaped quote) - we validated this in pass 1
  855|  3.27k|               *dst++ = '\'';
  856|  3.27k|               src += 2;
  857|  3.27k|            }
  858|  7.63M|            else {
  859|  7.63M|               *dst++ = *src++;
  860|  7.63M|            }
  861|  7.63M|         }
  862|       |
  863|  32.6k|         value.resize(static_cast<size_t>(dst - dst_start));
  864|  32.6k|         ++it; // skip closing quote
  865|  32.6k|      }
_ZN3glz4yaml18parse_block_scalarINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_i:
 1362|  55.4k|      {
 1363|  55.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (1363:14): [True: 0, False: 55.4k]
  ------------------
 1364|      0|            ctx.error = error_code::unexpected_end;
 1365|      0|            return;
 1366|      0|         }
 1367|       |
 1368|  55.4k|         const char indicator = *it;
 1369|  55.4k|         ++it;
 1370|  55.4k|         const auto header_start = it;
 1371|       |
 1372|       |         // Chomping indicator: - (strip), + (keep), or none (clip)
 1373|  55.4k|         char chomping = ' '; // default: clip
 1374|  55.4k|         int explicit_indent = 0;
 1375|  55.4k|         bool seen_chomping = false;
 1376|  55.4k|         bool seen_indent = false;
 1377|       |
 1378|  86.0k|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1378:17): [True: 82.9k, False: 3.06k]
  |  Branch (1378:30): [True: 55.2k, False: 27.7k]
  |  Branch (1378:45): [True: 40.9k, False: 14.3k]
  ------------------
 1379|  40.9k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (1379:17): [True: 6.38k, False: 34.5k]
  |  Branch (1379:31): [True: 4.01k, False: 30.5k]
  ------------------
 1380|  10.3k|               if (seen_chomping) {
  ------------------
  |  Branch (1380:20): [True: 10, False: 10.3k]
  ------------------
 1381|     10|                  ctx.error = error_code::syntax_error;
 1382|     10|                  return;
 1383|     10|               }
 1384|  10.3k|               seen_chomping = true;
 1385|  10.3k|               chomping = *it;
 1386|  10.3k|            }
 1387|  30.5k|            else if (*it >= '1' && *it <= '9') {
  ------------------
  |  Branch (1387:22): [True: 1.88k, False: 28.6k]
  |  Branch (1387:36): [True: 1.77k, False: 108]
  ------------------
 1388|  1.77k|               if (seen_indent) {
  ------------------
  |  Branch (1388:20): [True: 6, False: 1.76k]
  ------------------
 1389|       |                  // YAML indentation indicator is a single digit [1-9].
 1390|      6|                  ctx.error = error_code::syntax_error;
 1391|      6|                  return;
 1392|      6|               }
 1393|  1.76k|               seen_indent = true;
 1394|  1.76k|               explicit_indent = *it - '0';
 1395|  1.76k|            }
 1396|  28.7k|            else if (*it == '0') {
  ------------------
  |  Branch (1396:22): [True: 16, False: 28.7k]
  ------------------
 1397|       |               // Indentation indicator 0 is invalid by spec.
 1398|     16|               ctx.error = error_code::syntax_error;
 1399|     16|               return;
 1400|     16|            }
 1401|  28.7k|            else if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (1401:22): [True: 17.4k, False: 11.2k]
  |  Branch (1401:36): [True: 950, False: 10.3k]
  ------------------
 1402|       |               // Skip whitespace
 1403|  18.4k|            }
 1404|  10.3k|            else if (*it == '#') {
  ------------------
  |  Branch (1404:22): [True: 9.69k, False: 606]
  ------------------
 1405|       |               // Block scalar comments require separation whitespace.
 1406|  9.69k|               if (it == header_start || (*(it - 1) != ' ' && *(it - 1) != '\t')) {
  ------------------
  |  Branch (1406:20): [True: 8, False: 9.68k]
  |  Branch (1406:43): [True: 276, False: 9.41k]
  |  Branch (1406:63): [True: 10, False: 266]
  ------------------
 1407|     18|                  ctx.error = error_code::syntax_error;
 1408|     18|                  return;
 1409|     18|               }
 1410|       |               // Skip comment
 1411|   264k|               while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1411:23): [True: 264k, False: 516]
  |  Branch (1411:36): [True: 260k, False: 3.59k]
  |  Branch (1411:51): [True: 255k, False: 5.56k]
  ------------------
 1412|   255k|                  ++it;
 1413|   255k|               }
 1414|  9.67k|               break;
 1415|  9.69k|            }
 1416|    606|            else {
 1417|    606|               ctx.error = error_code::syntax_error;
 1418|    606|               return;
 1419|    606|            }
 1420|  30.5k|            ++it;
 1421|  30.5k|         }
 1422|       |
 1423|       |         // Skip newline after indicator
 1424|  54.8k|         if (!skip_newline(it, end)) {
  ------------------
  |  Branch (1424:14): [True: 3.58k, False: 51.2k]
  ------------------
 1425|       |            // Empty block scalar
 1426|  3.58k|            value.clear();
 1427|  3.58k|            return;
 1428|  3.58k|         }
 1429|       |
 1430|  51.2k|         value.clear();
 1431|       |
 1432|       |         // Determine content indentation
 1433|  51.2k|         int32_t content_indent = -1;
 1434|  51.2k|         int32_t leading_blank_indent_max = -1;
 1435|  51.2k|         bool first_line = true;
 1436|  51.2k|         bool previous_line_starts_with_tab = false;
 1437|  51.2k|         bool previous_line_more_indented = false;
 1438|  51.2k|         std::string trailing_newlines;
 1439|       |
 1440|  9.11M|         while (it != end) {
  ------------------
  |  Branch (1440:17): [True: 9.08M, False: 24.1k]
  ------------------
 1441|  9.08M|            auto line_start = it;
 1442|  9.08M|            int32_t line_indent = measure_indent<false>(it, end, ctx);
 1443|  9.08M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1443:17): [True: 18, False: 9.08M]
  ------------------
 1444|     18|               return;
 1445|       |
 1446|       |            // Check for blank line
 1447|  9.08M|            if (it == end || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (1447:17): [True: 282, False: 9.08M]
  |  Branch (1447:30): [True: 503k, False: 8.58M]
  |  Branch (1447:45): [True: 8.38M, False: 198k]
  ------------------
 1448|       |               // In literal mode, a line with more spaces than content_indent
 1449|       |               // has whitespace content that must be preserved.
 1450|  8.88M|               if (content_indent >= 0 && line_indent > content_indent && indicator == '|') {
  ------------------
  |  Branch (1450:20): [True: 8.41M, False: 477k]
  |  Branch (1450:43): [True: 3.44k, False: 8.40M]
  |  Branch (1450:75): [True: 1.53k, False: 1.90k]
  ------------------
 1451|  1.53k|                  it = line_start;
 1452|  2.18k|                  for (int32_t i = 0; i < content_indent && it != end && *it == ' '; ++i) {
  ------------------
  |  Branch (1452:39): [True: 650, False: 1.53k]
  |  Branch (1452:61): [True: 650, False: 0]
  |  Branch (1452:74): [True: 650, False: 0]
  ------------------
 1453|    650|                     ++it;
 1454|    650|                  }
 1455|       |                  // Fall through to content processing below
 1456|  1.53k|               }
 1457|  8.88M|               else {
 1458|  8.88M|                  if (content_indent < 0) {
  ------------------
  |  Branch (1458:23): [True: 477k, False: 8.41M]
  ------------------
 1459|   477k|                     leading_blank_indent_max = (std::max)(leading_blank_indent_max, line_indent);
 1460|   477k|                  }
 1461|  8.88M|                  trailing_newlines.push_back('\n');
 1462|  8.88M|                  skip_newline(it, end);
 1463|  8.88M|                  continue;
 1464|  8.88M|               }
 1465|  8.88M|            }
 1466|       |
 1467|       |            // Top-level zero-indented block scalars must stop at document boundary markers.
 1468|   199k|            if (base_indent < 0 && line_indent == 0 && (at_document_start(it, end) || at_document_end(it, end))) {
  ------------------
  |  Branch (1468:17): [True: 180k, False: 19.2k]
  |  Branch (1468:36): [True: 167k, False: 13.2k]
  |  Branch (1468:57): [True: 4.41k, False: 162k]
  |  Branch (1468:87): [True: 1.08k, False: 161k]
  ------------------
 1469|  5.49k|               it = line_start;
 1470|  5.49k|               break;
 1471|  5.49k|            }
 1472|       |
 1473|       |            // First content line determines indentation
 1474|   194k|            if (content_indent < 0) {
  ------------------
  |  Branch (1474:17): [True: 35.2k, False: 158k]
  ------------------
 1475|  35.2k|               if (explicit_indent > 0) {
  ------------------
  |  Branch (1475:20): [True: 696, False: 34.5k]
  ------------------
 1476|    696|                  content_indent = base_indent + explicit_indent;
 1477|    696|               }
 1478|  34.5k|               else {
 1479|  34.5k|                  content_indent = line_indent;
 1480|  34.5k|               }
 1481|       |
 1482|  35.2k|               if (content_indent <= base_indent) {
  ------------------
  |  Branch (1482:20): [True: 16.9k, False: 18.2k]
  ------------------
 1483|  16.9k|                  it = line_start;
 1484|  16.9k|                  break;
 1485|  16.9k|               }
 1486|  18.2k|               if (leading_blank_indent_max > content_indent) {
  ------------------
  |  Branch (1486:20): [True: 48, False: 18.2k]
  ------------------
 1487|     48|                  ctx.error = error_code::syntax_error;
 1488|     48|                  return;
 1489|     48|               }
 1490|  18.2k|            }
 1491|       |
 1492|       |            // Check if we've dedented
 1493|   177k|            if (line_indent < content_indent) {
  ------------------
  |  Branch (1493:17): [True: 3.95k, False: 173k]
  ------------------
 1494|  3.95k|               it = line_start;
 1495|  3.95k|               break;
 1496|  3.95k|            }
 1497|       |
 1498|       |            // Skip to content_indent level
 1499|   173k|            it = line_start;
 1500|   921k|            for (int32_t i = 0; i < content_indent && it != end && *it == ' '; ++i) {
  ------------------
  |  Branch (1500:33): [True: 747k, False: 173k]
  |  Branch (1500:55): [True: 747k, False: 0]
  |  Branch (1500:68): [True: 747k, False: 0]
  ------------------
 1501|   747k|               ++it;
 1502|   747k|            }
 1503|       |
 1504|   173k|            const bool current_line_starts_with_tab = (it != end && *it == '\t');
  ------------------
  |  Branch (1504:56): [True: 173k, False: 0]
  |  Branch (1504:69): [True: 976, False: 172k]
  ------------------
 1505|   173k|            const bool current_line_more_indented = (line_indent > content_indent);
 1506|       |
 1507|       |            // Add previous newlines
 1508|   173k|            if (first_line) {
  ------------------
  |  Branch (1508:17): [True: 17.5k, False: 155k]
  ------------------
 1509|       |               // Leading blank lines are part of block scalar content
 1510|  17.5k|               value += trailing_newlines;
 1511|  17.5k|            }
 1512|   155k|            else {
 1513|   155k|               if (indicator == '|') {
  ------------------
  |  Branch (1513:20): [True: 107k, False: 48.4k]
  ------------------
 1514|       |                  // Literal: preserve newlines
 1515|   107k|                  value += trailing_newlines;
 1516|   107k|               }
 1517|  48.4k|               else {
 1518|       |                  // Folded: single newline becomes space, paragraph breaks keep one newline.
 1519|       |                  // Folding does not apply adjacent to "more indented" or tab-leading lines.
 1520|  48.4k|                  const size_t break_count = trailing_newlines.size();
 1521|  48.4k|                  const bool adjacent_special = previous_line_starts_with_tab || current_line_starts_with_tab ||
  ------------------
  |  Branch (1521:49): [True: 440, False: 48.0k]
  |  Branch (1521:82): [True: 510, False: 47.5k]
  ------------------
 1522|  47.5k|                                                previous_line_more_indented || current_line_more_indented;
  ------------------
  |  Branch (1522:49): [True: 2.23k, False: 45.3k]
  |  Branch (1522:80): [True: 2.88k, False: 42.4k]
  ------------------
 1523|  48.4k|                  if (break_count == 1) {
  ------------------
  |  Branch (1523:23): [True: 31.4k, False: 17.0k]
  ------------------
 1524|  31.4k|                     if (adjacent_special) {
  ------------------
  |  Branch (1524:26): [True: 5.11k, False: 26.3k]
  ------------------
 1525|  5.11k|                        value.push_back('\n');
 1526|  5.11k|                     }
 1527|  26.3k|                     else {
 1528|  26.3k|                        value.push_back(' ');
 1529|  26.3k|                     }
 1530|  31.4k|                  }
 1531|  17.0k|                  else if (break_count > 1) {
  ------------------
  |  Branch (1531:28): [True: 17.0k, False: 0]
  ------------------
 1532|  17.0k|                     const size_t preserve_count = adjacent_special ? break_count : (break_count - 1);
  ------------------
  |  Branch (1532:52): [True: 946, False: 16.1k]
  ------------------
 1533|  17.0k|                     value.append(preserve_count, '\n');
 1534|  17.0k|                  }
 1535|  48.4k|               }
 1536|   155k|            }
 1537|   173k|            trailing_newlines.clear();
 1538|   173k|            first_line = false;
 1539|   173k|            previous_line_starts_with_tab = current_line_starts_with_tab;
 1540|   173k|            previous_line_more_indented = current_line_more_indented;
 1541|       |
 1542|       |            // Read line content
 1543|  1.99M|            while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1543:20): [True: 1.99M, False: 3.61k]
  |  Branch (1543:33): [True: 1.86M, False: 127k]
  |  Branch (1543:48): [True: 1.82M, False: 41.9k]
  ------------------
 1544|  1.82M|               if (forbidden_control_table[uint8_t(*it)]) [[unlikely]] {
  ------------------
  |  Branch (1544:20): [True: 598, False: 1.82M]
  ------------------
 1545|       |                  // Block scalars have no escape mechanism, so the byte cannot be valid here.
 1546|    598|                  ctx.error = error_code::invalid_control_character;
 1547|    598|                  return;
 1548|    598|               }
 1549|  1.82M|               value.push_back(*it);
 1550|  1.82M|               ++it;
 1551|  1.82M|            }
 1552|       |
 1553|   172k|            trailing_newlines.push_back('\n');
 1554|   172k|            skip_newline(it, end);
 1555|   172k|         }
 1556|       |
 1557|       |         // Apply chomping
 1558|  50.5k|         if (chomping == '-') {
  ------------------
  |  Branch (1558:14): [True: 6.30k, False: 44.2k]
  ------------------
 1559|       |            // Strip: remove all trailing newlines
 1560|  6.30k|         }
 1561|  44.2k|         else if (chomping == '+') {
  ------------------
  |  Branch (1561:19): [True: 3.94k, False: 40.3k]
  ------------------
 1562|       |            // Keep: preserve all trailing newlines
 1563|  3.94k|            value += trailing_newlines;
 1564|  3.94k|         }
 1565|  40.3k|         else {
 1566|       |            // Clip: single trailing newline
 1567|  40.3k|            if (!value.empty()) {
  ------------------
  |  Branch (1567:17): [True: 12.9k, False: 27.3k]
  ------------------
 1568|  12.9k|               value.push_back('\n');
 1569|  12.9k|            }
 1570|  40.3k|         }
 1571|  50.5k|      }
_ZN3glz4yaml18parse_plain_scalarINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_b:
 1019|  2.71M|      {
 1020|  2.71M|         value.clear();
 1021|       |
 1022|  23.1M|         while (it != end) {
  ------------------
  |  Branch (1022:17): [True: 23.1M, False: 28.0k]
  ------------------
 1023|       |            // Copy the run of ordinary content in bulk. Only a byte the table marks
 1024|       |            // needs the dispatch below, so the control-character rejection rides on a
 1025|       |            // lookup the scan already performs rather than costing a test per byte.
 1026|  23.1M|            {
 1027|  23.1M|               const auto run_start = it;
 1028|   102M|               while (it != end && !plain_scalar_dispatch_table[uint8_t(*it)]) {
  ------------------
  |  Branch (1028:23): [True: 102M, False: 343k]
  |  Branch (1028:36): [True: 79.4M, False: 22.7M]
  ------------------
 1029|  79.4M|                  ++it;
 1030|  79.4M|               }
 1031|  23.1M|               if (it != run_start) {
  ------------------
  |  Branch (1031:20): [True: 21.8M, False: 1.23M]
  ------------------
 1032|  21.8M|                  value.append(run_start, it);
 1033|  21.8M|               }
 1034|  23.1M|               if (it == end) break;
  ------------------
  |  Branch (1034:20): [True: 343k, False: 22.7M]
  ------------------
 1035|  23.1M|            }
 1036|       |
 1037|  22.7M|            const char c = *it;
 1038|       |
 1039|       |            // YAML's character stream excludes these outright, so reject rather than
 1040|       |            // carry the byte into the value.
 1041|  22.7M|            if (forbidden_control_table[uint8_t(c)]) [[unlikely]] {
  ------------------
  |  Branch (1041:17): [True: 10.9k, False: 22.7M]
  ------------------
 1042|  10.9k|               ctx.error = error_code::invalid_control_character;
 1043|  10.9k|               return;
 1044|  10.9k|            }
 1045|       |
 1046|       |            // End conditions
 1047|  22.7M|            if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1047:17): [True: 605k, False: 22.1M]
  |  Branch (1047:30): [True: 770k, False: 21.3M]
  ------------------
 1048|  1.37M|               if (in_flow) {
  ------------------
  |  Branch (1048:20): [True: 1.30M, False: 71.6k]
  ------------------
 1049|  1.30M|                  auto continuation = it;
 1050|  1.30M|                  skip_newline(continuation, end);
 1051|  1.30M|                  bool continuation_is_comment = false;
 1052|       |
 1053|  1.30M|                  while (continuation != end) {
  ------------------
  |  Branch (1053:26): [True: 1.21M, False: 86.2k]
  ------------------
 1054|  4.74M|                     while (continuation != end && (*continuation == ' ' || *continuation == '\t')) {
  ------------------
  |  Branch (1054:29): [True: 4.73M, False: 10.2k]
  |  Branch (1054:53): [True: 3.48M, False: 1.24M]
  |  Branch (1054:77): [True: 39.9k, False: 1.20M]
  ------------------
 1055|  3.52M|                        ++continuation;
 1056|  3.52M|                     }
 1057|  1.21M|                     if (continuation != end && *continuation == '#') {
  ------------------
  |  Branch (1057:26): [True: 1.20M, False: 10.2k]
  |  Branch (1057:49): [True: 77.9k, False: 1.13M]
  ------------------
 1058|       |                        // Comment lines terminate plain flow scalars; the caller
 1059|       |                        // will consume comments/separators outside this scalar.
 1060|  77.9k|                        continuation_is_comment = true;
 1061|  77.9k|                        break;
 1062|  77.9k|                     }
 1063|  1.14M|                     break;
 1064|  1.21M|                  }
 1065|       |
 1066|  1.30M|                  if (continuation_is_comment || continuation == end || *continuation == ',' || *continuation == ']' ||
  ------------------
  |  Branch (1066:23): [True: 77.9k, False: 1.22M]
  |  Branch (1066:50): [True: 96.4k, False: 1.13M]
  |  Branch (1066:73): [True: 221k, False: 908k]
  |  Branch (1066:97): [True: 3.77k, False: 904k]
  ------------------
 1067|   904k|                      *continuation == '}' || *continuation == ':') {
  ------------------
  |  Branch (1067:23): [True: 19.7k, False: 885k]
  |  Branch (1067:47): [True: 49.4k, False: 835k]
  ------------------
 1068|   468k|                     break;
 1069|   468k|                  }
 1070|       |
 1071|  1.35M|                  while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1071:26): [True: 1.31M, False: 37.0k]
  |  Branch (1071:45): [True: 481k, False: 835k]
  |  Branch (1071:68): [True: 36.8k, False: 798k]
  ------------------
 1072|   518k|                     value.pop_back();
 1073|   518k|                  }
 1074|   835k|                  if (!value.empty()) {
  ------------------
  |  Branch (1074:23): [True: 798k, False: 37.0k]
  ------------------
 1075|   798k|                     value.push_back(' ');
 1076|   798k|                  }
 1077|   835k|                  it = continuation;
 1078|   835k|                  continue;
 1079|  1.30M|               }
 1080|  71.6k|               break;
 1081|  1.37M|            }
 1082|       |
 1083|       |            // Per YAML spec: # only starts a comment when preceded by whitespace
 1084|       |            // "foo#bar" is a valid plain scalar, but "foo #bar" has a comment
 1085|  21.3M|            if (c == '#') {
  ------------------
  |  Branch (1085:17): [True: 989k, False: 20.3M]
  ------------------
 1086|       |               // Check if preceded by whitespace (comment indicator)
 1087|   989k|               if (value.empty() || value.back() == ' ' || value.back() == '\t') {
  ------------------
  |  Branch (1087:20): [True: 16.1k, False: 973k]
  |  Branch (1087:37): [True: 25.4k, False: 948k]
  |  Branch (1087:60): [True: 16.0k, False: 932k]
  ------------------
 1088|  57.6k|                  break; // This is a comment
 1089|  57.6k|               }
 1090|       |               // Otherwise # is part of the scalar value
 1091|   989k|            }
 1092|       |
 1093|       |            // Flow indicators end plain scalars in flow context
 1094|  21.3M|            if (in_flow && (c == ',' || c == ']' || c == '}')) break;
  ------------------
  |  Branch (1094:17): [True: 21.2M, False: 76.7k]
  |  Branch (1094:29): [True: 1.04M, False: 20.2M]
  |  Branch (1094:41): [True: 100k, False: 20.1M]
  |  Branch (1094:53): [True: 323k, False: 19.7M]
  ------------------
 1095|       |
 1096|       |            // Colon followed by space/newline ends plain scalar
 1097|  19.8M|            if (c == ':') {
  ------------------
  |  Branch (1097:17): [True: 18.9M, False: 944k]
  ------------------
 1098|  18.9M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (1098:20): [True: 27.8k, False: 18.8M]
  |  Branch (1098:39): [True: 160k, False: 18.7M]
  |  Branch (1098:59): [True: 15.5k, False: 18.7M]
  |  Branch (1098:80): [True: 17.5k, False: 18.6M]
  |  Branch (1098:101): [True: 24.0k, False: 18.6M]
  ------------------
 1099|   245k|                  break;
 1100|   245k|               }
 1101|  18.6M|               if (in_flow && (*(it + 1) == ',' || *(it + 1) == ']' || *(it + 1) == '}')) {
  ------------------
  |  Branch (1101:20): [True: 18.6M, False: 13.7k]
  |  Branch (1101:32): [True: 17.8k, False: 18.6M]
  |  Branch (1101:52): [True: 1.88k, False: 18.6M]
  |  Branch (1101:72): [True: 6.14k, False: 18.6M]
  ------------------
 1102|  25.8k|                  break;
 1103|  25.8k|               }
 1104|  18.6M|            }
 1105|       |
 1106|  19.5M|            value.push_back(c);
 1107|  19.5M|            ++it;
 1108|  19.5M|         }
 1109|       |
 1110|       |         // Trim trailing whitespace
 1111|  4.96M|         while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1111:17): [True: 4.51M, False: 445k]
  |  Branch (1111:36): [True: 1.98M, False: 2.53M]
  |  Branch (1111:59): [True: 273k, False: 2.26M]
  ------------------
 1112|  2.25M|            value.pop_back();
 1113|  2.25M|         }
 1114|       |
 1115|  2.70M|         if (in_flow && (value == "---" || value == "..." || value == "-")) {
  ------------------
  |  Branch (1115:14): [True: 2.46M, False: 245k]
  |  Branch (1115:26): [True: 20, False: 2.46M]
  |  Branch (1115:44): [True: 20, False: 2.46M]
  |  Branch (1115:62): [True: 22, False: 2.46M]
  ------------------
 1116|     62|            ctx.error = error_code::syntax_error;
 1117|     62|         }
 1118|  2.70M|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   840k|      {
 5284|   840k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   840k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   840k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   840k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   840k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 840k, False: 0]
  ------------------
 5294|   840k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   840k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2115|   842k|      {
 2116|   842k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 842k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|   842k|         yaml::node_preamble_state preamble{};
 2120|   842k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 5.53k, False: 837k]
  ------------------
 2121|   842k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   842k|                   return yaml::tag_valid_for_float(tag);
 2123|   842k|                }
 2124|   842k|                else {
 2125|   842k|                   return yaml::tag_valid_for_int(tag);
 2126|   842k|                }
 2127|   842k|             }))
 2128|  5.53k|            return;
 2129|       |
 2130|   837k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|   837k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|   837k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|   837k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 17.7k, False: 819k]
  ------------------
 2138|  17.7k|               ++it;
 2139|  17.7k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 16.0k, False: 1.69k]
  |  Branch (2139:38): [True: 635, False: 15.4k]
  |  Branch (2139:74): [True: 764, False: 14.6k]
  ------------------
 2140|  14.6k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 556, False: 14.1k]
  ------------------
 2141|  1.95k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  1.95k|                  it += 3;
 2143|  1.95k|                  finalize();
 2144|  1.95k|                  return;
 2145|  1.95k|               }
 2146|  15.8k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 14.1k, False: 1.69k]
  |  Branch (2146:38): [True: 408, False: 13.7k]
  |  Branch (2146:74): [True: 287, False: 13.4k]
  ------------------
 2147|  13.4k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 1.01k, False: 12.4k]
  ------------------
 2148|  1.71k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  1.71k|                  it += 3;
 2150|  1.71k|                  finalize();
 2151|  1.71k|                  return;
 2152|  1.71k|               }
 2153|  14.1k|               it = start;
 2154|  14.1k|            }
 2155|       |
 2156|   833k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 3.03k, False: 830k]
  |  Branch (2156:31): [True: 10.7k, False: 819k]
  ------------------
 2157|  13.8k|               const char sign = *it;
 2158|  13.8k|               ++it;
 2159|  13.8k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 13.2k, False: 534]
  |  Branch (2159:33): [True: 2.69k, False: 10.5k]
  ------------------
 2160|  2.69k|                  ++it;
 2161|  2.69k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 2.45k, False: 236]
  |  Branch (2161:41): [True: 885, False: 1.57k]
  |  Branch (2161:77): [True: 320, False: 1.25k]
  ------------------
 2162|  1.62k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 420, False: 831]
  ------------------
 2163|  1.62k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 1.33k, False: 288]
  ------------------
 2164|  1.33k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  1.33k|                     }
 2166|    288|                     else {
 2167|    288|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|    288|                     }
 2169|  1.62k|                     it += 3;
 2170|  1.62k|                     finalize();
 2171|  1.62k|                     return;
 2172|  1.62k|                  }
 2173|  2.69k|               }
 2174|  12.1k|               it = start;
 2175|  12.1k|            }
 2176|   833k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|   832k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  16.8M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 16.8M, False: 7.96k]
  ------------------
 2183|  16.8M|            const char c = *it;
 2184|  16.8M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 14.5k, False: 16.8M]
  |  Branch (2184:29): [True: 6.35k, False: 16.8M]
  |  Branch (2184:42): [True: 7.74k, False: 16.8M]
  |  Branch (2184:55): [True: 2.01k, False: 16.8M]
  |  Branch (2184:68): [True: 780k, False: 16.0M]
  |  Branch (2184:80): [True: 1.08k, False: 16.0M]
  |  Branch (2184:92): [True: 1.46k, False: 16.0M]
  |  Branch (2184:104): [True: 9.59k, False: 16.0M]
  ------------------
 2185|   823k|               break;
 2186|   823k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  16.0M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 298k, False: 15.7M]
  ------------------
 2189|   298k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 621, False: 297k]
  |  Branch (2189:39): [True: 2.85k, False: 294k]
  |  Branch (2189:59): [True: 333, False: 294k]
  |  Branch (2189:80): [True: 579, False: 293k]
  |  Branch (2189:101): [True: 1.43k, False: 292k]
  ------------------
 2190|  5.82k|                  break;
 2191|  5.82k|               }
 2192|   298k|            }
 2193|  16.0M|            ++it;
 2194|  16.0M|         }
 2195|       |
 2196|   837k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|   837k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 1.10k, False: 836k]
  ------------------
 2199|  1.10k|            ctx.error = error_code::parse_number_failure;
 2200|  1.10k|            return;
 2201|  1.10k|         }
 2202|       |
 2203|       |         // Handle hex, octal, binary
 2204|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2205|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2206|       |               int base = 10;
 2207|       |               size_t offset = 0;
 2208|       |
 2209|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2210|       |                  base = 16;
 2211|       |                  offset = 2;
 2212|       |               }
 2213|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2214|       |                  base = 8;
 2215|       |                  offset = 2;
 2216|       |               }
 2217|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2218|       |                  base = 2;
 2219|       |                  offset = 2;
 2220|       |               }
 2221|       |
 2222|       |               if (base != 10) {
 2223|       |                  const auto digits = num_str.substr(offset);
 2224|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2225|       |
 2226|       |                  std::string clean_storage;
 2227|       |                  std::string_view clean_view;
 2228|       |
 2229|       |                  if (has_underscores) {
 2230|       |                     clean_storage.reserve(digits.size());
 2231|       |                     for (char c : digits) {
 2232|       |                        if (c != '_') {
 2233|       |                           clean_storage.push_back(c);
 2234|       |                        }
 2235|       |                     }
 2236|       |                     clean_view = clean_storage;
 2237|       |                  }
 2238|       |                  else {
 2239|       |                     clean_view = digits;
 2240|       |                  }
 2241|       |
 2242|       |                  auto [ptr, ec] =
 2243|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2244|       |                  if (ec != std::errc{}) {
 2245|       |                     ctx.error = error_code::parse_number_failure;
 2246|       |                  }
 2247|       |                  finalize();
 2248|       |                  return;
 2249|       |               }
 2250|       |            }
 2251|       |         }
 2252|   836k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|   836k|            bool negative = false;
 2254|   836k|            std::string_view digits = num_str;
 2255|       |
 2256|   836k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 830k, False: 5.29k]
  |  Branch (2256:37): [True: 10.4k, False: 820k]
  |  Branch (2256:62): [True: 1.69k, False: 818k]
  ------------------
 2257|  12.1k|               negative = (digits.front() == '-');
 2258|  12.1k|               digits.remove_prefix(1);
 2259|  12.1k|            }
 2260|       |
 2261|   836k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 113k, False: 722k]
  |  Branch (2261:38): [True: 15.1k, False: 98.6k]
  ------------------
 2262|  15.1k|               int base = 10;
 2263|  15.1k|               size_t offset = 0;
 2264|       |
 2265|  15.1k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 1.72k, False: 13.4k]
  |  Branch (2265:40): [True: 579, False: 12.8k]
  ------------------
 2266|  2.30k|                  base = 16;
 2267|  2.30k|                  offset = 2;
 2268|  2.30k|               }
 2269|  12.8k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 891, False: 11.9k]
  |  Branch (2269:45): [True: 911, False: 11.0k]
  ------------------
 2270|  1.80k|                  base = 8;
 2271|  1.80k|                  offset = 2;
 2272|  1.80k|               }
 2273|  11.0k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 449, False: 10.6k]
  |  Branch (2273:45): [True: 390, False: 10.2k]
  ------------------
 2274|    839|                  base = 2;
 2275|    839|                  offset = 2;
 2276|    839|               }
 2277|       |
 2278|  15.1k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 4.94k, False: 10.2k]
  ------------------
 2279|  4.94k|                  auto raw_digits = digits.substr(offset);
 2280|  4.94k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  4.94k|                  std::string clean_storage;
 2283|  4.94k|                  std::string_view clean_view;
 2284|  4.94k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 1.10k, False: 3.84k]
  ------------------
 2285|  1.10k|                     clean_storage.reserve(raw_digits.size());
 2286|  4.93M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 4.93M, False: 1.10k]
  ------------------
 2287|  4.93M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 4.93M, False: 2.66k]
  ------------------
 2288|  4.93M|                           clean_storage.push_back(c);
 2289|  4.93M|                        }
 2290|  4.93M|                     }
 2291|  1.10k|                     clean_view = clean_storage;
 2292|  1.10k|                  }
 2293|  3.84k|                  else {
 2294|  3.84k|                     clean_view = raw_digits;
 2295|  3.84k|                  }
 2296|       |
 2297|  4.94k|                  uint64_t parsed_int{};
 2298|  4.94k|                  auto [ptr, ec] =
 2299|  4.94k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  4.94k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 2.81k, False: 2.12k]
  |  Branch (2300:44): [True: 796, False: 1.33k]
  ------------------
 2301|  3.61k|                     ctx.error = error_code::parse_number_failure;
 2302|  3.61k|                     finalize();
 2303|  3.61k|                     return;
 2304|  3.61k|                  }
 2305|       |
 2306|  1.33k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  1.33k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 570, False: 761]
  ------------------
 2308|  1.33k|                  finalize();
 2309|  1.33k|                  return;
 2310|  4.94k|               }
 2311|  15.1k|            }
 2312|   836k|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|   831k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|   836k|         std::string clean_storage;
 2318|   836k|         std::string_view clean_view;
 2319|       |
 2320|   836k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 2.07k, False: 834k]
  ------------------
 2321|  2.07k|            clean_storage.reserve(num_str.size());
 2322|  6.17M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 6.17M, False: 2.07k]
  ------------------
 2323|  6.17M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 6.16M, False: 9.23k]
  ------------------
 2324|  6.16M|                  clean_storage.push_back(c);
 2325|  6.16M|               }
 2326|  6.17M|            }
 2327|  2.07k|            clean_view = clean_storage;
 2328|  2.07k|         }
 2329|   834k|         else {
 2330|   834k|            clean_view = num_str;
 2331|   834k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|   836k|         auto parse_view = clean_view;
 2336|   836k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 825k, False: 10.3k]
  |  Branch (2336:37): [True: 10.4k, False: 815k]
  ------------------
 2337|  10.4k|            parse_view.remove_prefix(1);
 2338|  10.4k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 6.11k, False: 4.37k]
  ------------------
 2339|  6.11k|               ctx.error = error_code::parse_number_failure;
 2340|  6.11k|               return;
 2341|  6.11k|            }
 2342|  10.4k|         }
 2343|       |
 2344|   830k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|   830k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2346|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2347|   830k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 28.1k, False: 801k]
  |  Branch (2347:45): [True: 29.6k, False: 772k]
  ------------------
 2348|  47.5k|               ctx.error = error_code::parse_number_failure;
 2349|  47.5k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|   830k|         finalize();
 2360|   830k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERdNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EdE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   842k|      {
  466|   842k|         skip_inline_ws(it, end);
  467|       |
  468|   842k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 364, False: 842k]
  ------------------
  469|    364|            if constexpr (!AllowEmptyInput) {
  470|    364|               ctx.error = error_code::unexpected_end;
  471|    364|            }
  472|    364|            return true;
  473|    364|         }
  474|       |
  475|   842k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   842k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 192, False: 842k]
  ------------------
  477|    192|            ctx.error = error_code::syntax_error;
  478|    192|            return true;
  479|    192|         }
  480|   842k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 139, False: 842k]
  ------------------
  481|    139|            ctx.error = error_code::syntax_error;
  482|    139|            return true;
  483|    139|         }
  484|       |
  485|   842k|         skip_inline_ws(it, end);
  486|       |
  487|   842k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 125, False: 842k]
  ------------------
  488|    125|            if constexpr (!AllowEmptyInput) {
  489|    125|               ctx.error = error_code::unexpected_end;
  490|    125|            }
  491|    125|            return true;
  492|    125|         }
  493|       |
  494|   842k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 4.71k, False: 837k]
  ------------------
  495|  4.71k|            return true;
  496|  4.71k|         }
  497|       |
  498|   837k|         return false;
  499|   842k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2120|   842k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|   842k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   842k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|   842k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   842k|      {
  409|   842k|         state.has_anchor = false;
  410|   842k|         state.anchor_name.clear();
  411|   842k|         state.anchor_start = nullptr;
  412|   842k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   842k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   842k|            else {
  421|   842k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 4.20k, False: 837k]
  ------------------
  422|   842k|            }
  423|   842k|         }
  424|       |
  425|   842k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 837k, False: 4.20k]
  |  Branch (425:27): [True: 3.59k, False: 834k]
  ------------------
  426|  3.59k|            ++it;
  427|  3.59k|            auto name = parse_anchor_name(it, end);
  428|  3.59k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 301, False: 3.29k]
  ------------------
  429|    301|               ctx.error = error_code::syntax_error;
  430|    301|               return true;
  431|    301|            }
  432|  3.29k|            skip_inline_ws(it, end);
  433|  3.29k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 209, False: 3.08k]
  ------------------
  434|    209|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    209|                  ctx.error = error_code::unexpected_end;
  436|    209|               }
  437|    209|               return true;
  438|    209|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  3.08k|            state.has_anchor = true;
  446|  3.08k|            state.anchor_name = std::string(name);
  447|  3.08k|            state.anchor_start = &*it;
  448|  3.08k|         }
  449|       |
  450|   841k|         return false;
  451|   842k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   842k|      {
  301|   842k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 842k]
  |  Branch (301:27): [True: 837k, False: 4.20k]
  ------------------
  302|       |
  303|  4.20k|         ++it; // skip '*'
  304|  4.20k|         auto name = parse_anchor_name(it, end);
  305|  4.20k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 295, False: 3.91k]
  ------------------
  306|    295|            ctx.error = error_code::syntax_error;
  307|    295|            return true;
  308|    295|         }
  309|       |
  310|  3.91k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.91k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 903, False: 3.01k]
  ------------------
  312|    903|            ctx.error = error_code::syntax_error; // undefined alias
  313|    903|            return true;
  314|    903|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  3.01k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.01k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 641, False: 2.37k]
  ------------------
  322|    641|            return true;
  323|    641|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  2.37k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 93, False: 2.27k]
  ------------------
  329|     93|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     93|            return true;
  331|     93|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  2.27k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.27k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 2.27k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  2.27k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 1, False: 2.27k]
  ------------------
  342|      1|            ctx.error = error_code::exceeded_max_expansion;
  343|      1|            ctx.custom_error_message = "alias expansion";
  344|      1|            return true;
  345|      1|         }
  346|       |
  347|  2.27k|         auto replay_it = span.begin;
  348|  2.27k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.27k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.27k|         ctx.indent_stack.clear();
  353|  2.27k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 601, False: 1.67k]
  ------------------
  354|    601|            ctx.push_indent(span.base_indent - 1);
  355|    601|         }
  356|       |
  357|  2.27k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.27k|         using V = std::remove_cvref_t<T>;
  360|  2.27k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.27k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.27k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.27k|         return true;
  367|  2.27k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|   830k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|  22.4k|      {
 5284|  22.4k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|  22.4k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|  22.4k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|  22.4k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|  22.4k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 22.4k, False: 0]
  ------------------
 5294|  22.4k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|  22.4k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2080|  27.3k|      {
 2081|  27.3k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 27.3k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  27.3k|         yaml::node_preamble_state preamble{};
 2085|  27.3k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 5.65k, False: 21.6k]
  ------------------
 2086|  27.3k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  5.65k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  21.6k|         std::string str;
 2091|  21.6k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  21.6k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 2.66k, False: 19.0k]
  |  Branch (2093:31): [True: 623, False: 18.3k]
  |  Branch (2093:48): [True: 840, False: 17.5k]
  |  Branch (2093:65): [True: 292, False: 17.2k]
  |  Branch (2093:81): [True: 795, False: 16.4k]
  |  Branch (2093:97): [True: 315, False: 16.1k]
  ------------------
 2094|  16.1k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 816, False: 15.3k]
  |  Branch (2094:29): [True: 655, False: 14.6k]
  |  Branch (2094:44): [True: 308, False: 14.3k]
  ------------------
 2095|  7.31k|            value = true;
 2096|  7.31k|         }
 2097|  14.3k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 4.75k, False: 9.61k]
  |  Branch (2097:37): [True: 837, False: 8.77k]
  |  Branch (2097:55): [True: 538, False: 8.23k]
  |  Branch (2097:73): [True: 281, False: 7.95k]
  |  Branch (2097:88): [True: 6.58k, False: 1.37k]
  |  Branch (2097:103): [True: 378, False: 993]
  ------------------
 2098|  14.2k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 279, False: 714]
  |  Branch (2098:35): [True: 175, False: 539]
  |  Branch (2098:51): [True: 402, False: 137]
  ------------------
 2099|  14.2k|            value = false;
 2100|  14.2k|         }
 2101|    137|         else {
 2102|    137|            ctx.error = error_code::expected_true_or_false;
 2103|    137|         }
 2104|       |
 2105|  21.6k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  21.6k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  27.3k|      {
  466|  27.3k|         skip_inline_ws(it, end);
  467|       |
  468|  27.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 7, False: 27.3k]
  ------------------
  469|      7|            if constexpr (!AllowEmptyInput) {
  470|      7|               ctx.error = error_code::unexpected_end;
  471|      7|            }
  472|      7|            return true;
  473|      7|         }
  474|       |
  475|  27.3k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  27.3k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 7, False: 27.3k]
  ------------------
  477|      7|            ctx.error = error_code::syntax_error;
  478|      7|            return true;
  479|      7|         }
  480|  27.3k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 27.3k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  27.3k|         skip_inline_ws(it, end);
  486|       |
  487|  27.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 27.3k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|  27.3k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.63k, False: 21.6k]
  ------------------
  495|  5.63k|            return true;
  496|  5.63k|         }
  497|       |
  498|  21.6k|         return false;
  499|  27.3k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2086|  27.3k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERbNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  27.3k|      {
  409|  27.3k|         state.has_anchor = false;
  410|  27.3k|         state.anchor_name.clear();
  411|  27.3k|         state.anchor_start = nullptr;
  412|  27.3k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  27.3k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  27.3k|            else {
  421|  27.3k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.61k, False: 21.6k]
  ------------------
  422|  27.3k|            }
  423|  27.3k|         }
  424|       |
  425|  27.3k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 21.6k, False: 5.61k]
  |  Branch (425:27): [True: 3.45k, False: 18.2k]
  ------------------
  426|  3.45k|            ++it;
  427|  3.45k|            auto name = parse_anchor_name(it, end);
  428|  3.45k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 3.44k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  3.44k|            skip_inline_ws(it, end);
  433|  3.44k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 17, False: 3.43k]
  ------------------
  434|     17|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     17|                  ctx.error = error_code::unexpected_end;
  436|     17|               }
  437|     17|               return true;
  438|     17|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  3.43k|            state.has_anchor = true;
  446|  3.43k|            state.anchor_name = std::string(name);
  447|  3.43k|            state.anchor_start = &*it;
  448|  3.43k|         }
  449|       |
  450|  27.2k|         return false;
  451|  27.3k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  27.3k|      {
  301|  27.3k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 27.3k]
  |  Branch (301:27): [True: 21.6k, False: 5.61k]
  ------------------
  302|       |
  303|  5.61k|         ++it; // skip '*'
  304|  5.61k|         auto name = parse_anchor_name(it, end);
  305|  5.61k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 9, False: 5.60k]
  ------------------
  306|      9|            ctx.error = error_code::syntax_error;
  307|      9|            return true;
  308|      9|         }
  309|       |
  310|  5.60k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.60k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 28, False: 5.57k]
  ------------------
  312|     28|            ctx.error = error_code::syntax_error; // undefined alias
  313|     28|            return true;
  314|     28|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  5.57k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.57k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 721, False: 4.85k]
  ------------------
  322|    721|            return true;
  323|    721|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  4.85k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 5, False: 4.85k]
  ------------------
  329|      5|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      5|            return true;
  331|      5|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  4.85k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.85k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 4.84k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  4.84k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.84k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  4.84k|         auto replay_it = span.begin;
  348|  4.84k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.84k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.84k|         ctx.indent_stack.clear();
  353|  4.84k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.62k, False: 3.22k]
  ------------------
  354|  1.62k|            ctx.push_indent(span.base_indent - 1);
  355|  1.62k|         }
  356|       |
  357|  4.84k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.84k|         using V = std::remove_cvref_t<T>;
  360|  4.84k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.84k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.84k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.84k|         return true;
  367|  4.84k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2466|  9.11k|      {
 2467|  9.11k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 9.11k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  9.11k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  9.11k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 6, False: 9.11k]
  ------------------
 2473|      6|            ctx.error = error_code::unexpected_end;
 2474|      6|            return;
 2475|      6|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  9.11k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 3.50k, False: 5.60k]
  ------------------
 2479|  3.50k|            ++it;
 2480|  3.50k|            return;
 2481|  3.50k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  5.60k|         auto start = it;
 2485|  25.6k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 25.0k, False: 584]
  |  Branch (2485:30): [True: 20.0k, False: 5.02k]
  ------------------
 2486|  20.0k|            ++it;
 2487|  20.0k|         }
 2488|       |
 2489|  5.60k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  5.60k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 28, False: 5.57k]
  ------------------
 2491|     28|            ctx.error = error_code::syntax_error;
 2492|     28|         }
 2493|  5.60k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   699k|      {
 5284|   699k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   699k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   699k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   699k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   699k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 699k, False: 0]
  ------------------
 5294|   699k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   699k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4593|   710k|      {
 4594|   710k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4594:14): [True: 0, False: 710k]
  ------------------
 4595|      0|            return;
 4596|       |
 4597|   710k|         yaml::node_preamble_state preamble{};
 4598|   710k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4598:14): [True: 13.0k, False: 697k]
  ------------------
 4599|   710k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4600|  13.0k|            return;
 4601|       |
 4602|   697k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4603|   697k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4604|       |
 4605|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4606|       |         // value of a key that existed before the read and adds new keys, while
 4607|       |         // pre-existing keys the document does not mention are preserved (like a
 4608|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4609|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4610|       |         // mappings disallow duplicate keys and the conformance suite expects
 4611|       |         // first-wins, which falls out of emplace into an empty map. Any
 4612|       |         // pre-existing entry the document leaves untouched is restored on scope
 4613|       |         // exit (including error paths). When the target starts empty (the common
 4614|       |         // case) this is a no-op with negligible cost.
 4615|   697k|         std::remove_cvref_t<T> preexisting_entries;
 4616|   697k|         if (!value.empty()) {
  ------------------
  |  Branch (4616:14): [True: 0, False: 697k]
  ------------------
 4617|      0|            preexisting_entries = std::move(value);
 4618|      0|            value.clear();
 4619|      0|         }
 4620|   697k|         struct merge_restore_guard
 4621|   697k|         {
 4622|   697k|            std::remove_cvref_t<T>& target;
 4623|   697k|            std::remove_cvref_t<T>& saved;
 4624|   697k|            ~merge_restore_guard()
 4625|   697k|            {
 4626|       |               // emplace is a no-op for keys the document already wrote, so only
 4627|       |               // untouched pre-existing entries are put back.
 4628|   697k|               for (auto& entry : saved) {
 4629|   697k|                  target.emplace(entry.first, std::move(entry.second));
 4630|   697k|               }
 4631|   697k|            }
 4632|   697k|         } merge_restore{value, preexisting_entries};
 4633|       |
 4634|   697k|         const bool treat_as_block_mapping =
 4635|   697k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4635:13): [Folded, False: 697k]
  |  Branch (4635:48): [True: 0, False: 0]
  |  Branch (4635:62): [True: 0, False: 0]
  ------------------
 4636|       |
 4637|   697k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4637:14): [True: 423k, False: 274k]
  |  Branch (4637:28): [True: 0, Folded]
  ------------------
 4638|       |            // Flow mapping
 4639|   423k|            ++it;
 4640|       |            // Skip whitespace and newlines after opening brace
 4641|   423k|            yaml::skip_ws_and_newlines(it, end);
 4642|       |
 4643|   423k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4643:17): [True: 422k, False: 702]
  |  Branch (4643:30): [True: 8.06k, False: 414k]
  ------------------
 4644|  8.06k|               ++it;
 4645|  8.06k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4646|  8.06k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4646:20): [True: 8, False: 8.05k]
  ------------------
 4647|      8|                  return;
 4648|  8.05k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4649|  8.05k|               return;
 4650|  8.06k|            }
 4651|       |
 4652|  1.38M|            while (it != end) {
  ------------------
  |  Branch (4652:20): [True: 1.38M, False: 2.56k]
  ------------------
 4653|       |               // Skip whitespace and newlines at start of each iteration
 4654|  1.38M|               yaml::skip_ws_and_newlines(it, end);
 4655|       |
 4656|  1.38M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4656:20): [True: 1.38M, False: 0]
  |  Branch (4656:33): [True: 10.7k, False: 1.37M]
  ------------------
 4657|  10.7k|                  ++it;
 4658|  10.7k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4659|  10.7k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4659:23): [True: 16, False: 10.7k]
  ------------------
 4660|     16|                     return;
 4661|  10.7k|                  break;
 4662|  10.7k|               }
 4663|       |
 4664|  1.37M|               bool explicit_flow_key = false;
 4665|  1.37M|               auto explicit_probe = it;
 4666|  1.37M|               yaml::skip_inline_ws(explicit_probe, end);
 4667|  1.37M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4667:20): [True: 1.37M, False: 0]
  |  Branch (4667:45): [True: 16.5k, False: 1.35M]
  ------------------
 4668|  16.5k|                  const auto after_q = explicit_probe + 1;
 4669|  16.5k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4669:23): [True: 8, False: 16.5k]
  |  Branch (4669:41): [True: 9.45k, False: 7.12k]
  ------------------
 4670|  11.1k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4670:23): [True: 1.16k, False: 5.95k]
  |  Branch (4670:42): [True: 533, False: 5.42k]
  ------------------
 4671|  11.1k|                     explicit_flow_key = true;
 4672|  11.1k|                     it = explicit_probe + 1;
 4673|  11.1k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4674|  11.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4674:26): [True: 3, False: 11.1k]
  ------------------
 4675|      3|                        return;
 4676|  11.1k|                  }
 4677|  16.5k|               }
 4678|       |               // Parse key
 4679|  1.37M|               key_t key{};
 4680|  1.37M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4681|  1.37M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4681:23): [True: 11.1k, False: 1.36M]
  |  Branch (4681:44): [True: 11.1k, False: 15]
  |  Branch (4681:58): [True: 2.14k, False: 8.99k]
  |  Branch (4681:72): [True: 1.93k, False: 7.05k]
  |  Branch (4681:86): [True: 812, False: 6.24k]
  ------------------
 4682|  4.89k|                     key.clear();
 4683|  4.89k|                  }
 4684|  1.36M|                  else {
 4685|  1.36M|                     auto key_probe = it;
 4686|  1.36M|                     yaml::skip_inline_ws(key_probe, end);
 4687|       |
 4688|       |                     // Use full node parsing only for structurally complex flow keys.
 4689|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4690|  1.36M|                     bool parse_complex_flow_key = false;
 4691|  1.36M|                     if (key_probe != end) {
  ------------------
  |  Branch (4691:26): [True: 1.36M, False: 15]
  ------------------
 4692|  1.36M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4692:29): [True: 3.03k, False: 1.36M]
  |  Branch (4692:50): [True: 28.7k, False: 1.33M]
  ------------------
 4693|  31.8k|                           parse_complex_flow_key = true;
 4694|  31.8k|                        }
 4695|  1.33M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4695:34): [True: 372k, False: 964k]
  ------------------
 4696|   372k|                           ++key_probe;
 4697|   372k|                           yaml::parse_anchor_name(key_probe, end);
 4698|   372k|                           yaml::skip_inline_ws(key_probe, end);
 4699|   372k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4699:32): [True: 372k, False: 66]
  |  Branch (4699:53): [True: 2.71k, False: 370k]
  |  Branch (4699:74): [True: 201k, False: 168k]
  ------------------
 4700|   204k|                              parse_complex_flow_key = true;
 4701|   204k|                           }
 4702|   372k|                        }
 4703|  1.36M|                     }
 4704|       |
 4705|  1.36M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4705:26): [True: 235k, False: 1.13M]
  ------------------
 4706|   235k|                        glz::generic key_node{};
 4707|   235k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4708|   235k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4708:29): [True: 11.2k, False: 224k]
  ------------------
 4709|  11.2k|                           return;
 4710|   224k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4710:29): [True: 25, False: 224k]
  ------------------
 4711|     25|                           return;
 4712|   224k|                     }
 4713|  1.13M|                     else {
 4714|  1.13M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4714:29): [True: 4.78k, False: 1.12M]
  ------------------
 4715|  4.78k|                           return;
 4716|  4.78k|                        }
 4717|  1.13M|                     }
 4718|  1.36M|                  }
 4719|       |               }
 4720|       |               else {
 4721|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4722|       |                     ctx.error = error_code::syntax_error;
 4723|       |                     return;
 4724|       |                  }
 4725|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4726|       |                  if (bool(ctx.error)) [[unlikely]]
 4727|       |                     return;
 4728|       |               }
 4729|       |
 4730|       |               // Separation between flow key and ':' may include comments/newlines.
 4731|       |               // In flow context, newlines are allowed between key and ':'.
 4732|  1.35M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4733|  1.37M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4733:20): [True: 10, False: 1.37M]
  ------------------
 4734|     10|                  return;
 4735|       |
 4736|  1.37M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4737|  1.37M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4738|  1.37M|                     val = {};
 4739|  1.37M|                     return true;
 4740|  1.37M|                  }
 4741|  1.37M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4742|  1.37M|                     val = glz::generic{};
 4743|  1.37M|                     return true;
 4744|  1.37M|                  }
 4745|  1.37M|                  else {
 4746|  1.37M|                     static constexpr std::string_view null_value{"null"};
 4747|  1.37M|                     auto null_it = null_value.data();
 4748|  1.37M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4749|  1.37M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4750|  1.37M|                     return !bool(ctx.error);
 4751|  1.37M|                  }
 4752|  1.37M|               };
 4753|       |
 4754|  1.37M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4754:20): [True: 1.35M, False: 17.6k]
  |  Branch (4754:34): [True: 518k, False: 837k]
  |  Branch (4754:48): [True: 143k, False: 694k]
  ------------------
 4755|   662k|                  val_t val{};
 4756|   662k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4756:23): [True: 0, False: 662k]
  ------------------
 4757|      0|                     return;
 4758|       |
 4759|   662k|                  value.emplace(std::move(key), std::move(val));
 4760|       |
 4761|   662k|                  if (*it == '}') {
  ------------------
  |  Branch (4761:23): [True: 143k, False: 518k]
  ------------------
 4762|   143k|                     ++it;
 4763|   143k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4764|   143k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4764:26): [True: 171, False: 143k]
  ------------------
 4765|    171|                        return;
 4766|   143k|                     break;
 4767|   143k|                  }
 4768|       |
 4769|   518k|                  ++it; // skip comma
 4770|   518k|                  yaml::skip_ws_and_newlines(it, end);
 4771|   518k|                  continue;
 4772|   662k|               }
 4773|       |
 4774|   711k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4774:20): [True: 17.6k, False: 694k]
  |  Branch (4774:33): [True: 721, False: 693k]
  ------------------
 4775|  2.31k|                  ctx.error = error_code::syntax_error;
 4776|  2.31k|                  return;
 4777|  2.31k|               }
 4778|   709k|               ++it;
 4779|       |
 4780|   709k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4781|   709k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4781:20): [True: 7, False: 709k]
  ------------------
 4782|      7|                  return;
 4783|       |
 4784|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4785|   709k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4785:20): [True: 693k, False: 16.1k]
  |  Branch (4785:34): [True: 24.2k, False: 669k]
  |  Branch (4785:48): [True: 8.15k, False: 661k]
  ------------------
 4786|  32.4k|                  val_t val{};
 4787|  32.4k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4787:23): [True: 0, False: 32.4k]
  ------------------
 4788|      0|                     return;
 4789|       |
 4790|  32.4k|                  value.emplace(std::move(key), std::move(val));
 4791|       |
 4792|  32.4k|                  if (*it == '}') {
  ------------------
  |  Branch (4792:23): [True: 8.15k, False: 24.2k]
  ------------------
 4793|  8.15k|                     ++it;
 4794|  8.15k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4795|  8.15k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4795:26): [True: 9, False: 8.14k]
  ------------------
 4796|      9|                        return;
 4797|  8.14k|                     break;
 4798|  8.15k|                  }
 4799|       |
 4800|  24.2k|                  ++it; // skip comma
 4801|  24.2k|                  yaml::skip_ws_and_newlines(it, end);
 4802|  24.2k|                  continue;
 4803|  32.4k|               }
 4804|       |
 4805|       |               // Parse value
 4806|   677k|               val_t val{};
 4807|   677k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4808|   677k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 3.12k, False: 674k]
  ------------------
 4809|  3.12k|                  return;
 4810|       |
 4811|   674k|               value.emplace(std::move(key), std::move(val));
 4812|       |
 4813|   674k|               yaml::skip_inline_ws(it, end);
 4814|       |
 4815|   674k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4815:20): [True: 657k, False: 16.5k]
  |  Branch (4815:33): [True: 225k, False: 432k]
  ------------------
 4816|   225k|                  ++it;
 4817|   225k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4818|   225k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4818:23): [True: 197, False: 224k]
  ------------------
 4819|    197|                     return;
 4820|   224k|                  break;
 4821|   225k|               }
 4822|   449k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4822:25): [True: 432k, False: 16.5k]
  |  Branch (4822:38): [True: 410k, False: 21.4k]
  ------------------
 4823|   410k|                  ++it;
 4824|       |                  // Skip whitespace and newlines after comma
 4825|   410k|                  yaml::skip_ws_and_newlines(it, end);
 4826|   410k|               }
 4827|  38.0k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4827:25): [True: 21.4k, False: 16.5k]
  |  Branch (4827:39): [True: 9.53k, False: 11.9k]
  |  Branch (4827:54): [True: 11.5k, False: 323]
  ------------------
 4828|       |                  // Newlines may precede either the closing brace or the
 4829|       |                  // separator comma for the next entry.
 4830|  21.1k|                  yaml::skip_ws_and_newlines(it, end);
 4831|  21.1k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4831:23): [True: 21.0k, False: 38]
  |  Branch (4831:36): [True: 2.83k, False: 18.2k]
  ------------------
 4832|  2.83k|                     ++it;
 4833|  2.83k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4834|  2.83k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4834:26): [True: 2, False: 2.83k]
  ------------------
 4835|      2|                        return;
 4836|  2.83k|                     break;
 4837|  2.83k|                  }
 4838|  18.2k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4838:23): [True: 18.2k, False: 38]
  |  Branch (4838:36): [True: 18.1k, False: 89]
  ------------------
 4839|  18.1k|                     ++it;
 4840|  18.1k|                     yaml::skip_ws_and_newlines(it, end);
 4841|  18.1k|                     continue;
 4842|  18.1k|                  }
 4843|    127|                  ctx.error = error_code::syntax_error;
 4844|    127|                  return;
 4845|  18.2k|               }
 4846|  16.8k|               else {
 4847|  16.8k|                  ctx.error = error_code::syntax_error;
 4848|  16.8k|                  return;
 4849|  16.8k|               }
 4850|   674k|            }
 4851|   415k|         }
 4852|   274k|         else {
 4853|       |            // Block mapping - use shared loop with map-specific callback
 4854|   274k|            yaml::parse_block_mapping_loop<Opts>(
 4855|   274k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4856|   274k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|   274k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4858|   274k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   274k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   274k|                           if (ctx.stream_begin) {
 4866|   274k|                              auto is_line_content_start = [&](auto pos) {
 4867|   274k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   274k|                              };
 4869|       |
 4870|   274k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   274k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   274k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   274k|                                 return line != end && *line == ':';
 4874|   274k|                              };
 4875|       |
 4876|   274k|                              if (!is_line_content_start(it) &&
 4877|   274k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4878|   274k|                                  !line_has_explicit_value_indicator(it)) {
 4879|   274k|                                 ctx.error = error_code::syntax_error;
 4880|   274k|                                 return false;
 4881|   274k|                              }
 4882|   274k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   274k|                           }
 4884|   274k|                        }
 4885|       |
 4886|   274k|                        if (*it == '-' &&
 4887|   274k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4888|   274k|                            !line_starts_with_explicit_value_indicator) {
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|   274k|                           ctx.error = error_code::syntax_error;
 4891|   274k|                           return false;
 4892|   274k|                        }
 4893|       |
 4894|   274k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4895|   274k|                           return false;
 4896|   274k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   274k|                        ctx.pop_indent();
 4898|   274k|                     }
 4899|   274k|                     else {
 4900|   274k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|   274k|                        if (nested_indent >= 0) {
 4902|   274k|                           yaml::skip_to_content(it, end);
 4903|   274k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4904|   274k|                              ctx.error = error_code::syntax_error;
 4905|   274k|                              return false;
 4906|   274k|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|   274k|                           const int32_t value_indent =
 4910|   274k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4911|   274k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4912|   274k|                              return false;
 4913|   274k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|   274k|                           ctx.pop_indent();
 4915|   274k|                        }
 4916|   274k|                     }
 4917|   274k|                     return !bool(ctx.error);
 4918|   274k|                  };
 4919|       |
 4920|       |                  // Explicit key entry form:
 4921|       |                  // ? key
 4922|       |                  // : value
 4923|   274k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4924|   274k|                     ctx.error = error_code::syntax_error;
 4925|   274k|                     return false;
 4926|   274k|                  }
 4927|   274k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4928|   274k|                     ++it; // skip '?'
 4929|   274k|                     yaml::skip_inline_ws(it, end);
 4930|       |
 4931|   274k|                     const int32_t explicit_value_indicator_indent =
 4932|   274k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4933|       |
 4934|   274k|                     key_t key{};
 4935|   274k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4936|   274k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   274k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   274k|                        };
 4939|       |
 4940|   274k|                        auto key_it = it;
 4941|   274k|                        yaml::skip_inline_ws(key_it, end);
 4942|       |
 4943|   274k|                        auto content = key_it;
 4944|   274k|                        yaml::skip_to_content(content, end);
 4945|   274k|                        bool handled_anchor_only_empty_key = false;
 4946|       |
 4947|       |                        // Anchor on an empty explicit key node:
 4948|       |                        //   ? &a
 4949|       |                        //   : value
 4950|   274k|                        if (content != end && *content == '&') {
 4951|   274k|                           auto anchor_probe = content + 1;
 4952|   274k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4953|   274k|                           if (!anchor_name.empty()) {
 4954|   274k|                              auto after_anchor = anchor_probe;
 4955|   274k|                              yaml::skip_inline_ws(after_anchor, end);
 4956|       |
 4957|   274k|                              auto value_indicator = after_anchor;
 4958|   274k|                              if (value_indicator != end && *value_indicator == ':') {
 4959|   274k|                                 key.clear();
 4960|   274k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4961|   274k|                                 it = value_indicator;
 4962|   274k|                                 handled_anchor_only_empty_key = true;
 4963|   274k|                              }
 4964|   274k|                              else {
 4965|   274k|                                 if (value_indicator != end && *value_indicator == '#') {
 4966|   274k|                                    yaml::skip_comment(value_indicator, end);
 4967|   274k|                                 }
 4968|   274k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4969|   274k|                                    yaml::skip_newline(value_indicator, end);
 4970|   274k|                                    auto value_line = value_indicator;
 4971|   274k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4972|   274k|                                    if (bool(ctx.error)) [[unlikely]]
 4973|   274k|                                       return false;
 4974|   274k|                                    if (value_line != end && *value_line == ':' &&
 4975|   274k|                                        value_indent == explicit_value_indicator_indent) {
 4976|   274k|                                       key.clear();
 4977|   274k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4978|   274k|                                       it = value_line;
 4979|   274k|                                       handled_anchor_only_empty_key = true;
 4980|   274k|                                    }
 4981|   274k|                                    else if (value_line != end && *value_line == ':') {
 4982|       |                                       // In explicit-key form ("? &a"), a following ':'
 4983|       |                                       // starts the outer value indicator only at the same
 4984|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4985|   274k|                                       ctx.error = error_code::syntax_error;
 4986|   274k|                                       return false;
 4987|   274k|                                    }
 4988|   274k|                                 }
 4989|   274k|                              }
 4990|   274k|                           }
 4991|   274k|                        }
 4992|       |
 4993|   274k|                        const bool key_content_spans_lines = [&] {
 4994|   274k|                           auto scan = key_it;
 4995|   274k|                           while (scan != content && scan != end) {
 4996|   274k|                              if (*scan == '\n' || *scan == '\r') return true;
 4997|   274k|                              ++scan;
 4998|   274k|                           }
 4999|   274k|                           return false;
 5000|   274k|                        }();
 5001|       |
 5002|   274k|                        if (handled_anchor_only_empty_key) {
 5003|       |                           // 'it' already points to the explicit value indicator ':'
 5004|   274k|                        }
 5005|   274k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5006|   274k|                           key.clear();
 5007|   274k|                           it = content;
 5008|   274k|                        }
 5009|   274k|                        else {
 5010|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5011|       |                           // Parse the key node structurally (not via plain-key scanning)
 5012|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5013|       |                           // as complex keys, not split into implicit key/value pairs.
 5014|   274k|                           auto key_node_it = content;
 5015|   274k|                           auto key_node_end = end;
 5016|   274k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5017|       |                              // In explicit-key form, a following standalone ':'
 5018|       |                              // line (same or lower indentation) belongs to the
 5019|       |                              // outer mapping value, not the key node itself.
 5020|   274k|                              auto scan = content;
 5021|   274k|                              while (scan != end) {
 5022|   274k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5023|   274k|                                    ++scan;
 5024|   274k|                                 }
 5025|   274k|                                 if (scan == end) {
 5026|   274k|                                    break;
 5027|   274k|                                 }
 5028|       |
 5029|   274k|                                 yaml::skip_newline(scan, end);
 5030|   274k|                                 auto line_start = scan;
 5031|       |
 5032|   274k|                                 int32_t indicator_indent = 0;
 5033|   274k|                                 while (scan != end && *scan == ' ') {
 5034|   274k|                                    ++indicator_indent;
 5035|   274k|                                    ++scan;
 5036|   274k|                                 }
 5037|       |
 5038|   274k|                                 if (scan != end && *scan == ':') {
 5039|   274k|                                    const auto after_colon = scan + 1;
 5040|   274k|                                    if ((after_colon == end ||
 5041|   274k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5042|   274k|                                        indicator_indent <= line_indent) {
 5043|   274k|                                       key_node_end = line_start;
 5044|   274k|                                       break;
 5045|   274k|                                    }
 5046|   274k|                                 }
 5047|   274k|                              }
 5048|   274k|                           }
 5049|       |
 5050|   274k|                           glz::generic key_node{};
 5051|   274k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5052|   274k|                           ctx.explicit_mapping_key_context = true;
 5053|   274k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5054|   274k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5055|   274k|                           if (bool(ctx.error)) [[unlikely]]
 5056|   274k|                              return false;
 5057|   274k|                           it = key_node_it;
 5058|   274k|                           if (!to_string_key(key_node)) [[unlikely]]
 5059|   274k|                              return false;
 5060|   274k|                        }
 5061|   274k|                     }
 5062|   274k|                     else {
 5063|   274k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5064|   274k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5065|   274k|                           if (bool(ctx.error)) [[unlikely]]
 5066|   274k|                              return false;
 5067|   274k|                        }
 5068|   274k|                     }
 5069|       |
 5070|   274k|                     yaml::skip_inline_ws(it, end);
 5071|   274k|                     yaml::skip_comment(it, end);
 5072|       |
 5073|       |                     // Value indicator may appear on the next line at the same indent.
 5074|   274k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5075|   274k|                        auto probe = it;
 5076|   274k|                        bool found_value_indicator = false;
 5077|       |
 5078|   274k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5079|   274k|                           yaml::skip_newline(probe, end);
 5080|       |
 5081|   274k|                           auto value_line = probe;
 5082|   274k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5083|   274k|                           if (bool(ctx.error)) [[unlikely]]
 5084|   274k|                              return false;
 5085|       |
 5086|   274k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5087|   274k|                              probe = value_line;
 5088|   274k|                              continue; // blank line
 5089|   274k|                           }
 5090|   274k|                           if (*value_line == '#') {
 5091|   274k|                              yaml::skip_comment(value_line, end);
 5092|   274k|                              probe = value_line;
 5093|   274k|                              continue; // comment-only line
 5094|   274k|                           }
 5095|   274k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5096|   274k|                              it = value_line;
 5097|   274k|                              found_value_indicator = true;
 5098|   274k|                           }
 5099|   274k|                           break;
 5100|   274k|                        }
 5101|       |
 5102|   274k|                        if (found_value_indicator) {
 5103|   274k|                           yaml::skip_inline_ws(it, end);
 5104|   274k|                        }
 5105|   274k|                     }
 5106|       |
 5107|   274k|                     val_t val{};
 5108|   274k|                     if (it != end && *it == ':') {
 5109|   274k|                        ++it;
 5110|   274k|                        if (it != end && *it == '\t') {
 5111|   274k|                           ctx.error = error_code::syntax_error;
 5112|   274k|                           return false;
 5113|   274k|                        }
 5114|   274k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5115|   274k|                           auto probe = it;
 5116|   274k|                           yaml::skip_newline(probe, end);
 5117|   274k|                           while (probe != end && *probe == ' ') ++probe;
 5118|   274k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5119|   274k|                              ctx.error = error_code::syntax_error;
 5120|   274k|                              return false;
 5121|   274k|                           }
 5122|   274k|                        }
 5123|   274k|                        yaml::skip_inline_ws(it, end);
 5124|   274k|                        if (!parse_map_value(val)) [[unlikely]]
 5125|   274k|                           return false;
 5126|   274k|                     }
 5127|       |
 5128|   274k|                     value.emplace(std::move(key), std::move(val));
 5129|   274k|                     return true;
 5130|   274k|                  }
 5131|       |
 5132|   274k|                  key_t key{};
 5133|   274k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5134|   274k|                     auto key_probe = it;
 5135|   274k|                     yaml::skip_inline_ws(key_probe, end);
 5136|   274k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5137|   274k|                     if (complex_flow_key) {
 5138|   274k|                        glz::generic key_node{};
 5139|   274k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5140|   274k|                        if (bool(ctx.error)) [[unlikely]]
 5141|   274k|                           return false;
 5142|   274k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5143|   274k|                           return false;
 5144|   274k|                     }
 5145|   274k|                     else {
 5146|   274k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5147|   274k|                           return false;
 5148|   274k|                        }
 5149|   274k|                     }
 5150|   274k|                  }
 5151|   274k|                  else {
 5152|   274k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5153|   274k|                     if (bool(ctx.error)) [[unlikely]]
 5154|   274k|                        return false;
 5155|   274k|                  }
 5156|       |
 5157|   274k|                  yaml::skip_inline_ws(it, end);
 5158|       |
 5159|   274k|                  if (it == end || *it != ':') {
 5160|   274k|                     ctx.error = error_code::syntax_error;
 5161|   274k|                     return false;
 5162|   274k|                  }
 5163|   274k|                  ++it;
 5164|   274k|                  yaml::skip_inline_ws(it, end);
 5165|       |
 5166|   274k|                  val_t val{};
 5167|   274k|                  if (!parse_map_value(val)) [[unlikely]]
 5168|   274k|                     return false;
 5169|       |
 5170|   274k|                  value.emplace(std::move(key), std::move(val));
 5171|   274k|                  return true;
 5172|   274k|               });
 5173|   274k|         }
 5174|       |
 5175|   666k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5176|   666k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   710k|      {
  466|   710k|         skip_inline_ws(it, end);
  467|       |
  468|   710k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 10, False: 710k]
  ------------------
  469|     10|            if constexpr (!AllowEmptyInput) {
  470|     10|               ctx.error = error_code::unexpected_end;
  471|     10|            }
  472|     10|            return true;
  473|     10|         }
  474|       |
  475|   710k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   710k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 710k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|   710k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 710k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   710k|         skip_inline_ws(it, end);
  486|       |
  487|   710k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 5, False: 710k]
  ------------------
  488|      5|            if constexpr (!AllowEmptyInput) {
  489|      5|               ctx.error = error_code::unexpected_end;
  490|      5|            }
  491|      5|            return true;
  492|      5|         }
  493|       |
  494|   710k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 12.9k, False: 697k]
  ------------------
  495|  12.9k|            return true;
  496|  12.9k|         }
  497|       |
  498|   697k|         return false;
  499|   710k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4599|   710k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   710k|      {
  409|   710k|         state.has_anchor = false;
  410|   710k|         state.anchor_name.clear();
  411|   710k|         state.anchor_start = nullptr;
  412|   710k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   710k|         if constexpr (Policy.allow_alias) {
  415|   710k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   710k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 709k, False: 513]
  ------------------
  417|   709k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 12.9k, False: 696k]
  ------------------
  418|   709k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   710k|         }
  424|       |
  425|   710k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 697k, False: 12.9k]
  |  Branch (425:27): [True: 8.34k, False: 688k]
  ------------------
  426|  8.34k|            ++it;
  427|  8.34k|            auto name = parse_anchor_name(it, end);
  428|  8.34k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 3, False: 8.33k]
  ------------------
  429|      3|               ctx.error = error_code::syntax_error;
  430|      3|               return true;
  431|      3|            }
  432|  8.33k|            skip_inline_ws(it, end);
  433|  8.33k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 17, False: 8.32k]
  ------------------
  434|     17|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     17|                  ctx.error = error_code::unexpected_end;
  436|     17|               }
  437|     17|               return true;
  438|     17|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  8.32k|            state.has_anchor = true;
  446|  8.32k|            state.anchor_name = std::string(name);
  447|  8.32k|            state.anchor_start = &*it;
  448|  8.32k|         }
  449|       |
  450|   710k|         return false;
  451|   710k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   709k|      {
  301|   709k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 709k]
  |  Branch (301:27): [True: 696k, False: 12.9k]
  ------------------
  302|       |
  303|  12.9k|         ++it; // skip '*'
  304|  12.9k|         auto name = parse_anchor_name(it, end);
  305|  12.9k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 8, False: 12.9k]
  ------------------
  306|      8|            ctx.error = error_code::syntax_error;
  307|      8|            return true;
  308|      8|         }
  309|       |
  310|  12.9k|         auto anchor_it = ctx.anchors.find(name);
  311|  12.9k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 53, False: 12.9k]
  ------------------
  312|     53|            ctx.error = error_code::syntax_error; // undefined alias
  313|     53|            return true;
  314|     53|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  12.9k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  12.9k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.09k, False: 10.8k]
  ------------------
  322|  2.09k|            return true;
  323|  2.09k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  10.8k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 6, False: 10.8k]
  ------------------
  329|      6|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      6|            return true;
  331|      6|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  10.8k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  10.8k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 10.8k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  10.8k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 10, False: 10.8k]
  ------------------
  342|     10|            ctx.error = error_code::exceeded_max_expansion;
  343|     10|            ctx.custom_error_message = "alias expansion";
  344|     10|            return true;
  345|     10|         }
  346|       |
  347|  10.8k|         auto replay_it = span.begin;
  348|  10.8k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  10.8k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  10.8k|         ctx.indent_stack.clear();
  353|  10.8k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 827, False: 9.97k]
  ------------------
  354|    827|            ctx.push_indent(span.base_indent - 1);
  355|    827|         }
  356|       |
  357|  10.8k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  10.8k|         using V = std::remove_cvref_t<T>;
  360|  10.8k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  10.8k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  10.8k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  10.8k|         return true;
  367|  10.8k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4736|   694k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4737|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4738|       |                     val = {};
 4739|       |                     return true;
 4740|       |                  }
 4741|   694k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4742|   694k|                     val = glz::generic{};
 4743|   694k|                     return true;
 4744|       |                  }
 4745|       |                  else {
 4746|       |                     static constexpr std::string_view null_value{"null"};
 4747|       |                     auto null_it = null_value.data();
 4748|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4749|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4750|       |                     return !bool(ctx.error);
 4751|       |                  }
 4752|   694k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|   274k|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|   274k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 274k]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|   274k|         const int32_t parent_indent = ctx.current_indent();
 3722|   274k|         const bool discover_indent = (mapping_indent < 0);
 3723|   274k|         bool first_key = !discover_indent;
 3724|   274k|         bool discovered_first_key_mid_line = false;
 3725|   274k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|   657k|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 419k, False: 237k]
  ------------------
 3728|   419k|            auto line_start = it;
 3729|   419k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 419k]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|   583k|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 576k, False: 6.22k]
  ------------------
 3733|   576k|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 13.3k, False: 563k]
  ------------------
 3734|  13.3k|                  skip_comment(it, end);
 3735|  13.3k|                  skip_newline(it, end);
 3736|  13.3k|                  first_key = false;
 3737|  13.3k|                  line_indent = 0;
 3738|  13.3k|               }
 3739|   563k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 30.6k, False: 532k]
  |  Branch (3739:40): [True: 101k, False: 431k]
  ------------------
 3740|   131k|                  skip_newline(it, end);
 3741|   131k|                  first_key = false;
 3742|   131k|                  line_indent = 0;
 3743|   131k|               }
 3744|   431k|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 68.1k, False: 363k]
  ------------------
 3745|  68.1k|                  line_start = it;
 3746|  68.1k|                  line_indent = 0;
 3747|   328k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 325k, False: 2.88k]
  |  Branch (3747:39): [True: 260k, False: 65.2k]
  ------------------
 3748|   260k|                     ++line_indent;
 3749|   260k|                     ++it;
 3750|   260k|                  }
 3751|       |
 3752|  68.1k|                  bool saw_tab = false;
 3753|  69.5k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 66.2k, False: 3.22k]
  |  Branch (3753:40): [True: 361, False: 65.9k]
  |  Branch (3753:54): [True: 1.03k, False: 64.8k]
  ------------------
 3754|  1.39k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 922, False: 470]
  |  Branch (3754:43): [True: 470, False: 0]
  ------------------
 3755|  1.39k|                     ++it;
 3756|  1.39k|                  }
 3757|       |
 3758|  68.1k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 3.22k, False: 64.8k]
  |  Branch (3758:36): [True: 2.04k, False: 62.8k]
  |  Branch (3758:51): [True: 971, False: 61.8k]
  |  Branch (3758:66): [True: 3.14k, False: 58.7k]
  ------------------
 3759|  9.38k|                     first_key = false;
 3760|  9.38k|                     line_indent = 0;
 3761|  9.38k|                     continue; // Blank or comment line
 3762|  9.38k|                  }
 3763|       |
 3764|  58.7k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 23, False: 58.7k]
  ------------------
 3765|     23|                     ctx.error = error_code::syntax_error;
 3766|     23|                     return;
 3767|     23|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|  58.7k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 57.0k, False: 1.62k]
  |  Branch (3770:46): [True: 349, False: 56.7k]
  ------------------
 3771|    349|                     it = line_start;
 3772|    349|                     return;
 3773|    349|                  }
 3774|       |
 3775|  58.3k|                  first_key = false;
 3776|  58.3k|                  break; // Found content
 3777|  58.7k|               }
 3778|   363k|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 9.06k, False: 354k]
  ------------------
 3779|  9.06k|                  line_start = it;
 3780|  21.0k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 20.6k, False: 368]
  |  Branch (3780:40): [True: 1.58k, False: 19.1k]
  |  Branch (3780:54): [True: 10.4k, False: 8.69k]
  ------------------
 3781|  9.06k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 368, False: 8.69k]
  |  Branch (3781:36): [True: 1.28k, False: 7.40k]
  |  Branch (3781:51): [True: 6.97k, False: 436]
  |  Branch (3781:66): [True: 409, False: 27]
  ------------------
 3782|  9.03k|                     first_key = false;
 3783|  9.03k|                     line_indent = 0;
 3784|  9.03k|                     continue; // Blank or comment-only line with tab indentation
 3785|  9.03k|                  }
 3786|     27|                  ctx.error = error_code::syntax_error;
 3787|     27|                  return;
 3788|  9.06k|               }
 3789|   354k|               else {
 3790|   354k|                  line_start = it;
 3791|   354k|                  break; // Content at column 0
 3792|   354k|               }
 3793|   576k|            }
 3794|       |
 3795|   419k|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 6.22k, False: 412k]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|   412k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 1.39k, False: 411k]
  |  Branch (3799:45): [True: 1.25k, False: 410k]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|   410k|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 410k, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|   410k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 410k, False: 0]
  |  Branch (3806:39): [True: 136k, False: 273k]
  |  Branch (3806:62): [True: 18.4k, False: 118k]
  |  Branch (3806:84): [True: 13.8k, False: 4.58k]
  ------------------
 3807|  13.8k|                  it = line_start;
 3808|  13.8k|                  return;
 3809|  13.8k|               }
 3810|   396k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 122k, False: 273k]
  |  Branch (3810:43): [True: 354, False: 122k]
  ------------------
 3811|    354|                  it = line_start;
 3812|    354|                  return;
 3813|    354|               }
 3814|   396k|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|   396k|            bool established_mapping_indent_this_line = false;
 3818|   396k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 273k, False: 122k]
  ------------------
 3819|   273k|               mapping_indent = line_indent;
 3820|   273k|               established_mapping_indent_this_line = true;
 3821|   273k|               discovered_first_key_visual_indent = line_indent;
 3822|   273k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   273k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 273k, False: 0]
  |  Branch (3823:43): [True: 273k, False: 0]
  ------------------
 3824|   273k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   273k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 117, False: 273k]
  ------------------
 3826|    117|                        ctx.error = error_code::syntax_error;
 3827|    117|                        return;
 3828|    117|                     }
 3829|       |
 3830|   273k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   273k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 271k, False: 1.62k]
  |  Branch (3831:49): [True: 217k, False: 53.8k]
  ------------------
 3832|   217k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   217k|                     }
 3834|   273k|                  }
 3835|   273k|               }
 3836|   273k|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|   396k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 395k, False: 117]
  |  Branch (3840:36): [True: 395k, False: 0]
  |  Branch (3840:59): [True: 122k, False: 273k]
  ------------------
 3841|   122k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 67.1k, False: 55.4k]
  ------------------
 3842|  67.1k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 66.8k, False: 275]
  |  Branch (3842:43): [True: 30.1k, False: 36.6k]
  ------------------
 3843|  30.1k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 30, False: 30.1k]
  ------------------
 3844|     30|                     ctx.error = error_code::syntax_error;
 3845|     30|                     return;
 3846|     30|                  }
 3847|  30.1k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 1.29k, False: 28.8k]
  ------------------
 3848|  1.29k|                     it = line_start;
 3849|  1.29k|                     return;
 3850|  1.29k|                  }
 3851|  30.1k|               }
 3852|  36.9k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 363, False: 36.6k]
  ------------------
 3853|    363|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 24, False: 339]
  |  Branch (3853:47): [True: 2, False: 337]
  ------------------
 3854|    337|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 337, False: 0]
  |  Branch (3854:49): [True: 337, False: 0]
  |  Branch (3854:72): [True: 4, False: 333]
  ------------------
 3855|     30|                  ctx.error = error_code::syntax_error;
 3856|     30|                  return;
 3857|     30|               }
 3858|  67.1k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|   394k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 394k]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|   394k|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 394k]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|   394k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 117, False: 394k]
  |  Branch (3876:32): [True: 0, False: 394k]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|   394k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 110k, False: 284k]
  |  Branch (3885:53): [True: 35.9k, False: 74.1k]
  |  Branch (3885:94): [True: 13.8k, False: 22.1k]
  ------------------
 3886|  13.8k|               const auto after_colon = it + 1;
 3887|  13.8k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 12.5k, False: 1.24k]
  ------------------
 3888|  13.8k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 391, False: 13.4k]
  |  Branch (3888:43): [True: 12.5k, False: 881]
  ------------------
 3889|  12.9k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 937, False: 12.0k]
  ------------------
 3890|    937|                  it = line_start;
 3891|    937|                  return;
 3892|    937|               }
 3893|  13.8k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|   393k|            int32_t effective_line_indent = line_indent;
 3897|   393k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 393k, False: 117]
  |  Branch (3897:36): [True: 273k, False: 120k]
  ------------------
 3898|   273k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 217k, False: 55.4k]
  ------------------
 3899|   217k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 156k, False: 61.6k]
  |  Branch (3899:52): [True: 92.2k, False: 63.9k]
  ------------------
 3900|       |               // The first discovered key has no indentation of its own left to measure: it may
 3901|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3902|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3903|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3904|       |               // key with an empty value takes the following sibling line for nested content
 3905|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3906|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3907|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3908|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3909|       |               // 7FWL and HMQ5 pin that case.
 3910|   125k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   125k|            }
 3912|       |
 3913|   393k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 10.7k, False: 382k]
  ------------------
 3914|  10.7k|               return;
 3915|  10.7k|            }
 3916|   382k|            first_key = false;
 3917|       |
 3918|   382k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 382k]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|   382k|            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|   382k|               auto flow_end = it;
 3925|   382k|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|   382k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3926:20): [True: 27, False: 382k]
  ------------------
 3927|     27|                  return;
 3928|   382k|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3928:20): [True: 321k, False: 61.1k]
  |  Branch (3928:40): [True: 133k, False: 188k]
  |  Branch (3928:60): [True: 5.04k, False: 183k]
  |  Branch (3928:80): [True: 43.6k, False: 139k]
  ------------------
 3929|   182k|                  it = flow_end;
 3930|   182k|                  return;
 3931|   182k|               }
 3932|   382k|            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|   382k|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 151k, False: 231k]
  ------------------
 3938|   151k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 37.6k, False: 114k]
  |  Branch (3938:34): [True: 909, False: 113k]
  ------------------
 3939|  38.5k|                  auto peek = it;
 3940|  38.5k|                  skip_inline_ws(peek, end);
 3941|  38.5k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 36.2k, False: 2.22k]
  |  Branch (3941:38): [True: 34.2k, False: 2.00k]
  |  Branch (3941:55): [True: 32.9k, False: 1.34k]
  |  Branch (3941:72): [True: 31.4k, False: 1.49k]
  ------------------
 3942|  31.4k|                     continue; // At leading indent of new line
 3943|  31.4k|                  }
 3944|  38.5k|               }
 3945|   120k|               skip_inline_ws(it, end);
 3946|   120k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 117k, False: 2.22k]
  |  Branch (3946:33): [True: 6.33k, False: 111k]
  ------------------
 3947|  6.33k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  6.33k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 6.33k, False: 0]
  ------------------
 3949|  6.33k|                        const char prev = *(it - 1);
 3950|  6.33k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 2.58k, False: 3.75k]
  |  Branch (3950:44): [True: 1.40k, False: 1.17k]
  |  Branch (3950:60): [True: 680, False: 726]
  |  Branch (3950:76): [True: 4, False: 676]
  ------------------
 3951|      4|                           ctx.error = error_code::syntax_error;
 3952|      4|                           return;
 3953|      4|                        }
 3954|  6.33k|                     }
 3955|  6.33k|                  }
 3956|  6.33k|               }
 3957|  6.32k|               skip_comment(it, end);
 3958|   120k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 117k, False: 2.37k]
  |  Branch (3958:34): [True: 25.5k, False: 92.2k]
  |  Branch (3958:49): [True: 39.1k, False: 53.1k]
  ------------------
 3959|  64.6k|                  skip_newline(it, end);
 3960|  64.6k|               }
 3961|  55.5k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 53.1k, False: 2.37k]
  ------------------
 3962|       |                  // The entry stopped part way along its line with something other than
 3963|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3964|       |                  // separator, say. The next pass measures indent as though this were the start
 3965|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3966|  53.1k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|  53.1k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 118, False: 53.0k]
  ------------------
 3968|    118|                        ctx.error = error_code::syntax_error;
 3969|    118|                        return;
 3970|    118|                     }
 3971|  53.1k|                  }
 3972|  53.1k|               }
 3973|   120k|            }
 3974|   382k|         }
 3975|   274k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_i:
 4855|   393k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4856|   393k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|   393k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4858|   393k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   393k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   393k|                           if (ctx.stream_begin) {
 4866|   393k|                              auto is_line_content_start = [&](auto pos) {
 4867|   393k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   393k|                              };
 4869|       |
 4870|   393k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   393k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   393k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   393k|                                 return line != end && *line == ':';
 4874|   393k|                              };
 4875|       |
 4876|   393k|                              if (!is_line_content_start(it) &&
 4877|   393k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4878|   393k|                                  !line_has_explicit_value_indicator(it)) {
 4879|   393k|                                 ctx.error = error_code::syntax_error;
 4880|   393k|                                 return false;
 4881|   393k|                              }
 4882|   393k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   393k|                           }
 4884|   393k|                        }
 4885|       |
 4886|   393k|                        if (*it == '-' &&
 4887|   393k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4888|   393k|                            !line_starts_with_explicit_value_indicator) {
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|   393k|                           ctx.error = error_code::syntax_error;
 4891|   393k|                           return false;
 4892|   393k|                        }
 4893|       |
 4894|   393k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4895|   393k|                           return false;
 4896|   393k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   393k|                        ctx.pop_indent();
 4898|   393k|                     }
 4899|   393k|                     else {
 4900|   393k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|   393k|                        if (nested_indent >= 0) {
 4902|   393k|                           yaml::skip_to_content(it, end);
 4903|   393k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4904|   393k|                              ctx.error = error_code::syntax_error;
 4905|   393k|                              return false;
 4906|   393k|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|   393k|                           const int32_t value_indent =
 4910|   393k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4911|   393k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4912|   393k|                              return false;
 4913|   393k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|   393k|                           ctx.pop_indent();
 4915|   393k|                        }
 4916|   393k|                     }
 4917|   393k|                     return !bool(ctx.error);
 4918|   393k|                  };
 4919|       |
 4920|       |                  // Explicit key entry form:
 4921|       |                  // ? key
 4922|       |                  // : value
 4923|   393k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4923:23): [True: 155k, False: 238k]
  |  Branch (4923:37): [True: 154k, False: 255]
  |  Branch (4923:58): [True: 5, False: 154k]
  ------------------
 4924|      5|                     ctx.error = error_code::syntax_error;
 4925|      5|                     return false;
 4926|      5|                  }
 4927|   393k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4927:23): [True: 155k, False: 238k]
  |  Branch (4927:38): [True: 255, False: 154k]
  |  Branch (4927:57): [True: 51.4k, False: 103k]
  |  Branch (4927:77): [True: 70.2k, False: 33.1k]
  |  Branch (4927:98): [True: 26.9k, False: 6.20k]
  ------------------
 4928|   148k|                     ++it; // skip '?'
 4929|   148k|                     yaml::skip_inline_ws(it, end);
 4930|       |
 4931|   148k|                     const int32_t explicit_value_indicator_indent =
 4932|   148k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4932:25): [True: 101k, False: 47.4k]
  ------------------
 4933|       |
 4934|   148k|                     key_t key{};
 4935|   148k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4936|   148k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   148k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   148k|                        };
 4939|       |
 4940|   148k|                        auto key_it = it;
 4941|   148k|                        yaml::skip_inline_ws(key_it, end);
 4942|       |
 4943|   148k|                        auto content = key_it;
 4944|   148k|                        yaml::skip_to_content(content, end);
 4945|   148k|                        bool handled_anchor_only_empty_key = false;
 4946|       |
 4947|       |                        // Anchor on an empty explicit key node:
 4948|       |                        //   ? &a
 4949|       |                        //   : value
 4950|   148k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4950:29): [True: 146k, False: 2.24k]
  |  Branch (4950:47): [True: 51.0k, False: 95.6k]
  ------------------
 4951|  51.0k|                           auto anchor_probe = content + 1;
 4952|  51.0k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4953|  51.0k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4953:32): [True: 51.0k, False: 22]
  ------------------
 4954|  51.0k|                              auto after_anchor = anchor_probe;
 4955|  51.0k|                              yaml::skip_inline_ws(after_anchor, end);
 4956|       |
 4957|  51.0k|                              auto value_indicator = after_anchor;
 4958|  51.0k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4958:35): [True: 49.1k, False: 1.86k]
  |  Branch (4958:61): [True: 2.93k, False: 46.2k]
  ------------------
 4959|  2.93k|                                 key.clear();
 4960|  2.93k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4961|  2.93k|                                 it = value_indicator;
 4962|  2.93k|                                 handled_anchor_only_empty_key = true;
 4963|  2.93k|                              }
 4964|  48.1k|                              else {
 4965|  48.1k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4965:38): [True: 46.2k, False: 1.86k]
  |  Branch (4965:64): [True: 2.78k, False: 43.4k]
  ------------------
 4966|  2.78k|                                    yaml::skip_comment(value_indicator, end);
 4967|  2.78k|                                 }
 4968|  48.1k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4968:38): [True: 46.0k, False: 2.02k]
  |  Branch (4968:65): [True: 5.66k, False: 40.4k]
  |  Branch (4968:93): [True: 19.0k, False: 21.3k]
  ------------------
 4969|  24.6k|                                    yaml::skip_newline(value_indicator, end);
 4970|  24.6k|                                    auto value_line = value_indicator;
 4971|  24.6k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4972|  24.6k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4972:41): [True: 2, False: 24.6k]
  ------------------
 4973|      2|                                       return false;
 4974|  24.6k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4974:41): [True: 22.9k, False: 1.68k]
  |  Branch (4974:62): [True: 2.92k, False: 20.0k]
  ------------------
 4975|  2.92k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4975:41): [True: 2.92k, False: 2]
  ------------------
 4976|  2.92k|                                       key.clear();
 4977|  2.92k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4978|  2.92k|                                       it = value_line;
 4979|  2.92k|                                       handled_anchor_only_empty_key = true;
 4980|  2.92k|                                    }
 4981|  21.7k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4981:46): [True: 20.0k, False: 1.68k]
  |  Branch (4981:67): [True: 2, False: 20.0k]
  ------------------
 4982|       |                                       // In explicit-key form ("? &a"), a following ':'
 4983|       |                                       // starts the outer value indicator only at the same
 4984|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4985|      2|                                       ctx.error = error_code::syntax_error;
 4986|      2|                                       return false;
 4987|      2|                                    }
 4988|  24.6k|                                 }
 4989|  48.1k|                              }
 4990|  51.0k|                           }
 4991|  51.0k|                        }
 4992|       |
 4993|   148k|                        const bool key_content_spans_lines = [&] {
 4994|   148k|                           auto scan = key_it;
 4995|   148k|                           while (scan != content && scan != end) {
 4996|   148k|                              if (*scan == '\n' || *scan == '\r') return true;
 4997|   148k|                              ++scan;
 4998|   148k|                           }
 4999|   148k|                           return false;
 5000|   148k|                        }();
 5001|       |
 5002|   148k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5002:29): [True: 5.85k, False: 143k]
  ------------------
 5003|       |                           // 'it' already points to the explicit value indicator ':'
 5004|  5.85k|                        }
 5005|   143k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5005:34): [True: 2.24k, False: 140k]
  |  Branch (5005:53): [True: 4.34k, False: 136k]
  |  Branch (5005:72): [True: 3.26k, False: 1.07k]
  ------------------
 5006|  5.50k|                           key.clear();
 5007|  5.50k|                           it = content;
 5008|  5.50k|                        }
 5009|   137k|                        else {
 5010|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5011|       |                           // Parse the key node structurally (not via plain-key scanning)
 5012|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5013|       |                           // as complex keys, not split into implicit key/value pairs.
 5014|   137k|                           auto key_node_it = content;
 5015|   137k|                           auto key_node_end = end;
 5016|   137k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5017|       |                              // In explicit-key form, a following standalone ':'
 5018|       |                              // line (same or lower indentation) belongs to the
 5019|       |                              // outer mapping value, not the key node itself.
 5020|   137k|                              auto scan = content;
 5021|  1.11M|                              while (scan != end) {
  ------------------
  |  Branch (5021:38): [True: 1.09M, False: 20.3k]
  ------------------
 5022|  66.2M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5022:41): [True: 66.1M, False: 79.6k]
  |  Branch (5022:56): [True: 65.7M, False: 435k]
  |  Branch (5022:73): [True: 65.1M, False: 581k]
  ------------------
 5023|  65.1M|                                    ++scan;
 5024|  65.1M|                                 }
 5025|  1.09M|                                 if (scan == end) {
  ------------------
  |  Branch (5025:38): [True: 79.6k, False: 1.01M]
  ------------------
 5026|  79.6k|                                    break;
 5027|  79.6k|                                 }
 5028|       |
 5029|  1.01M|                                 yaml::skip_newline(scan, end);
 5030|  1.01M|                                 auto line_start = scan;
 5031|       |
 5032|  1.01M|                                 int32_t indicator_indent = 0;
 5033|  1.72M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5033:41): [True: 1.69M, False: 20.3k]
  |  Branch (5033:56): [True: 702k, False: 997k]
  ------------------
 5034|   702k|                                    ++indicator_indent;
 5035|   702k|                                    ++scan;
 5036|   702k|                                 }
 5037|       |
 5038|  1.01M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5038:38): [True: 997k, False: 20.3k]
  |  Branch (5038:53): [True: 90.3k, False: 906k]
  ------------------
 5039|  90.3k|                                    const auto after_colon = scan + 1;
 5040|  90.3k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5040:42): [True: 1.04k, False: 89.2k]
  ------------------
 5041|  89.2k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5041:42): [True: 74.6k, False: 14.6k]
  ------------------
 5042|  75.7k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5042:41): [True: 37.5k, False: 38.1k]
  ------------------
 5043|  37.5k|                                       key_node_end = line_start;
 5044|  37.5k|                                       break;
 5045|  37.5k|                                    }
 5046|  90.3k|                                 }
 5047|  1.01M|                              }
 5048|   137k|                           }
 5049|       |
 5050|   137k|                           glz::generic key_node{};
 5051|   137k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5052|   137k|                           ctx.explicit_mapping_key_context = true;
 5053|   137k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5054|   137k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5055|   137k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5055:32): [True: 1.31k, False: 136k]
  ------------------
 5056|  1.31k|                              return false;
 5057|   136k|                           it = key_node_it;
 5058|   136k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5058:32): [True: 10, False: 136k]
  ------------------
 5059|     10|                              return false;
 5060|   136k|                        }
 5061|       |                     }
 5062|       |                     else {
 5063|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5064|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5065|       |                           if (bool(ctx.error)) [[unlikely]]
 5066|       |                              return false;
 5067|       |                        }
 5068|       |                     }
 5069|       |
 5070|   147k|                     yaml::skip_inline_ws(it, end);
 5071|   148k|                     yaml::skip_comment(it, end);
 5072|       |
 5073|       |                     // Value indicator may appear on the next line at the same indent.
 5074|   148k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5074:26): [True: 128k, False: 20.7k]
  |  Branch (5074:40): [True: 8.33k, False: 119k]
  |  Branch (5074:55): [True: 26.0k, False: 93.8k]
  ------------------
 5075|  34.3k|                        auto probe = it;
 5076|  34.3k|                        bool found_value_indicator = false;
 5077|       |
 5078|  50.6k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5078:32): [True: 44.6k, False: 6.02k]
  |  Branch (5078:49): [True: 11.8k, False: 32.7k]
  |  Branch (5078:67): [True: 32.7k, False: 2]
  ------------------
 5079|  44.6k|                           yaml::skip_newline(probe, end);
 5080|       |
 5081|  44.6k|                           auto value_line = probe;
 5082|  44.6k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5083|  44.6k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5083:32): [True: 4, False: 44.6k]
  ------------------
 5084|      4|                              return false;
 5085|       |
 5086|  44.6k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5086:32): [True: 5.68k, False: 38.9k]
  |  Branch (5086:53): [True: 1.71k, False: 37.2k]
  |  Branch (5086:76): [True: 4.63k, False: 32.5k]
  ------------------
 5087|  12.0k|                              probe = value_line;
 5088|  12.0k|                              continue; // blank line
 5089|  12.0k|                           }
 5090|  32.5k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5090:32): [True: 4.28k, False: 28.3k]
  ------------------
 5091|  4.28k|                              yaml::skip_comment(value_line, end);
 5092|  4.28k|                              probe = value_line;
 5093|  4.28k|                              continue; // comment-only line
 5094|  4.28k|                           }
 5095|  28.3k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5095:32): [True: 13.7k, False: 14.5k]
  |  Branch (5095:54): [True: 4.16k, False: 9.61k]
  ------------------
 5096|  4.16k|                              it = value_line;
 5097|  4.16k|                              found_value_indicator = true;
 5098|  4.16k|                           }
 5099|  28.3k|                           break;
 5100|  32.5k|                        }
 5101|       |
 5102|  34.3k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5102:29): [True: 4.16k, False: 30.1k]
  ------------------
 5103|  4.16k|                           yaml::skip_inline_ws(it, end);
 5104|  4.16k|                        }
 5105|  34.3k|                     }
 5106|       |
 5107|   148k|                     val_t val{};
 5108|   148k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5108:26): [True: 128k, False: 20.7k]
  |  Branch (5108:39): [True: 48.1k, False: 79.9k]
  ------------------
 5109|  48.1k|                        ++it;
 5110|  48.1k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5110:29): [True: 46.4k, False: 1.78k]
  |  Branch (5110:42): [True: 2, False: 46.4k]
  ------------------
 5111|      2|                           ctx.error = error_code::syntax_error;
 5112|      2|                           return false;
 5113|      2|                        }
 5114|  48.1k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5114:29): [True: 46.4k, False: 1.78k]
  |  Branch (5114:43): [True: 3.33k, False: 43.0k]
  |  Branch (5114:58): [True: 11.6k, False: 31.4k]
  ------------------
 5115|  15.0k|                           auto probe = it;
 5116|  15.0k|                           yaml::skip_newline(probe, end);
 5117|  26.9k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5117:35): [True: 24.8k, False: 2.08k]
  |  Branch (5117:51): [True: 11.9k, False: 12.9k]
  ------------------
 5118|  15.0k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5118:32): [True: 12.9k, False: 2.08k]
  |  Branch (5118:48): [True: 5.83k, False: 7.08k]
  |  Branch (5118:65): [True: 5.65k, False: 187]
  |  Branch (5118:89): [True: 2, False: 5.64k]
  ------------------
 5119|      2|                              ctx.error = error_code::syntax_error;
 5120|      2|                              return false;
 5121|      2|                           }
 5122|  15.0k|                        }
 5123|  48.1k|                        yaml::skip_inline_ws(it, end);
 5124|  48.1k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5124:29): [True: 242, False: 47.9k]
  ------------------
 5125|    242|                           return false;
 5126|  48.1k|                     }
 5127|       |
 5128|   148k|                     value.emplace(std::move(key), std::move(val));
 5129|   148k|                     return true;
 5130|   148k|                  }
 5131|       |
 5132|   244k|                  key_t key{};
 5133|   244k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5134|   244k|                     auto key_probe = it;
 5135|   244k|                     yaml::skip_inline_ws(key_probe, end);
 5136|   244k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5136:53): [True: 244k, False: 0]
  |  Branch (5136:74): [True: 1.52k, False: 243k]
  |  Branch (5136:95): [True: 1.36k, False: 241k]
  ------------------
 5137|   244k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5137:26): [True: 2.88k, False: 241k]
  ------------------
 5138|  2.88k|                        glz::generic key_node{};
 5139|  2.88k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5140|  2.88k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5140:29): [True: 713, False: 2.17k]
  ------------------
 5141|    713|                           return false;
 5142|  2.17k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5142:29): [True: 2, False: 2.17k]
  ------------------
 5143|      2|                           return false;
 5144|  2.17k|                     }
 5145|   241k|                     else {
 5146|   241k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5146:29): [True: 409, False: 241k]
  ------------------
 5147|    409|                           return false;
 5148|    409|                        }
 5149|   241k|                     }
 5150|       |                  }
 5151|       |                  else {
 5152|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5153|       |                     if (bool(ctx.error)) [[unlikely]]
 5154|       |                        return false;
 5155|       |                  }
 5156|       |
 5157|   243k|                  yaml::skip_inline_ws(it, end);
 5158|       |
 5159|   244k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5159:23): [True: 1.28k, False: 243k]
  |  Branch (5159:36): [True: 205, False: 243k]
  ------------------
 5160|    362|                     ctx.error = error_code::syntax_error;
 5161|    362|                     return false;
 5162|    362|                  }
 5163|   244k|                  ++it;
 5164|   244k|                  yaml::skip_inline_ws(it, end);
 5165|       |
 5166|   244k|                  val_t val{};
 5167|   244k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5167:23): [True: 7.72k, False: 236k]
  ------------------
 5168|  7.72k|                     return false;
 5169|       |
 5170|   236k|                  value.emplace(std::move(key), std::move(val));
 5171|   236k|                  return true;
 5172|   244k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlvE_clEv:
 4993|   148k|                        const bool key_content_spans_lines = [&] {
 4994|   148k|                           auto scan = key_it;
 4995|   164k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4995:35): [True: 116k, False: 47.6k]
  |  Branch (4995:54): [True: 116k, False: 0]
  ------------------
 4996|   116k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4996:35): [True: 71.6k, False: 44.9k]
  |  Branch (4996:52): [True: 29.5k, False: 15.3k]
  ------------------
 4997|  15.3k|                              ++scan;
 4998|  15.3k|                           }
 4999|  47.6k|                           return false;
 5000|   148k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4936|   136k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   136k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   136k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4856|   291k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|   291k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4857:26): [True: 285k, False: 6.11k]
  |  Branch (4857:39): [True: 207k, False: 77.9k]
  ------------------
 4858|   207k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   207k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   207k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4865:32): [True: 207k, False: 0]
  ------------------
 4866|   207k|                              auto is_line_content_start = [&](auto pos) {
 4867|   207k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   207k|                              };
 4869|       |
 4870|   207k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   207k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   207k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   207k|                                 return line != end && *line == ':';
 4874|   207k|                              };
 4875|       |
 4876|   207k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4876:35): [True: 207k, False: 0]
  ------------------
 4877|   207k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4877:35): [True: 15.6k, False: 191k]
  ------------------
 4878|  15.6k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4878:35): [True: 464, False: 15.1k]
  ------------------
 4879|    464|                                 ctx.error = error_code::syntax_error;
 4880|    464|                                 return false;
 4881|    464|                              }
 4882|   206k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   206k|                           }
 4884|   207k|                        }
 4885|       |
 4886|   207k|                        if (*it == '-' &&
  ------------------
  |  Branch (4886:29): [True: 2.25k, False: 205k]
  ------------------
 4887|  2.25k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4887:30): [True: 296, False: 1.96k]
  |  Branch (4887:49): [True: 428, False: 1.53k]
  ------------------
 4888|    724|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4888:29): [True: 11, False: 713]
  ------------------
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|     11|                           ctx.error = error_code::syntax_error;
 4891|     11|                           return false;
 4892|     11|                        }
 4893|       |
 4894|   207k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4894:29): [True: 0, False: 207k]
  ------------------
 4895|      0|                           return false;
 4896|   207k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   207k|                        ctx.pop_indent();
 4898|   207k|                     }
 4899|  84.0k|                     else {
 4900|  84.0k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|  84.0k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4901:29): [True: 22.1k, False: 61.8k]
  ------------------
 4902|  22.1k|                           yaml::skip_to_content(it, end);
 4903|  22.1k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4903:32): [True: 22.1k, False: 0]
  |  Branch (4903:45): [True: 0, False: 22.1k]
  |  Branch (4903:59): [True: 0, False: 0]
  |  Branch (4903:78): [True: 0, False: 0]
  ------------------
 4904|      0|                              ctx.error = error_code::syntax_error;
 4905|      0|                              return false;
 4906|      0|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|  22.1k|                           const int32_t value_indent =
 4910|  22.1k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4910:31): [Folded, False: 22.1k]
  ------------------
 4911|  22.1k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4911:32): [True: 0, False: 22.1k]
  ------------------
 4912|      0|                              return false;
 4913|  22.1k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|  22.1k|                           ctx.pop_indent();
 4915|  22.1k|                        }
 4916|  84.0k|                     }
 4917|   291k|                     return !bool(ctx.error);
 4918|   291k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISA_EEDaSN_:
 4866|   207k|                              auto is_line_content_start = [&](auto pos) {
 4867|   207k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   207k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISA_EEDaSN_:
 4870|   222k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   222k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   395k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4872:41): [True: 395k, False: 0]
  |  Branch (4872:57): [True: 172k, False: 222k]
  |  Branch (4872:73): [True: 354, False: 222k]
  ------------------
 4873|   222k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4873:41): [True: 222k, False: 0]
  |  Branch (4873:56): [True: 137k, False: 85.2k]
  ------------------
 4874|   222k|                              };
_ZN3glz4yaml26detect_nested_value_indentINS0_12yaml_contextEPKcS4_EEiRT_RT0_T1_i:
 3496|  1.35M|      {
 3497|  1.35M|         skip_ws_and_comment(it, end);
 3498|  1.35M|         if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3498:14): [True: 144k, False: 1.20M]
  |  Branch (3498:28): [True: 668k, False: 538k]
  |  Branch (3498:43): [True: 96, False: 668k]
  ------------------
 3499|   144k|            return -1;
 3500|   144k|         }
 3501|  1.20M|         skip_newline(it, end);
 3502|  1.20M|         auto content_start = it;
 3503|       |
 3504|       |         // Peek ahead to find the first content line (skip blank/comment lines)
 3505|  1.20M|         auto peek = it;
 3506|  1.68M|         while (peek != end) {
  ------------------
  |  Branch (3506:17): [True: 1.55M, False: 130k]
  ------------------
 3507|  1.55M|            if (*peek == '\n' || *peek == '\r') {
  ------------------
  |  Branch (3507:17): [True: 81.4k, False: 1.47M]
  |  Branch (3507:34): [True: 170k, False: 1.30M]
  ------------------
 3508|   251k|               skip_newline(peek, end);
 3509|   251k|            }
 3510|  1.30M|            else if (*peek == '#') {
  ------------------
  |  Branch (3510:22): [True: 70.5k, False: 1.23M]
  ------------------
 3511|  70.5k|               skip_comment(peek, end);
 3512|  70.5k|            }
 3513|  1.23M|            else if (*peek == ' ') {
  ------------------
  |  Branch (3513:22): [True: 750k, False: 485k]
  ------------------
 3514|   750k|               auto line_start = peek;
 3515|  3.12M|               while (peek != end && *peek == ' ') ++peek;
  ------------------
  |  Branch (3515:23): [True: 3.09M, False: 31.0k]
  |  Branch (3515:38): [True: 2.37M, False: 718k]
  ------------------
 3516|   750k|               if (peek == end || *peek == '\n' || *peek == '\r') {
  ------------------
  |  Branch (3516:20): [True: 31.0k, False: 718k]
  |  Branch (3516:35): [True: 18.3k, False: 700k]
  |  Branch (3516:52): [True: 13.3k, False: 687k]
  ------------------
 3517|  62.6k|                  continue; // blank line with trailing spaces
 3518|  62.6k|               }
 3519|   687k|               if (*peek == '#') {
  ------------------
  |  Branch (3519:20): [True: 23.9k, False: 663k]
  ------------------
 3520|  23.9k|                  skip_comment(peek, end);
 3521|  23.9k|                  continue; // comment-only line
 3522|  23.9k|               }
 3523|       |               // YAML allows node properties to appear on standalone lines before the
 3524|       |               // actual node value, for example:
 3525|       |               //   key:
 3526|       |               //     !tag
 3527|       |               //     &anchor
 3528|       |               //     actual: value
 3529|       |               // This loop recognizes chains of properties (`!tag`, `&anchor`, optional
 3530|       |               // inline spaces/comments) and treats those lines as non-content so they do
 3531|       |               // not incorrectly define nested indentation.
 3532|   663k|               {
 3533|   663k|                  auto prop = peek;
 3534|   663k|                  bool saw_property = false;
 3535|   877k|                  while (prop != end) {
  ------------------
  |  Branch (3535:26): [True: 875k, False: 1.06k]
  ------------------
 3536|   875k|                     if (*prop == '!') {
  ------------------
  |  Branch (3536:26): [True: 20.3k, False: 855k]
  ------------------
 3537|  20.3k|                        const auto tag = parse_yaml_tag(prop, end, ctx);
 3538|  20.3k|                        if (tag == yaml_tag::unknown) break;
  ------------------
  |  Branch (3538:29): [True: 340, False: 20.0k]
  ------------------
 3539|  20.0k|                        saw_property = true;
 3540|  20.0k|                        skip_inline_ws(prop, end);
 3541|  20.0k|                        continue;
 3542|  20.3k|                     }
 3543|   855k|                     if (*prop == '&') {
  ------------------
  |  Branch (3543:26): [True: 194k, False: 661k]
  ------------------
 3544|   194k|                        ++prop;
 3545|   194k|                        auto aname = parse_anchor_name(prop, end);
 3546|   194k|                        if (aname.empty()) break;
  ------------------
  |  Branch (3546:29): [True: 728, False: 193k]
  ------------------
 3547|   193k|                        saw_property = true;
 3548|   193k|                        skip_inline_ws(prop, end);
 3549|   193k|                        continue;
 3550|   194k|                     }
 3551|   661k|                     break;
 3552|   855k|                  }
 3553|   663k|                  if (saw_property) {
  ------------------
  |  Branch (3553:23): [True: 96.2k, False: 567k]
  ------------------
 3554|  96.2k|                     auto tail = prop;
 3555|  96.2k|                     skip_inline_ws(tail, end);
 3556|  96.2k|                     if (tail == end || *tail == '\n' || *tail == '\r' || *tail == '#') {
  ------------------
  |  Branch (3556:26): [True: 1.18k, False: 95.0k]
  |  Branch (3556:41): [True: 7.24k, False: 87.8k]
  |  Branch (3556:58): [True: 62.1k, False: 25.7k]
  |  Branch (3556:75): [True: 1.91k, False: 23.8k]
  ------------------
 3557|  72.4k|                        if (tail != end && *tail == '#') {
  ------------------
  |  Branch (3557:29): [True: 71.2k, False: 1.18k]
  |  Branch (3557:44): [True: 1.91k, False: 69.3k]
  ------------------
 3558|  1.91k|                           skip_comment(tail, end);
 3559|  1.91k|                        }
 3560|  72.4k|                        if (tail != end && (*tail == '\n' || *tail == '\r')) {
  ------------------
  |  Branch (3560:29): [True: 71.0k, False: 1.41k]
  |  Branch (3560:45): [True: 7.55k, False: 63.4k]
  |  Branch (3560:62): [True: 63.0k, False: 402]
  ------------------
 3561|  70.6k|                           skip_newline(tail, end);
 3562|  70.6k|                        }
 3563|  72.4k|                        peek = tail;
 3564|  72.4k|                        continue;
 3565|  72.4k|                     }
 3566|  96.2k|                  }
 3567|   663k|               }
 3568|   590k|               peek = line_start; // content found, restore to measure properly
 3569|   590k|               break;
 3570|   663k|            }
 3571|   485k|            else {
 3572|   485k|               break; // content at column 0
 3573|   485k|            }
 3574|  1.55M|         }
 3575|       |
 3576|       |         // Measure indent of the content line
 3577|  1.20M|         int32_t content_indent = measure_indent<false>(peek, end, ctx);
 3578|  1.20M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3578:14): [True: 186, False: 1.20M]
  ------------------
 3579|    186|            return -1;
 3580|       |
 3581|       |         // Tabs in indentation-like positions are only allowed when they are plain
 3582|       |         // scalar content. Structural lines (mapping keys/entries) remain errors.
 3583|  1.20M|         if (peek != end && *peek == '\t') {
  ------------------
  |  Branch (3583:14): [True: 1.07M, False: 130k]
  |  Branch (3583:29): [True: 13.5k, False: 1.06M]
  ------------------
 3584|  13.5k|            auto probe = peek;
 3585|  39.5k|            while (probe != end && (*probe == ' ' || *probe == '\t')) ++probe;
  ------------------
  |  Branch (3585:20): [True: 39.3k, False: 266]
  |  Branch (3585:37): [True: 2.81k, False: 36.5k]
  |  Branch (3585:54): [True: 23.2k, False: 13.2k]
  ------------------
 3586|  13.5k|            if (probe != end && *probe != '\n' && *probe != '\r' && *probe != '#') {
  ------------------
  |  Branch (3586:17): [True: 13.2k, False: 266]
  |  Branch (3586:33): [True: 10.4k, False: 2.78k]
  |  Branch (3586:51): [True: 7.86k, False: 2.60k]
  |  Branch (3586:69): [True: 4.69k, False: 3.17k]
  ------------------
 3587|  4.69k|               const bool looks_sequence_entry =
 3588|  4.69k|                  (*probe == '-') &&
  ------------------
  |  Branch (3588:19): [True: 302, False: 4.39k]
  ------------------
 3589|    302|                  ((probe + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(probe + 1))]);
  ------------------
  |  Branch (3589:20): [True: 4, False: 298]
  |  Branch (3589:42): [True: 12, False: 286]
  ------------------
 3590|  4.69k|               const bool looks_explicit_entry =
 3591|  4.69k|                  (*probe == '?' || *probe == ':') &&
  ------------------
  |  Branch (3591:20): [True: 308, False: 4.38k]
  |  Branch (3591:37): [True: 774, False: 3.61k]
  ------------------
 3592|  1.08k|                  ((probe + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(probe + 1))]);
  ------------------
  |  Branch (3592:20): [True: 22, False: 1.06k]
  |  Branch (3592:42): [True: 8, False: 1.05k]
  ------------------
 3593|  4.69k|               bool looks_mapping_key = false;
 3594|  4.69k|               auto scan = probe;
 3595|  1.00M|               while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (3595:23): [True: 999k, False: 1.42k]
  |  Branch (3595:38): [True: 998k, False: 948]
  |  Branch (3595:55): [True: 995k, False: 2.20k]
  ------------------
 3596|   995k|                  if (*scan == ':') {
  ------------------
  |  Branch (3596:23): [True: 1.23k, False: 994k]
  ------------------
 3597|  1.23k|                     const auto after = scan + 1;
 3598|  1.23k|                     if (after == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after)]) {
  ------------------
  |  Branch (3598:26): [True: 92, False: 1.14k]
  |  Branch (3598:42): [True: 28, False: 1.11k]
  ------------------
 3599|    120|                        looks_mapping_key = true;
 3600|    120|                        break;
 3601|    120|                     }
 3602|  1.23k|                  }
 3603|   995k|                  ++scan;
 3604|   995k|               }
 3605|  4.69k|               if (looks_sequence_entry || looks_explicit_entry || looks_mapping_key) {
  ------------------
  |  Branch (3605:20): [True: 16, False: 4.67k]
  |  Branch (3605:44): [True: 30, False: 4.64k]
  |  Branch (3605:68): [True: 88, False: 4.55k]
  ------------------
 3606|    134|                  ctx.error = error_code::syntax_error;
 3607|    134|                  return -1;
 3608|    134|               }
 3609|  4.69k|            }
 3610|  13.5k|         }
 3611|       |
 3612|  1.20M|         const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3612:48): [True: 0, False: 1.20M]
  ------------------
 3613|  1.20M|         if (content_indent > effective_line_indent && peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (3613:14): [True: 388k, False: 818k]
  |  Branch (3613:56): [True: 388k, False: 0]
  |  Branch (3613:71): [True: 388k, False: 0]
  |  Branch (3613:88): [True: 388k, False: 0]
  ------------------
 3614|   388k|            it = content_start;
 3615|   388k|            return content_indent;
 3616|   388k|         }
 3617|       |
 3618|       |         // YAML allows "indentless sequences" as mapping values:
 3619|       |         // key:
 3620|       |         // - item
 3621|   818k|         if (content_indent == effective_line_indent && peek != end && *peek == '-') {
  ------------------
  |  Branch (3621:14): [True: 533k, False: 284k]
  |  Branch (3621:57): [True: 473k, False: 60.3k]
  |  Branch (3621:72): [True: 16.5k, False: 457k]
  ------------------
 3622|  16.5k|            const auto after_dash = peek + 1;
 3623|  16.5k|            if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3623:17): [True: 182, False: 16.3k]
  |  Branch (3623:38): [True: 12.9k, False: 3.41k]
  ------------------
 3624|  13.1k|               it = content_start;
 3625|  13.1k|               return content_indent;
 3626|  13.1k|            }
 3627|  16.5k|         }
 3628|       |
 3629|   805k|         it = content_start;
 3630|   805k|         return -1;
 3631|   818k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4625|   697k|            {
 4626|       |               // emplace is a no-op for keys the document already wrote, so only
 4627|       |               // untouched pre-existing entries are put back.
 4628|   697k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4628:33): [True: 0, False: 697k]
  ------------------
 4629|      0|                  target.emplace(entry.first, std::move(entry.second));
 4630|      0|               }
 4631|   697k|            }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   113k|      {
 5284|   113k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   113k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   113k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   113k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   113k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 113k, False: 0]
  ------------------
 5294|   113k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   113k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4176|   117k|      {
 4177|   117k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4177:14): [True: 0, False: 117k]
  ------------------
 4178|      0|            return;
 4179|       |
 4180|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4181|   117k|         auto peek = it;
 4182|   117k|         yaml::node_preamble_state preamble{};
 4183|   117k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4183:14): [True: 5.39k, False: 111k]
  ------------------
 4184|   117k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4185|  5.39k|            it = peek;
 4186|  5.39k|            return;
 4187|  5.39k|         }
 4188|       |
 4189|   111k|         if (*peek == '[') {
  ------------------
  |  Branch (4189:14): [True: 38.7k, False: 73.2k]
  ------------------
 4190|       |            // Flow sequence - consume whitespace and parse
 4191|  38.7k|            it = peek;
 4192|  38.7k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4193|  38.7k|         }
 4194|  73.2k|         else if (*peek == '-') {
  ------------------
  |  Branch (4194:19): [True: 73.1k, False: 82]
  ------------------
 4195|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4196|       |            // But if there was a tag, we need to advance past it
 4197|  73.1k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4197:17): [True: 335, False: 72.8k]
  |  Branch (4197:57): [True: 2.00k, False: 70.8k]
  ------------------
 4198|  2.34k|               it = peek;
 4199|  2.34k|            }
 4200|  73.1k|            int32_t seq_indent = ctx.current_indent();
 4201|  73.1k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4201:17): [True: 72.9k, False: 219]
  |  Branch (4201:31): [True: 41.2k, False: 31.6k]
  ------------------
 4202|  41.2k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4202:29): [True: 17.5k, False: 23.7k]
  |  Branch (4202:62): [True: 16.8k, False: 725]
  ------------------
 4203|  41.2k|                                                          : (ctx.current_indent() + 1);
 4204|  41.2k|            }
 4205|  73.1k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4206|  73.1k|         }
 4207|     82|         else {
 4208|     82|            ctx.error = error_code::syntax_error;
 4209|     82|         }
 4210|       |
 4211|   111k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4212|   111k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_ZNS_4fromILj450ESC_E2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSG_SD_TkNS_10is_contextERSE_SG_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSP_RSS_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   117k|      {
  466|   117k|         skip_inline_ws(it, end);
  467|       |
  468|   117k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 10, False: 117k]
  ------------------
  469|     10|            if constexpr (!AllowEmptyInput) {
  470|     10|               ctx.error = error_code::unexpected_end;
  471|     10|            }
  472|     10|            return true;
  473|     10|         }
  474|       |
  475|   117k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   117k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 117k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|   117k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 117k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   117k|         skip_inline_ws(it, end);
  486|       |
  487|   117k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 117k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|   117k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.38k, False: 111k]
  ------------------
  495|  5.38k|            return true;
  496|  5.38k|         }
  497|       |
  498|   111k|         return false;
  499|   117k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_ENKUlNSH_8yaml_tagEE_clESR_:
 4184|   117k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   117k|      {
  409|   117k|         state.has_anchor = false;
  410|   117k|         state.anchor_name.clear();
  411|   117k|         state.anchor_start = nullptr;
  412|   117k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   117k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   117k|            else {
  421|   117k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.34k, False: 112k]
  ------------------
  422|   117k|            }
  423|   117k|         }
  424|       |
  425|   117k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 112k, False: 5.34k]
  |  Branch (425:27): [True: 2.71k, False: 109k]
  ------------------
  426|  2.71k|            ++it;
  427|  2.71k|            auto name = parse_anchor_name(it, end);
  428|  2.71k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 6, False: 2.71k]
  ------------------
  429|      6|               ctx.error = error_code::syntax_error;
  430|      6|               return true;
  431|      6|            }
  432|  2.71k|            skip_inline_ws(it, end);
  433|  2.71k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 25, False: 2.68k]
  ------------------
  434|     25|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     25|                  ctx.error = error_code::unexpected_end;
  436|     25|               }
  437|     25|               return true;
  438|     25|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  2.68k|            state.has_anchor = true;
  446|  2.68k|            state.anchor_name = std::string(name);
  447|  2.68k|            state.anchor_start = &*it;
  448|  2.68k|         }
  449|       |
  450|   117k|         return false;
  451|   117k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   117k|      {
  301|   117k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 117k]
  |  Branch (301:27): [True: 112k, False: 5.34k]
  ------------------
  302|       |
  303|  5.34k|         ++it; // skip '*'
  304|  5.34k|         auto name = parse_anchor_name(it, end);
  305|  5.34k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 9, False: 5.34k]
  ------------------
  306|      9|            ctx.error = error_code::syntax_error;
  307|      9|            return true;
  308|      9|         }
  309|       |
  310|  5.34k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.34k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 19, False: 5.32k]
  ------------------
  312|     19|            ctx.error = error_code::syntax_error; // undefined alias
  313|     19|            return true;
  314|     19|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  5.32k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.32k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.22k, False: 4.09k]
  ------------------
  322|  1.22k|            return true;
  323|  1.22k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  4.09k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 13, False: 4.08k]
  ------------------
  329|     13|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     13|            return true;
  331|     13|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  4.08k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.08k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 4.08k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  4.08k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.08k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  4.08k|         auto replay_it = span.begin;
  348|  4.08k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.08k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.08k|         ctx.indent_stack.clear();
  353|  4.08k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 920, False: 3.16k]
  ------------------
  354|    920|            ctx.push_indent(span.base_indent - 1);
  355|    920|         }
  356|       |
  357|  4.08k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.08k|         using V = std::remove_cvref_t<T>;
  360|  4.08k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.08k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.08k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.08k|         return true;
  367|  4.08k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  38.7k|      {
 2665|  38.7k|         using V = std::remove_cvref_t<T>;
 2666|  38.7k|         using value_type = typename V::value_type;
 2667|       |
 2668|  38.7k|         struct sequence_container_adapter
 2669|  38.7k|         {
 2670|  38.7k|            size_t index = 0;
 2671|       |
 2672|  38.7k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  38.7k|            {
 2674|  38.7k|               if constexpr (!resizable<V>) {
 2675|  38.7k|                  return index >= container.size();
 2676|  38.7k|               }
 2677|  38.7k|               else {
 2678|  38.7k|                  (void)container;
 2679|  38.7k|                  return false;
 2680|  38.7k|               }
 2681|  38.7k|            }
 2682|       |
 2683|  38.7k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  38.7k|            inline void append(V& container, value_type&& element) noexcept
 2686|  38.7k|            {
 2687|  38.7k|               if constexpr (emplace_backable<V>) {
 2688|  38.7k|                  container.emplace_back(std::move(element));
 2689|  38.7k|               }
 2690|  38.7k|               else if constexpr (emplaceable<V>) {
 2691|  38.7k|                  container.emplace(std::move(element));
 2692|  38.7k|               }
 2693|  38.7k|            }
 2694|  38.7k|         };
 2695|       |
 2696|  38.7k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 38.7k]
  |  Branch (2696:27): [True: 0, False: 38.7k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|  38.7k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  38.7k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  38.7k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  38.7k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 13, False: 38.7k]
  ------------------
 2709|     13|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  38.7k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 38.1k, False: 551]
  |  Branch (2712:27): [True: 7.69k, False: 30.4k]
  ------------------
 2713|  7.69k|            ++it;
 2714|  7.69k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  7.69k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 22, False: 7.67k]
  ------------------
 2716|     22|               return;
 2717|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|       |               if (ctx.current_indent() < 0) {
 2719|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|       |               }
 2721|       |            }
 2722|  7.67k|            return;
 2723|  7.69k|         }
 2724|       |
 2725|  31.0k|         bool just_saw_comma = false;
 2726|  31.0k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  31.0k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|  53.1k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 52.2k, False: 878]
  ------------------
 2731|  52.2k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|  52.2k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 52.2k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|  52.2k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 52.2k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|  52.2k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 4.87k, False: 47.4k]
  ------------------
 2741|  4.87k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 4.87k, False: 0]
  ------------------
 2742|  4.87k|                     ++it;
 2743|  4.87k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  4.87k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 4, False: 4.87k]
  ------------------
 2745|      4|                        return;
 2746|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|       |                        if (ctx.current_indent() < 0) {
 2748|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|       |                        }
 2750|       |                     }
 2751|  4.87k|                     return;
 2752|  4.87k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  4.87k|               }
 2756|       |
 2757|  47.4k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 40, False: 47.3k]
  |  Branch (2757:34): [True: 10, False: 47.3k]
  ------------------
 2758|     50|                  ctx.error = error_code::syntax_error;
 2759|     50|                  return;
 2760|     50|               }
 2761|  47.3k|               just_saw_comma = false;
 2762|       |
 2763|  47.3k|               value_type element{};
 2764|  47.3k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|  47.3k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 8.25k, False: 39.1k]
  ------------------
 2767|  8.25k|                  return;
 2768|       |
 2769|  39.1k|               bool saw_line_break_before_separator = false;
 2770|  39.1k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|  39.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 20, False: 39.0k]
  ------------------
 2772|     20|                  return;
 2773|       |
 2774|  39.0k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 38.1k, False: 911]
  |  Branch (2774:33): [True: 5.66k, False: 32.5k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  5.66k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 11, False: 5.65k]
  ------------------
 2777|     11|                     ctx.error = error_code::syntax_error;
 2778|     11|                     return;
 2779|     11|                  }
 2780|  5.65k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  5.65k|                     glz::generic key_node = std::move(element);
 2782|  5.65k|                     ++it;
 2783|  5.65k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  5.65k|                     glz::generic mapped{};
 2786|  5.65k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  5.65k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 582, False: 5.07k]
  ------------------
 2788|    582|                        return;
 2789|       |
 2790|  5.07k|                     std::string key;
 2791|  5.07k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 2, False: 5.07k]
  ------------------
 2792|      2|                        return;
 2793|       |
 2794|  5.07k|                     glz::generic pair{};
 2795|  5.07k|                     pair[key] = std::move(mapped);
 2796|  5.07k|                     element = std::move(pair);
 2797|       |
 2798|  5.07k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  5.07k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 1, False: 5.07k]
  ------------------
 2800|      1|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  5.65k|               }
 2807|       |
 2808|  39.0k|               adapter.append(value, std::move(element));
 2809|       |
 2810|  39.0k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 942, False: 38.1k]
  ------------------
 2811|    942|                  ctx.error = error_code::unexpected_end;
 2812|    942|                  return;
 2813|    942|               }
 2814|       |
 2815|  38.1k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 14.9k, False: 23.2k]
  ------------------
 2816|  14.9k|                  ++it;
 2817|  14.9k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  14.9k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 24, False: 14.8k]
  ------------------
 2819|     24|                     return;
 2820|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|       |                     if (ctx.current_indent() < 0) {
 2822|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|       |                     }
 2824|       |                  }
 2825|  14.8k|                  return;
 2826|  14.9k|               }
 2827|  23.2k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 22.1k, False: 1.08k]
  ------------------
 2828|  22.1k|                  ++it;
 2829|  22.1k|                  just_saw_comma = true;
 2830|  22.1k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  22.1k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 10, False: 22.1k]
  ------------------
 2832|     10|                     return;
 2833|  22.1k|               }
 2834|  1.08k|               else {
 2835|  1.08k|                  ctx.error = error_code::syntax_error;
 2836|  1.08k|                  return;
 2837|  1.08k|               }
 2838|  38.1k|            }
 2839|       |         }
 2840|       |         else if constexpr (!resizable<V>) {
 2841|       |            // Fixed-size containers (std::array)
 2842|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2843|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2844|       |               if (bool(ctx.error)) [[unlikely]]
 2845|       |                  return;
 2846|       |
 2847|       |               if (it == end) [[unlikely]] {
 2848|       |                  ctx.error = error_code::unexpected_end;
 2849|       |                  return;
 2850|       |               }
 2851|       |
 2852|       |               if (*it == ']') {
 2853|       |                  if (just_saw_comma) {
 2854|       |                     ++it;
 2855|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2856|       |                     if (bool(ctx.error)) [[unlikely]]
 2857|       |                        return;
 2858|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2859|       |                        if (ctx.current_indent() < 0) {
 2860|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2861|       |                        }
 2862|       |                     }
 2863|       |                     return;
 2864|       |                  }
 2865|       |                  ctx.error = error_code::syntax_error;
 2866|       |                  return;
 2867|       |               }
 2868|       |
 2869|       |               if (*it == ',' || *it == '#') {
 2870|       |                  ctx.error = error_code::syntax_error;
 2871|       |                  return;
 2872|       |               }
 2873|       |               just_saw_comma = false;
 2874|       |
 2875|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2876|       |
 2877|       |               if (bool(ctx.error)) [[unlikely]]
 2878|       |                  return;
 2879|       |
 2880|       |               adapter.commit_fixed_slot();
 2881|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2882|       |               if (bool(ctx.error)) [[unlikely]]
 2883|       |                  return;
 2884|       |
 2885|       |               if (it == end) [[unlikely]] {
 2886|       |                  ctx.error = error_code::unexpected_end;
 2887|       |                  return;
 2888|       |               }
 2889|       |
 2890|       |               if (*it == ']') {
 2891|       |                  ++it;
 2892|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2893|       |                  if (bool(ctx.error)) [[unlikely]]
 2894|       |                     return;
 2895|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2896|       |                     if (ctx.current_indent() < 0) {
 2897|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2898|       |                     }
 2899|       |                  }
 2900|       |                  return;
 2901|       |               }
 2902|       |               else if (*it == ',') {
 2903|       |                  ++it;
 2904|       |                  just_saw_comma = true;
 2905|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2906|       |                  if (bool(ctx.error)) [[unlikely]]
 2907|       |                     return;
 2908|       |               }
 2909|       |               else {
 2910|       |                  ctx.error = error_code::syntax_error;
 2911|       |                  return;
 2912|       |               }
 2913|       |            }
 2914|       |
 2915|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2916|       |            // skip to the closing bracket to consume overflow elements.
 2917|       |            int bracket_depth = 1;
 2918|       |            while (it != end && bracket_depth > 0) {
 2919|       |               if (*it == '[') {
 2920|       |                  ++bracket_depth;
 2921|       |               }
 2922|       |               else if (*it == ']') {
 2923|       |                  --bracket_depth;
 2924|       |               }
 2925|       |               ++it;
 2926|       |            }
 2927|       |         }
 2928|       |         else {
 2929|       |            ctx.error = error_code::syntax_error;
 2930|       |            return;
 2931|       |         }
 2932|  31.0k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   111k|      {
 2649|   111k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   111k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   111k|               value.clear();
 2653|   111k|            }
 2654|       |         }
 2655|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2656|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2657|       |            value.clear();
 2658|       |         }
 2659|   111k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2686|  38.4k|            {
 2687|  38.4k|               if constexpr (emplace_backable<V>) {
 2688|  38.4k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|  38.4k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|  73.1k|      {
 3160|  73.1k|         using V = std::remove_cvref_t<T>;
 3161|  73.1k|         using value_type = typename V::value_type;
 3162|       |
 3163|  73.1k|         struct sequence_container_adapter
 3164|  73.1k|         {
 3165|  73.1k|            size_t index = 0;
 3166|       |
 3167|  73.1k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|  73.1k|            {
 3169|  73.1k|               if constexpr (!resizable<V>) {
 3170|  73.1k|                  return index >= container.size();
 3171|  73.1k|               }
 3172|  73.1k|               else {
 3173|  73.1k|                  (void)container;
 3174|  73.1k|                  return false;
 3175|  73.1k|               }
 3176|  73.1k|            }
 3177|       |
 3178|  73.1k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|  73.1k|            inline void append(V& container, value_type&& element) noexcept
 3181|  73.1k|            {
 3182|  73.1k|               if constexpr (emplace_backable<V>) {
 3183|  73.1k|                  container.emplace_back(std::move(element));
 3184|  73.1k|               }
 3185|  73.1k|               else if constexpr (emplaceable<V>) {
 3186|  73.1k|                  container.emplace(std::move(element));
 3187|  73.1k|               }
 3188|  73.1k|            }
 3189|  73.1k|         };
 3190|       |
 3191|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3192|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3193|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3194|  73.1k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|  73.1k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|  73.1k|         bool first_item = true;
 3200|  73.1k|         bool has_pending_item_anchor = false;
 3201|  73.1k|         std::string pending_item_anchor_name{};
 3202|  73.1k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   178k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 159k, False: 18.6k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   159k|            int32_t line_indent = 0;
 3215|   159k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   159k|            auto line_start = it;
 3217|       |
 3218|   214k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 205k, False: 8.62k]
  ------------------
 3219|   205k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 7.30k, False: 198k]
  ------------------
 3220|  7.30k|                  skip_comment(it, end);
 3221|  7.30k|                  skip_newline(it, end);
 3222|  7.30k|                  line_start = it;
 3223|  7.30k|                  line_indent = 0;
 3224|  7.30k|               }
 3225|   198k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 11.2k, False: 187k]
  |  Branch (3225:40): [True: 28.5k, False: 158k]
  ------------------
 3226|  39.8k|                  skip_newline(it, end);
 3227|  39.8k|                  line_start = it;
 3228|  39.8k|                  line_indent = 0;
 3229|  39.8k|               }
 3230|   158k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 14.8k, False: 143k]
  ------------------
 3231|  14.8k|                  line_start = it;
 3232|  14.8k|                  line_indent = 0;
 3233|   222k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 221k, False: 1.76k]
  |  Branch (3233:39): [True: 208k, False: 13.1k]
  ------------------
 3234|   208k|                     ++line_indent;
 3235|   208k|                     ++it;
 3236|   208k|                  }
 3237|       |
 3238|  14.8k|                  bool saw_tab = false;
 3239|  16.5k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 14.4k, False: 2.05k]
  |  Branch (3239:40): [True: 532, False: 13.9k]
  |  Branch (3239:54): [True: 1.10k, False: 12.8k]
  ------------------
 3240|  1.63k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 933, False: 701]
  |  Branch (3240:43): [True: 701, False: 0]
  ------------------
 3241|  1.63k|                     ++it;
 3242|  1.63k|                  }
 3243|       |
 3244|  14.8k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 2.05k, False: 12.8k]
  |  Branch (3244:36): [True: 671, False: 12.1k]
  |  Branch (3244:51): [True: 1.13k, False: 11.0k]
  |  Branch (3244:66): [True: 2.24k, False: 8.77k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  6.10k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 4.04k, False: 2.05k]
  |  Branch (3246:39): [True: 2.24k, False: 1.80k]
  ------------------
 3247|  2.24k|                        skip_comment(it, end);
 3248|  2.24k|                     }
 3249|  6.10k|                     line_indent = 0;
 3250|  6.10k|                     continue;
 3251|  6.10k|                  }
 3252|       |
 3253|  8.77k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 16, False: 8.76k]
  ------------------
 3254|     16|                     ctx.error = error_code::syntax_error;
 3255|     16|                     return;
 3256|     16|                  }
 3257|  8.76k|                  break; // Found content
 3258|  8.77k|               }
 3259|   143k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 1.96k, False: 141k]
  ------------------
 3260|  1.96k|                  line_start = it;
 3261|  6.25k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 5.94k, False: 307]
  |  Branch (3261:40): [True: 1.32k, False: 4.62k]
  |  Branch (3261:54): [True: 2.96k, False: 1.66k]
  ------------------
 3262|  1.96k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 307, False: 1.66k]
  |  Branch (3262:36): [True: 429, False: 1.23k]
  |  Branch (3262:51): [True: 341, False: 890]
  |  Branch (3262:66): [True: 870, False: 20]
  ------------------
 3263|  1.94k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 1.64k, False: 307]
  |  Branch (3263:39): [True: 870, False: 770]
  ------------------
 3264|    870|                        skip_comment(it, end);
 3265|    870|                     }
 3266|  1.94k|                     line_indent = 0;
 3267|  1.94k|                     continue;
 3268|  1.94k|                  }
 3269|     20|                  ctx.error = error_code::syntax_error;
 3270|     20|                  return;
 3271|  1.96k|               }
 3272|   141k|               else {
 3273|       |                  // At content (no leading space on this line)
 3274|       |                  // If first item and at '-', whitespace was consumed by caller;
 3275|       |                  // treat as having correct indentation
 3276|   141k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 73.1k, False: 68.8k]
  |  Branch (3276:37): [True: 72.9k, False: 218]
  ------------------
 3277|  72.9k|                     line_indent = sequence_indent;
 3278|  72.9k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|  72.9k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 72.9k, False: 0]
  |  Branch (3279:49): [True: 72.9k, False: 0]
  ------------------
 3280|  72.9k|                           auto probe = it;
 3281|  72.9k|                           int32_t leading_ws = 0;
 3282|  72.9k|                           bool saw_tab = false;
 3283|   167k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 167k, False: 0]
  |  Branch (3283:64): [True: 88.6k, False: 78.7k]
  |  Branch (3283:87): [True: 5.84k, False: 72.9k]
  ------------------
 3284|  94.5k|                              --probe;
 3285|  94.5k|                              ++leading_ws;
 3286|  94.5k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 4.02k, False: 90.5k]
  |  Branch (3286:52): [True: 3.42k, False: 87.0k]
  ------------------
 3287|  94.5k|                           }
 3288|  72.9k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 0, False: 72.9k]
  |  Branch (3288:61): [True: 3.66k, False: 69.2k]
  |  Branch (3288:85): [True: 26.4k, False: 42.8k]
  ------------------
 3289|  30.0k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 4, False: 30.0k]
  ------------------
 3290|      4|                                 ctx.error = error_code::syntax_error;
 3291|      4|                                 return;
 3292|      4|                              }
 3293|  30.0k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  30.0k|                           }
 3295|  72.9k|                        }
 3296|  72.9k|                     }
 3297|  72.9k|                  }
 3298|  72.9k|                  break;
 3299|   141k|               }
 3300|   205k|            }
 3301|       |
 3302|   159k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 8.62k, False: 150k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   150k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 1.99k, False: 148k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   148k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 15.8k, False: 132k]
  ------------------
 3309|  15.8k|               it = line_start;
 3310|  15.8k|               return;
 3311|  15.8k|            }
 3312|       |
 3313|   132k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 6.70k, False: 126k]
  ------------------
 3314|       |               // Standalone anchor lines before "- item" are only supported for
 3315|       |               // indentless mapping values. At top-level block sequences these are
 3316|       |               // malformed in yaml-test-suite cases.
 3317|  6.70k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 6, False: 6.70k]
  ------------------
 3318|      6|                  ctx.error = error_code::syntax_error;
 3319|      6|                  return;
 3320|      6|               }
 3321|       |
 3322|  6.70k|               ++it;
 3323|  6.70k|               auto pending_name = parse_anchor_name(it, end);
 3324|  6.70k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 10, False: 6.69k]
  ------------------
 3325|     10|                  ctx.error = error_code::syntax_error;
 3326|     10|                  return;
 3327|     10|               }
 3328|  6.69k|               skip_inline_ws(it, end);
 3329|  6.69k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 6.64k, False: 42]
  |  Branch (3329:33): [True: 659, False: 5.98k]
  ------------------
 3330|    659|                  skip_comment(it, end);
 3331|    659|               }
 3332|       |
 3333|  6.69k|               has_pending_item_anchor = true;
 3334|  6.69k|               pending_item_anchor_name = std::string(pending_name);
 3335|  6.69k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  6.69k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 49, False: 6.64k]
  |  Branch (3337:34): [True: 3.75k, False: 2.88k]
  |  Branch (3337:49): [True: 48, False: 3.71k]
  ------------------
 3338|     97|                  ctx.error = error_code::syntax_error;
 3339|     97|                  return;
 3340|     97|               }
 3341|       |
 3342|  6.59k|               skip_newline(it, end);
 3343|  6.59k|               continue;
 3344|  6.69k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   126k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 23.9k, False: 102k]
  ------------------
 3348|  23.9k|               it = line_start;
 3349|  23.9k|               return;
 3350|  23.9k|            }
 3351|       |
 3352|       |            // Compute the actual column of this sequence dash.
 3353|       |            // This is needed by plain-scalar multiline folding to distinguish
 3354|       |            // sibling "- item" entries from deeper "- " continuation content.
 3355|   102k|            dash_col = line_indent;
 3356|   102k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   102k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 102k, False: 4]
  ------------------
 3358|   102k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   102k|               }
 3360|   102k|            }
 3361|       |
 3362|   102k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   102k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 97.7k, False: 4.54k]
  |  Branch (3365:30): [True: 3.26k, False: 94.4k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  3.26k|               it = line_start;
 3368|  3.26k|               return;
 3369|  3.26k|            }
 3370|       |
 3371|  98.9k|            bool saw_tab_after_dash = false;
 3372|   182k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 176k, False: 6.02k]
  |  Branch (3372:34): [True: 56.8k, False: 119k]
  |  Branch (3372:48): [True: 26.2k, False: 92.9k]
  ------------------
 3373|  83.1k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 878, False: 82.2k]
  |  Branch (3373:59): [True: 25.7k, False: 56.5k]
  ------------------
 3374|  83.1k|               ++it;
 3375|  83.1k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|  98.9k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 25.7k, False: 73.2k]
  |  Branch (3377:39): [True: 25.3k, False: 397]
  |  Branch (3377:52): [True: 365, False: 24.9k]
  ------------------
 3378|    365|               const auto after_dash = it + 1;
 3379|    365|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 4, False: 361]
  |  Branch (3379:41): [True: 2, False: 359]
  ------------------
 3380|      6|                  ctx.error = error_code::syntax_error;
 3381|      6|                  return;
 3382|      6|               }
 3383|    365|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|  98.9k|            auto parse_element = [&](auto& element) {
 3387|  98.9k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|  98.9k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|  98.9k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|  98.9k|                     return;
 3397|  98.9k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|  98.9k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|  98.9k|                  ctx.sequence_item_value_context = true;
 3400|  98.9k|                  ctx.sequence_dash_indent = dash_col;
 3401|  98.9k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|  98.9k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|  98.9k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|  98.9k|                  ctx.pop_indent();
 3405|  98.9k|               }
 3406|  98.9k|               else {
 3407|       |                  // Value on next line - nested block
 3408|  98.9k|                  skip_ws_and_comment(it, end);
 3409|  98.9k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|  98.9k|                  auto nested_start = it;
 3413|  98.9k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|  98.9k|                  if (bool(ctx.error)) [[unlikely]]
 3415|  98.9k|                     return;
 3416|  98.9k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|  98.9k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|  98.9k|                  if (nested_indent > effective_line_indent) {
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  98.9k|                     const int32_t element_indent =
 3428|  98.9k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|  98.9k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|  98.9k|                        return;
 3431|  98.9k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  98.9k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  98.9k|                     ctx.sequence_item_value_context = true;
 3434|  98.9k|                     ctx.sequence_dash_indent = dash_col;
 3435|  98.9k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  98.9k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  98.9k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  98.9k|                     ctx.pop_indent();
 3439|  98.9k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|  98.9k|               }
 3442|       |
 3443|  98.9k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|  98.9k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|  98.9k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  98.9k|                                                                      pending_item_anchor_indent};
 3447|  98.9k|                  has_pending_item_anchor = false;
 3448|  98.9k|               }
 3449|  98.9k|            };
 3450|       |
 3451|  98.9k|            if constexpr (emplace_backable<V>) {
 3452|  98.9k|               auto& element = value.emplace_back();
 3453|  98.9k|               parse_element(element);
 3454|       |            }
 3455|       |            else if constexpr (emplaceable<V>) {
 3456|       |               value_type element{};
 3457|       |               parse_element(element);
 3458|       |               if (!bool(ctx.error)) {
 3459|       |                  adapter.append(value, std::move(element));
 3460|       |               }
 3461|       |            }
 3462|       |            else if constexpr (!resizable<V>) {
 3463|       |               parse_element(value[adapter.index]);
 3464|       |               adapter.commit_fixed_slot();
 3465|       |            }
 3466|       |            else {
 3467|       |               ctx.error = error_code::syntax_error;
 3468|       |               return;
 3469|       |            }
 3470|       |
 3471|  98.9k|            first_item = false;
 3472|       |
 3473|  98.9k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 678, False: 98.3k]
  ------------------
 3474|    678|               return;
 3475|       |
 3476|       |            // Note: after parsing nested block content, iterator may already be
 3477|       |            // at the start of the next line. The outer loop will handle it.
 3478|  98.9k|         }
 3479|  73.1k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3386|  98.9k|            auto parse_element = [&](auto& element) {
 3387|  98.9k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 92.9k, False: 6.02k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|  98.9k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 92.9k, False: 6.02k]
  |  Branch (3390:33): [True: 56.4k, False: 36.5k]
  ------------------
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|  56.4k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 56.4k]
  ------------------
 3396|      0|                     return;
 3397|  56.4k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|  56.4k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|  56.4k|                  ctx.sequence_item_value_context = true;
 3400|  56.4k|                  ctx.sequence_dash_indent = dash_col;
 3401|  56.4k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|  56.4k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|  56.4k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|  56.4k|                  ctx.pop_indent();
 3405|  56.4k|               }
 3406|  42.5k|               else {
 3407|       |                  // Value on next line - nested block
 3408|  42.5k|                  skip_ws_and_comment(it, end);
 3409|  42.5k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|  42.5k|                  auto nested_start = it;
 3413|  42.5k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|  42.5k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 3, False: 42.5k]
  ------------------
 3415|      3|                     return;
 3416|  42.5k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|  42.5k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 4.96k, False: 37.5k]
  ------------------
 3422|  42.5k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 5.96k, False: 36.5k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  5.96k|                     const int32_t element_indent =
 3428|  5.96k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 5.96k]
  ------------------
 3429|  5.96k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 5.96k]
  ------------------
 3430|      0|                        return;
 3431|  5.96k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  5.96k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  5.96k|                     ctx.sequence_item_value_context = true;
 3434|  5.96k|                     ctx.sequence_dash_indent = dash_col;
 3435|  5.96k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  5.96k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  5.96k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  5.96k|                     ctx.pop_indent();
 3439|  5.96k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|  42.5k|               }
 3442|       |
 3443|  98.9k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 2.91k, False: 96.0k]
  |  Branch (3443:47): [True: 2.76k, False: 155]
  ------------------
 3444|  2.76k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 2.34k, False: 412]
  ------------------
 3445|  2.76k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  2.76k|                                                                      pending_item_anchor_indent};
 3447|  2.76k|                  has_pending_item_anchor = false;
 3448|  2.76k|               }
 3449|  98.9k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5503|   372k|   {
 5504|   372k|      if constexpr (yaml::check_flow_context(Opts)) {
 5505|       |         // In flow context, only treat plain content as an implicit "key: value"
 5506|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5507|   372k|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5508|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5509|       |            // once per entry per nesting level over the whole remaining flow collection.
 5510|   372k|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5511|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5512|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5513|       |            // flow-context plain scalar, so every one of them is an indicator.
 5514|   372k|            bool at_node_start = true;
 5515|   372k|            int depth = 0;
 5516|   372k|            while (pos != stop) {
 5517|   372k|               const char c = *pos;
 5518|   372k|               if (c == ' ' || c == '\t') {
 5519|   372k|                  ++pos;
 5520|   372k|                  continue;
 5521|   372k|               }
 5522|   372k|               const bool node_start = std::exchange(at_node_start, false);
 5523|       |
 5524|   372k|               if ((c == '"' || c == '\'') && node_start) {
 5525|   372k|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5526|   372k|                  continue;
 5527|   372k|               }
 5528|   372k|               if (c == '[' || c == '{') {
 5529|   372k|                  ++depth;
 5530|   372k|                  at_node_start = true;
 5531|   372k|                  ++pos;
 5532|   372k|                  continue;
 5533|   372k|               }
 5534|   372k|               if (c == ']' || c == '}') {
 5535|   372k|                  if (depth == 0) return false;
 5536|   372k|                  --depth;
 5537|   372k|                  ++pos;
 5538|   372k|                  continue;
 5539|   372k|               }
 5540|   372k|               if (c == ',' && depth == 0) return false;
 5541|   372k|               if (c == ':' && depth == 0) {
 5542|   372k|                  auto next = pos + 1;
 5543|   372k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5544|   372k|               }
 5545|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5546|   372k|               if (c == ',' || c == ':') {
 5547|   372k|                  at_node_start = true;
 5548|   372k|                  ++pos;
 5549|   372k|                  continue;
 5550|   372k|               }
 5551|   372k|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5552|   372k|                  at_node_start = true;
 5553|   372k|                  continue;
 5554|   372k|               }
 5555|   372k|               ++pos;
 5556|   372k|            }
 5557|   372k|            return false;
 5558|   372k|         };
 5559|       |
 5560|   372k|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5560:14): [True: 157k, False: 214k]
  |  Branch (5560:49): [True: 5.47k, False: 209k]
  ------------------
 5561|   163k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5561:17): [True: 140k, False: 22.9k]
  ------------------
 5562|   140k|               return;
 5563|   140k|            }
 5564|  22.9k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5564:17): [True: 3.65k, False: 19.3k]
  ------------------
 5565|  3.65k|               return;
 5566|  3.65k|            }
 5567|  22.9k|         }
 5568|       |
 5569|   228k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5570|   228k|         return;
 5571|   372k|      }
 5572|       |
 5573|   372k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5573:11): [True: 0, False: 372k]
  ------------------
 5574|      0|         return;
 5575|      0|      }
 5576|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5577|   372k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5577:11): [True: 0, False: 372k]
  ------------------
 5578|      0|         return;
 5579|      0|      }
 5580|   372k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5581|   372k|   }
_ZZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_ENKUlT_E_clISO_EEDaSX_:
 5507|   372k|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5508|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5509|       |            // once per entry per nesting level over the whole remaining flow collection.
 5510|   372k|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5511|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5512|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5513|       |            // flow-context plain scalar, so every one of them is an indicator.
 5514|   372k|            bool at_node_start = true;
 5515|   372k|            int depth = 0;
 5516|  5.24M|            while (pos != stop) {
  ------------------
  |  Branch (5516:20): [True: 5.20M, False: 41.6k]
  ------------------
 5517|  5.20M|               const char c = *pos;
 5518|  5.20M|               if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (5518:20): [True: 634k, False: 4.56M]
  |  Branch (5518:32): [True: 90.1k, False: 4.47M]
  ------------------
 5519|   724k|                  ++pos;
 5520|   724k|                  continue;
 5521|   724k|               }
 5522|  4.47M|               const bool node_start = std::exchange(at_node_start, false);
 5523|       |
 5524|  4.47M|               if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (5524:21): [True: 39.4k, False: 4.43M]
  |  Branch (5524:33): [True: 11.6k, False: 4.42M]
  |  Branch (5524:47): [True: 22.9k, False: 28.1k]
  ------------------
 5525|  22.9k|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
  ------------------
  |  Branch (5525:23): [True: 6.80k, False: 16.1k]
  ------------------
 5526|  16.1k|                  continue;
 5527|  22.9k|               }
 5528|  4.45M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5528:20): [True: 96.8k, False: 4.35M]
  |  Branch (5528:32): [True: 50.7k, False: 4.30M]
  ------------------
 5529|   147k|                  ++depth;
 5530|   147k|                  at_node_start = true;
 5531|   147k|                  ++pos;
 5532|   147k|                  continue;
 5533|   147k|               }
 5534|  4.30M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5534:20): [True: 30.1k, False: 4.27M]
  |  Branch (5534:32): [True: 51.7k, False: 4.22M]
  ------------------
 5535|  81.8k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5535:23): [True: 41.6k, False: 40.2k]
  ------------------
 5536|  40.2k|                  --depth;
 5537|  40.2k|                  ++pos;
 5538|  40.2k|                  continue;
 5539|  81.8k|               }
 5540|  4.22M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5540:20): [True: 186k, False: 4.04M]
  |  Branch (5540:32): [True: 92.3k, False: 93.7k]
  ------------------
 5541|  4.13M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5541:20): [True: 270k, False: 3.86M]
  |  Branch (5541:32): [True: 190k, False: 80.6k]
  ------------------
 5542|   190k|                  auto next = pos + 1;
 5543|   190k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5543:26): [True: 2.81k, False: 187k]
  |  Branch (5543:41): [True: 110k, False: 77.0k]
  |  Branch (5543:57): [True: 10.2k, False: 66.8k]
  |  Branch (5543:74): [True: 10.0k, False: 56.7k]
  |  Branch (5543:91): [True: 24.4k, False: 32.2k]
  ------------------
 5544|   190k|               }
 5545|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5546|  3.94M|               if (c == ',' || c == ':') {
  ------------------
  |  Branch (5546:20): [True: 93.7k, False: 3.85M]
  |  Branch (5546:32): [True: 80.6k, False: 3.76M]
  ------------------
 5547|   174k|                  at_node_start = true;
 5548|   174k|                  ++pos;
 5549|   174k|                  continue;
 5550|   174k|               }
 5551|  3.76M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
  ------------------
  |  Branch (5551:20): [True: 472k, False: 3.29M]
  |  Branch (5551:34): [True: 59.5k, False: 412k]
  ------------------
 5552|  59.5k|                  at_node_start = true;
 5553|  59.5k|                  continue;
 5554|  59.5k|               }
 5555|  3.70M|               ++pos;
 5556|  3.70M|            }
 5557|  41.6k|            return false;
 5558|   372k|         };
_ZN3glz26line_could_be_flow_mappingIPKcS2_EEbT_T0_:
 5371|  6.84M|   {
 5372|  6.84M|      const auto stop = yaml::implicit_key_scan_end(it, end);
 5373|  6.84M|      int flow_depth = 0;
 5374|       |      // See `line_could_be_block_mapping` for why the quote guard is the state of the node rather
 5375|       |      // than the preceding character.
 5376|  6.84M|      bool at_node_start = true;
 5377|  6.84M|      bool prev_was_whitespace = true;
 5378|  6.84M|      bool key_supports_adjacent_value = false;
 5379|       |
 5380|  61.1M|      while (it != stop) {
  ------------------
  |  Branch (5380:14): [True: 61.0M, False: 190k]
  ------------------
 5381|  61.0M|         const char c = *it;
 5382|  61.0M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (5382:14): [True: 372k, False: 60.6M]
  |  Branch (5382:27): [True: 337k, False: 60.2M]
  ------------------
 5383|   709k|            return false;
 5384|   709k|         }
 5385|  60.2M|         if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (5385:14): [True: 2.46M, False: 57.8M]
  |  Branch (5385:26): [True: 357k, False: 57.4M]
  ------------------
 5386|  2.82M|            prev_was_whitespace = true;
 5387|  2.82M|            key_supports_adjacent_value = false; // "Adjacent" admits no separation at all
 5388|  2.82M|            ++it;
 5389|  2.82M|            continue;
 5390|  2.82M|         }
 5391|  57.4M|         if (flow_depth == 0 && (c == ',' || c == ']' || c == '}')) {
  ------------------
  |  Branch (5391:14): [True: 39.5M, False: 17.9M]
  |  Branch (5391:34): [True: 4.13M, False: 35.4M]
  |  Branch (5391:46): [True: 94.4k, False: 35.3M]
  |  Branch (5391:58): [True: 185k, False: 35.1M]
  ------------------
 5392|  4.41M|            return false;
 5393|  4.41M|         }
 5394|       |         // As in `line_could_be_block_mapping`, content clears both flags and a branch opts back in.
 5395|  53.0M|         const bool after_whitespace = std::exchange(prev_was_whitespace, false);
 5396|  53.0M|         const bool node_start = std::exchange(at_node_start, false);
 5397|  53.0M|         const bool adjacent_value_ok = std::exchange(key_supports_adjacent_value, false);
 5398|       |
 5399|  53.0M|         if (c == '#' && flow_depth == 0 && after_whitespace) {
  ------------------
  |  Branch (5399:14): [True: 476k, False: 52.5M]
  |  Branch (5399:26): [True: 402k, False: 73.6k]
  |  Branch (5399:45): [True: 35.1k, False: 367k]
  ------------------
 5400|  35.1k|            return false;
 5401|  35.1k|         }
 5402|  53.0M|         if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (5402:15): [True: 3.15M, False: 49.8M]
  |  Branch (5402:27): [True: 79.2k, False: 49.7M]
  |  Branch (5402:41): [True: 2.73M, False: 501k]
  ------------------
 5403|  2.73M|            if (not yaml::skip_probe_quoted_scalar(it, stop)) {
  ------------------
  |  Branch (5403:17): [True: 46.4k, False: 2.68M]
  ------------------
 5404|  46.4k|               return false;
 5405|  46.4k|            }
 5406|  2.68M|            key_supports_adjacent_value = true;
 5407|  2.68M|            continue;
 5408|  2.73M|         }
 5409|  50.2M|         if (c == '[' || c == '{') {
  ------------------
  |  Branch (5409:14): [True: 697k, False: 49.5M]
  |  Branch (5409:26): [True: 351k, False: 49.2M]
  ------------------
 5410|  1.04M|            ++flow_depth;
 5411|  1.04M|            at_node_start = true;
 5412|  1.04M|            ++it;
 5413|  1.04M|            continue;
 5414|  1.04M|         }
 5415|  49.2M|         if (c == ']' || c == '}') {
  ------------------
  |  Branch (5415:14): [True: 77.7k, False: 49.1M]
  |  Branch (5415:26): [True: 59.7k, False: 49.1M]
  ------------------
 5416|   137k|            --flow_depth; // Depth zero returned above, so this closes a collection we opened
 5417|   137k|            if (flow_depth == 0) {
  ------------------
  |  Branch (5417:17): [True: 82.2k, False: 55.2k]
  ------------------
 5418|  82.2k|               key_supports_adjacent_value = true;
 5419|  82.2k|            }
 5420|   137k|            ++it;
 5421|   137k|            continue;
 5422|   137k|         }
 5423|  49.1M|         if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (5423:14): [True: 4.28M, False: 44.8M]
  |  Branch (5423:26): [True: 1.44M, False: 2.83M]
  ------------------
 5424|  1.44M|            const auto next = it + 1;
 5425|  1.44M|            if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (5425:17): [True: 20.7k, False: 1.42M]
  |  Branch (5425:32): [True: 795k, False: 629k]
  |  Branch (5425:48): [True: 98.4k, False: 530k]
  |  Branch (5425:65): [True: 88.8k, False: 441k]
  |  Branch (5425:82): [True: 135k, False: 306k]
  ------------------
 5426|  1.13M|               return true;
 5427|  1.13M|            }
 5428|       |            // A ':' run together with its key is a separator only after a JSON-like key.
 5429|   306k|            return adjacent_value_ok;
 5430|  1.44M|         }
 5431|       |         // Inside a flow collection ',' separates entries and ':' ends a key, so a node begins
 5432|       |         // after either.
 5433|  47.6M|         if (c == ',' || c == ':') {
  ------------------
  |  Branch (5433:14): [True: 2.83M, False: 44.8M]
  |  Branch (5433:26): [True: 2.83M, False: 41.9M]
  ------------------
 5434|  5.67M|            at_node_start = true;
 5435|  5.67M|            ++it;
 5436|  5.67M|            continue;
 5437|  5.67M|         }
 5438|  41.9M|         if (node_start && yaml::skip_probe_node_property(it, stop)) {
  ------------------
  |  Branch (5438:14): [True: 9.33M, False: 32.6M]
  |  Branch (5438:28): [True: 308k, False: 9.02M]
  ------------------
 5439|   308k|            at_node_start = true;
 5440|   308k|            continue;
 5441|   308k|         }
 5442|  41.6M|         ++it;
 5443|  41.6M|      }
 5444|       |
 5445|   190k|      return false;
 5446|  6.84M|   }
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISM_EEDaSZ_:
 5938|  32.3k|            auto is_word_boundary = [&](const auto ptr) {
 5939|  32.3k|               if (ptr == end) {
  ------------------
  |  Branch (5939:20): [True: 1.44k, False: 30.8k]
  ------------------
 5940|  1.44k|                  return true;
 5941|  1.44k|               }
 5942|  30.8k|               if (*ptr == ':') {
  ------------------
  |  Branch (5942:20): [True: 15.5k, False: 15.3k]
  ------------------
 5943|  15.5k|                  auto next = ptr + 1;
 5944|  15.5k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5944:26): [True: 1.02k, False: 14.5k]
  |  Branch (5944:43): [True: 2.13k, False: 12.3k]
  |  Branch (5944:59): [True: 6.18k, False: 6.19k]
  |  Branch (5944:76): [True: 1.62k, False: 4.57k]
  |  Branch (5944:93): [True: 3.24k, False: 1.33k]
  ------------------
 5945|  15.5k|               }
 5946|  15.3k|               return is_plain_scalar_boundary(*ptr);
 5947|  30.8k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5864|  15.3k|            auto is_plain_scalar_boundary = [](const char ch) {
 5865|  15.3k|               switch (ch) {
 5866|  1.02k|               case ' ':
  ------------------
  |  Branch (5866:16): [True: 1.02k, False: 14.3k]
  ------------------
 5867|  2.12k|               case '\t':
  ------------------
  |  Branch (5867:16): [True: 1.10k, False: 14.2k]
  ------------------
 5868|  2.92k|               case '\n':
  ------------------
  |  Branch (5868:16): [True: 794, False: 14.5k]
  ------------------
 5869|  5.01k|               case '\r':
  ------------------
  |  Branch (5869:16): [True: 2.09k, False: 13.2k]
  ------------------
 5870|  9.53k|               case ',':
  ------------------
  |  Branch (5870:16): [True: 4.51k, False: 10.8k]
  ------------------
 5871|  10.0k|               case ']':
  ------------------
  |  Branch (5871:16): [True: 536, False: 14.8k]
  ------------------
 5872|  10.8k|               case '}':
  ------------------
  |  Branch (5872:16): [True: 747, False: 14.5k]
  ------------------
 5873|  10.8k|                  return true;
 5874|  4.52k|               default:
  ------------------
  |  Branch (5874:16): [True: 4.52k, False: 10.8k]
  ------------------
 5875|  4.52k|                  return false;
 5876|  15.3k|               }
 5877|  15.3k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISM_EEDaSZ_:
 5879|  26.4k|            auto has_indented_block_continuation = [&](auto word_end) {
 5880|  26.4k|               if constexpr (yaml::check_flow_context(Opts)) {
 5881|  26.4k|                  return false;
 5882|  26.4k|               }
 5883|  26.4k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5883:20): [True: 0, False: 26.4k]
  ------------------
 5884|      0|                  return false;
 5885|      0|               }
 5886|  26.4k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5886:20): [True: 26.4k, False: 0]
  |  Branch (5886:40): [True: 0, False: 0]
  |  Branch (5886:61): [True: 0, False: 0]
  ------------------
 5887|      0|                  return false;
 5888|      0|               }
 5889|       |
 5890|  26.4k|               auto look = word_end;
 5891|  26.4k|               yaml::skip_newline(look, end);
 5892|  26.4k|               while (look != end) {
  ------------------
  |  Branch (5892:23): [True: 0, False: 26.4k]
  ------------------
 5893|      0|                  int32_t line_indent = 0;
 5894|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5894:26): [True: 0, False: 0]
  |  Branch (5894:41): [True: 0, False: 0]
  ------------------
 5895|      0|                     ++line_indent;
 5896|      0|                     ++look;
 5897|      0|                  }
 5898|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5898:23): [True: 0, False: 0]
  |  Branch (5898:38): [True: 0, False: 0]
  ------------------
 5899|      0|                     return false;
 5900|      0|                  }
 5901|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5901:23): [True: 0, False: 0]
  |  Branch (5901:38): [True: 0, False: 0]
  |  Branch (5901:55): [True: 0, False: 0]
  ------------------
 5902|      0|                     if (look != end) {
  ------------------
  |  Branch (5902:26): [True: 0, False: 0]
  ------------------
 5903|      0|                        yaml::skip_newline(look, end);
 5904|      0|                        continue;
 5905|      0|                     }
 5906|      0|                     return false;
 5907|      0|                  }
 5908|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5908:23): [True: 0, False: 0]
  ------------------
 5909|      0|                     yaml::skip_comment(look, end);
 5910|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5910:26): [True: 0, False: 0]
  |  Branch (5910:42): [True: 0, False: 0]
  |  Branch (5910:59): [True: 0, False: 0]
  ------------------
 5911|      0|                        yaml::skip_newline(look, end);
 5912|      0|                        continue;
 5913|      0|                     }
 5914|      0|                     return false;
 5915|      0|                  }
 5916|       |
 5917|       |                  // If the next non-empty line is an implicit mapping entry,
 5918|       |                  // don't treat it as scalar continuation for auto-deduced
 5919|       |                  // booleans/nulls.
 5920|      0|                  {
 5921|      0|                     auto scan = look;
 5922|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5922:29): [True: 0, False: 0]
  |  Branch (5922:44): [True: 0, False: 0]
  |  Branch (5922:61): [True: 0, False: 0]
  ------------------
 5923|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5923:29): [True: 0, False: 0]
  ------------------
 5924|      0|                           auto after_colon = scan + 1;
 5925|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5925:32): [True: 0, False: 0]
  |  Branch (5925:54): [True: 0, False: 0]
  |  Branch (5925:77): [True: 0, False: 0]
  ------------------
 5926|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5926:32): [True: 0, False: 0]
  |  Branch (5926:56): [True: 0, False: 0]
  ------------------
 5927|      0|                              return false;
 5928|      0|                           }
 5929|      0|                        }
 5930|      0|                        ++scan;
 5931|      0|                     }
 5932|      0|                  }
 5933|       |
 5934|      0|                  return line_indent > ctx.current_indent();
 5935|      0|               }
 5936|  26.4k|               return false;
 5937|  26.4k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5457|   976k|   {
 5458|   976k|      using counts = yaml_variant_type_count<Variant>;
 5459|       |      if constexpr (counts::n_object == 0) {
 5460|       |         return false;
 5461|       |      }
 5462|   976k|      else {
 5463|       |         // Quick check: if no viable mapping separator in the current span,
 5464|       |         // avoid expensive speculative parse.
 5465|   976k|         const bool could_be_mapping = [&] {
 5466|   976k|            if constexpr (yaml::check_flow_context(Opts)) {
 5467|   976k|               return line_could_be_flow_mapping(it, end);
 5468|   976k|            }
 5469|   976k|            else {
 5470|   976k|               return yaml::line_could_be_block_mapping(it, end);
 5471|   976k|            }
 5472|   976k|         }();
 5473|   976k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5473:14): [True: 819k, False: 156k]
  ------------------
 5474|   819k|            return false;
 5475|   819k|         }
 5476|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5477|   156k|         auto temp_ctx = ctx.make_speculative();
 5478|   156k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5479|   156k|                                                                                               end);
 5480|   156k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5481|   156k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5482|   156k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5482:14): [True: 146k, False: 9.25k]
  ------------------
 5483|   146k|            ctx.anchors = std::move(temp_ctx.anchors);
 5484|   146k|            return true;
 5485|   146k|         }
 5486|       |         // The line matched "key: value" pattern but parsing failed.
 5487|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5488|       |         // so propagate the error rather than silently falling back to string.
 5489|  9.25k|         ctx.error = temp_ctx.error;
 5490|  9.25k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5491|  9.25k|         return false;
 5492|   156k|      }
 5493|   976k|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5465|   976k|         const bool could_be_mapping = [&] {
 5466|   976k|            if constexpr (yaml::check_flow_context(Opts)) {
 5467|   976k|               return line_could_be_flow_mapping(it, end);
 5468|       |            }
 5469|       |            else {
 5470|       |               return yaml::line_could_be_block_mapping(it, end);
 5471|       |            }
 5472|   976k|         }();
_ZN3glz4yaml15materialize_keyILb1ENS0_12yaml_contextEEEbRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERT0_:
   38|  3.85M|   {
   39|  3.85M|      if constexpr (empty_on_null) {
   40|  3.85M|         if (key_node.is_null()) {
  ------------------
  |  Branch (40:14): [True: 165k, False: 3.68M]
  ------------------
   41|   165k|            key.clear();
   42|   165k|            return true;
   43|   165k|         }
   44|  3.85M|      }
   45|  3.85M|      if (auto* s = key_node.template get_if<std::string>()) {
  ------------------
  |  Branch (45:17): [True: 764k, False: 3.08M]
  ------------------
   46|   764k|         key = *s;
   47|   764k|         return true;
   48|   764k|      }
   49|  3.08M|      key.clear();
   50|  3.08M|      (void)glz::write_json(key_node, key);
   51|  3.08M|      if constexpr (requires { ctx.charge_key_expansion(size_t{}); }) {
   52|  3.08M|         if (!ctx.charge_key_expansion(key.size())) [[unlikely]] {
  ------------------
  |  Branch (52:14): [True: 344, False: 3.08M]
  ------------------
   53|    344|            ctx.error = error_code::exceeded_max_expansion;
   54|    344|            ctx.custom_error_message = "complex key expansion";
   55|    344|            return false;
   56|    344|         }
   57|  3.08M|      }
   58|  3.08M|      return true;
   59|  3.85M|   }
_ZN3glz4yaml14parse_yaml_keyINS0_12yaml_contextEPKcS4_EEbRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_b:
 1576|  13.4M|      {
 1577|  13.4M|         key.clear();
 1578|  13.4M|         skip_inline_ws(it, end);
 1579|       |
 1580|  13.4M|         if (it == end) {
  ------------------
  |  Branch (1580:14): [True: 122, False: 13.4M]
  ------------------
 1581|    122|            ctx.error = error_code::unexpected_end;
 1582|    122|            return false;
 1583|    122|         }
 1584|       |
 1585|  13.4M|         auto validate_key_tag = [&](const yaml_tag tag) {
 1586|  13.4M|            if (tag == yaml_tag::unknown) {
 1587|  13.4M|               ctx.error = error_code::syntax_error;
 1588|  13.4M|               return false;
 1589|  13.4M|            }
 1590|  13.4M|            if (!tag_valid_for_string(tag)) {
 1591|  13.4M|               ctx.error = error_code::syntax_error;
 1592|  13.4M|               return false;
 1593|  13.4M|            }
 1594|  13.4M|            return true;
 1595|  13.4M|         };
 1596|       |
 1597|       |         // Tags on keys (e.g. "!!str : value")
 1598|  13.4M|         auto key_tag = parse_yaml_tag(it, end, ctx);
 1599|  13.4M|         if (!validate_key_tag(key_tag)) {
  ------------------
  |  Branch (1599:14): [True: 150, False: 13.4M]
  ------------------
 1600|    150|            return false;
 1601|    150|         }
 1602|  13.4M|         skip_inline_ws(it, end);
 1603|  13.4M|         if (it == end) {
  ------------------
  |  Branch (1603:14): [True: 180, False: 13.4M]
  ------------------
 1604|    180|            ctx.error = error_code::unexpected_end;
 1605|    180|            return false;
 1606|    180|         }
 1607|       |
 1608|       |         // Handle alias as key (*name resolves to anchor value)
 1609|  13.4M|         if (*it == '*') {
  ------------------
  |  Branch (1609:14): [True: 1.58M, False: 11.8M]
  ------------------
 1610|  1.58M|            ++it;
 1611|  1.58M|            auto name = parse_anchor_name(it, end);
 1612|  1.58M|            if (name.empty()) {
  ------------------
  |  Branch (1612:17): [True: 622, False: 1.58M]
  ------------------
 1613|    622|               ctx.error = error_code::syntax_error;
 1614|    622|               return false;
 1615|    622|            }
 1616|  1.58M|            auto anchor_it = ctx.anchors.find(name);
 1617|  1.58M|            if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (1617:17): [True: 8.47k, False: 1.58M]
  ------------------
 1618|  8.47k|               ctx.error = error_code::syntax_error; // undefined alias
 1619|  8.47k|               return false;
 1620|  8.47k|            }
 1621|  1.58M|            auto& span = anchor_it->second;
 1622|  1.58M|            if (span.begin == span.end) {
  ------------------
  |  Branch (1622:17): [True: 112k, False: 1.46M]
  ------------------
 1623|   112k|               key.clear(); // empty anchor
 1624|   112k|            }
 1625|  1.46M|            else if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (1625:22): [True: 70, False: 1.46M]
  ------------------
 1626|       |               // A key alias replays its anchor the same way a value alias does, and a complex
 1627|       |               // key hands the span to the full reader, so it is charged the same way.
 1628|     70|               ctx.error = error_code::exceeded_max_expansion;
 1629|     70|               ctx.custom_error_message = "alias expansion";
 1630|     70|               return false;
 1631|     70|            }
 1632|  1.46M|            else {
 1633|       |               // Replay the anchor span to extract the key string
 1634|  1.46M|               auto replay_it = span.begin;
 1635|  1.46M|               auto replay_end = span.end;
 1636|  1.46M|               if (*replay_it == '"') {
  ------------------
  |  Branch (1636:20): [True: 1.84k, False: 1.46M]
  ------------------
 1637|  1.84k|                  parse_double_quoted_string(key, ctx, replay_it, replay_end);
 1638|  1.84k|               }
 1639|  1.46M|               else if (*replay_it == '\'') {
  ------------------
  |  Branch (1639:25): [True: 2.08k, False: 1.46M]
  ------------------
 1640|  2.08k|                  parse_single_quoted_string(key, ctx, replay_it, replay_end);
 1641|  2.08k|               }
 1642|  1.46M|               else if (*replay_it == '[' || *replay_it == '{') {
  ------------------
  |  Branch (1642:25): [True: 19.3k, False: 1.44M]
  |  Branch (1642:46): [True: 576k, False: 867k]
  ------------------
 1643|       |                  // Canonicalize complex alias keys (flow seq/map) to a stable string form.
 1644|   595k|                  glz::generic key_node{};
 1645|   595k|                  auto temp_ctx = ctx.make_speculative();
 1646|   595k|                  from<YAML, glz::generic>::template op<flow_context_on<opts{.error_on_unknown_keys = false}>()>(
 1647|   595k|                     key_node, temp_ctx, replay_it, replay_end);
 1648|   595k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 1649|   595k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 1650|   595k|                  if (bool(temp_ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1650:23): [True: 76.5k, False: 519k]
  ------------------
 1651|  76.5k|                     ctx.error = temp_ctx.error;
 1652|  76.5k|                     ctx.custom_error_message = temp_ctx.custom_error_message;
 1653|  76.5k|                     return false;
 1654|  76.5k|                  }
 1655|   519k|                  ctx.anchors = std::move(temp_ctx.anchors);
 1656|       |
 1657|   519k|                  if (!yaml::materialize_key<false>(key, key_node, ctx)) [[unlikely]] {
  ------------------
  |  Branch (1657:23): [True: 46, False: 519k]
  ------------------
 1658|     46|                     return false;
 1659|     46|                  }
 1660|   519k|               }
 1661|   867k|               else {
 1662|   867k|                  bool parse_structured_alias_key = false;
 1663|   867k|                  if (*replay_it == '-' &&
  ------------------
  |  Branch (1663:23): [True: 151k, False: 716k]
  ------------------
 1664|   151k|                      ((replay_it + 1) == replay_end ||
  ------------------
  |  Branch (1664:24): [True: 14.5k, False: 136k]
  ------------------
 1665|   136k|                       yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(replay_it + 1))])) {
  ------------------
  |  Branch (1665:24): [True: 85.1k, False: 51.5k]
  ------------------
 1666|  99.7k|                     parse_structured_alias_key = true;
 1667|  99.7k|                  }
 1668|   768k|                  else {
 1669|   768k|                     auto scan = replay_it;
 1670|   384M|                     while (scan != replay_end) {
  ------------------
  |  Branch (1670:29): [True: 384M, False: 110k]
  ------------------
 1671|   384M|                        if (*scan == ':') {
  ------------------
  |  Branch (1671:29): [True: 406k, False: 384M]
  ------------------
 1672|   406k|                           const auto after_colon = scan + 1;
 1673|   406k|                           if (after_colon == replay_end ||
  ------------------
  |  Branch (1673:32): [True: 57.4k, False: 349k]
  ------------------
 1674|   349k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) {
  ------------------
  |  Branch (1674:32): [True: 209k, False: 139k]
  ------------------
 1675|   267k|                              parse_structured_alias_key = true;
 1676|   267k|                              break;
 1677|   267k|                           }
 1678|   406k|                        }
 1679|   384M|                        if (*scan == '\n' || *scan == '\r') {
  ------------------
  |  Branch (1679:29): [True: 205k, False: 384M]
  |  Branch (1679:46): [True: 184k, False: 384M]
  ------------------
 1680|   390k|                           break;
 1681|   390k|                        }
 1682|   384M|                        ++scan;
 1683|   384M|                     }
 1684|   768k|                  }
 1685|   867k|                  if (!parse_structured_alias_key) {
  ------------------
  |  Branch (1685:23): [True: 500k, False: 367k]
  ------------------
 1686|   267M|                     for (auto p = replay_it; p != replay_end; ++p) {
  ------------------
  |  Branch (1686:47): [True: 267M, False: 110k]
  ------------------
 1687|   267M|                        if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1687:29): [True: 205k, False: 267M]
  |  Branch (1687:43): [True: 184k, False: 267M]
  ------------------
 1688|   390k|                           parse_structured_alias_key = true;
 1689|   390k|                           break;
 1690|   390k|                        }
 1691|   267M|                     }
 1692|   500k|                  }
 1693|       |
 1694|   867k|                  if (parse_structured_alias_key) {
  ------------------
  |  Branch (1694:23): [True: 757k, False: 110k]
  ------------------
 1695|   757k|                     glz::generic key_node{};
 1696|   757k|                     auto temp_ctx = ctx.make_speculative();
 1697|   757k|                     from<YAML, glz::generic>::template op<opts{.error_on_unknown_keys = false}>(key_node, temp_ctx,
 1698|   757k|                                                                                                 replay_it, replay_end);
 1699|   757k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 1700|   757k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 1701|   757k|                     if (bool(temp_ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1701:26): [True: 151k, False: 606k]
  ------------------
 1702|   151k|                        ctx.error = temp_ctx.error;
 1703|   151k|                        ctx.custom_error_message = temp_ctx.custom_error_message;
 1704|   151k|                        return false;
 1705|   151k|                     }
 1706|   606k|                     ctx.anchors = std::move(temp_ctx.anchors);
 1707|       |
 1708|   606k|                     if (!yaml::materialize_key<false>(key, key_node, ctx)) [[unlikely]] {
  ------------------
  |  Branch (1708:26): [True: 26, False: 606k]
  ------------------
 1709|     26|                        return false;
 1710|     26|                     }
 1711|   606k|                  }
 1712|   110k|                  else {
 1713|   110k|                     parse_plain_scalar(key, ctx, replay_it, replay_end, false);
 1714|   110k|                  }
 1715|   867k|               }
 1716|  1.46M|            }
 1717|  1.35M|            return !bool(ctx.error);
 1718|  1.58M|         }
 1719|       |
 1720|       |         // Handle anchor on key (&name before key text)
 1721|  11.8M|         bool has_key_anchor = false;
 1722|  11.8M|         std::string key_anchor_name;
 1723|  11.8M|         if (*it == '&') {
  ------------------
  |  Branch (1723:14): [True: 1.68M, False: 10.2M]
  ------------------
 1724|  1.68M|            ++it;
 1725|  1.68M|            auto name = parse_anchor_name(it, end);
 1726|  1.68M|            if (name.empty()) {
  ------------------
  |  Branch (1726:17): [True: 616, False: 1.68M]
  ------------------
 1727|    616|               ctx.error = error_code::syntax_error;
 1728|    616|               return false;
 1729|    616|            }
 1730|  1.68M|            skip_inline_ws(it, end);
 1731|  1.68M|            if (it == end) {
  ------------------
  |  Branch (1731:17): [True: 542, False: 1.67M]
  ------------------
 1732|    542|               ctx.error = error_code::unexpected_end;
 1733|    542|               return false;
 1734|    542|            }
 1735|       |            // Anchor on alias is invalid per YAML spec
 1736|  1.67M|            if (*it == '*') {
  ------------------
  |  Branch (1736:17): [True: 82, False: 1.67M]
  ------------------
 1737|     82|               ctx.error = error_code::syntax_error;
 1738|     82|               return false;
 1739|     82|            }
 1740|  1.67M|            has_key_anchor = true;
 1741|  1.67M|            key_anchor_name = std::string(name);
 1742|  1.67M|         }
 1743|       |
 1744|       |         // Allow node-property order "&anchor !!str key: value" for mapping keys.
 1745|  11.8M|         if (*it == '!') {
  ------------------
  |  Branch (1745:14): [True: 15.5k, False: 11.8M]
  ------------------
 1746|  15.5k|            if (key_tag != yaml_tag::none) {
  ------------------
  |  Branch (1746:17): [True: 6, False: 15.5k]
  ------------------
 1747|       |               // Duplicate tag properties on the same key node are malformed.
 1748|      6|               ctx.error = error_code::syntax_error;
 1749|      6|               return false;
 1750|      6|            }
 1751|  15.5k|            key_tag = parse_yaml_tag(it, end, ctx);
 1752|  15.5k|            if (!validate_key_tag(key_tag)) {
  ------------------
  |  Branch (1752:17): [True: 58, False: 15.4k]
  ------------------
 1753|     58|               return false;
 1754|     58|            }
 1755|  15.4k|            skip_inline_ws(it, end);
 1756|  15.4k|            if (it == end) {
  ------------------
  |  Branch (1756:17): [True: 20, False: 15.4k]
  ------------------
 1757|     20|               ctx.error = error_code::unexpected_end;
 1758|     20|               return false;
 1759|     20|            }
 1760|  15.4k|         }
 1761|       |
 1762|  11.8M|         const char* key_start = &*it;
 1763|  11.8M|         bool quoted_key_spans_lines = false;
 1764|       |
 1765|  11.8M|         if (*it == '"') {
  ------------------
  |  Branch (1765:14): [True: 1.42M, False: 10.4M]
  ------------------
 1766|  1.42M|            auto quoted_start = it;
 1767|  1.42M|            parse_double_quoted_string(key, ctx, it, end);
 1768|  1.42M|            if (!bool(ctx.error)) {
  ------------------
  |  Branch (1768:17): [True: 1.42M, False: 740]
  ------------------
 1769|  8.51M|               for (auto p = quoted_start; p != it; ++p) {
  ------------------
  |  Branch (1769:44): [True: 7.10M, False: 1.40M]
  ------------------
 1770|  7.10M|                  if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1770:23): [True: 2.16k, False: 7.10M]
  |  Branch (1770:37): [True: 8.24k, False: 7.09M]
  ------------------
 1771|  10.4k|                     quoted_key_spans_lines = true;
 1772|  10.4k|                     break;
 1773|  10.4k|                  }
 1774|  7.10M|               }
 1775|  1.42M|            }
 1776|  1.42M|         }
 1777|  10.4M|         else if (*it == '\'') {
  ------------------
  |  Branch (1777:19): [True: 14.5k, False: 10.4M]
  ------------------
 1778|  14.5k|            auto quoted_start = it;
 1779|  14.5k|            parse_single_quoted_string(key, ctx, it, end);
 1780|  14.5k|            if (!bool(ctx.error)) {
  ------------------
  |  Branch (1780:17): [True: 14.3k, False: 204]
  ------------------
 1781|   155k|               for (auto p = quoted_start; p != it; ++p) {
  ------------------
  |  Branch (1781:44): [True: 144k, False: 10.7k]
  ------------------
 1782|   144k|                  if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1782:23): [True: 1.78k, False: 142k]
  |  Branch (1782:37): [True: 1.84k, False: 141k]
  ------------------
 1783|  3.62k|                     quoted_key_spans_lines = true;
 1784|  3.62k|                     break;
 1785|  3.62k|                  }
 1786|   144k|               }
 1787|  14.3k|            }
 1788|  14.5k|         }
 1789|  10.4M|         else {
 1790|       |            // Plain key - read until colon
 1791|  39.0M|            while (it != end) {
  ------------------
  |  Branch (1791:20): [True: 39.0M, False: 338]
  ------------------
 1792|       |               // Bulk-copy the ordinary run; only dispatch bytes need the checks below.
 1793|  39.0M|               {
 1794|  39.0M|                  const auto run_start = it;
 1795|   183M|                  while (it != end && !plain_scalar_dispatch_table[uint8_t(*it)]) {
  ------------------
  |  Branch (1795:26): [True: 183M, False: 2.37k]
  |  Branch (1795:39): [True: 144M, False: 39.0M]
  ------------------
 1796|   144M|                     ++it;
 1797|   144M|                  }
 1798|  39.0M|                  if (it != run_start) {
  ------------------
  |  Branch (1798:23): [True: 30.2M, False: 8.78M]
  ------------------
 1799|  30.2M|                     key.append(run_start, it);
 1800|  30.2M|                  }
 1801|  39.0M|                  if (it == end) break;
  ------------------
  |  Branch (1801:23): [True: 2.37k, False: 39.0M]
  ------------------
 1802|  39.0M|               }
 1803|       |
 1804|  39.0M|               const char c = *it;
 1805|  39.0M|               if (c == ':') {
  ------------------
  |  Branch (1805:20): [True: 28.6M, False: 10.3M]
  ------------------
 1806|       |                  // Check if this ends the key
 1807|  28.6M|                  if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' ||
  ------------------
  |  Branch (1807:23): [True: 97.6k, False: 28.5M]
  |  Branch (1807:42): [True: 3.98M, False: 24.5M]
  |  Branch (1807:62): [True: 248k, False: 24.3M]
  |  Branch (1807:83): [True: 388k, False: 23.9M]
  ------------------
 1808|  23.9M|                      *(it + 1) == '\r') {
  ------------------
  |  Branch (1808:23): [True: 1.73M, False: 22.1M]
  ------------------
 1809|  6.45M|                     break;
 1810|  6.45M|                  }
 1811|  22.1M|                  if (in_flow && (*(it + 1) == ',' || *(it + 1) == ']' || *(it + 1) == '}')) {
  ------------------
  |  Branch (1811:23): [True: 21.2M, False: 899k]
  |  Branch (1811:35): [True: 122k, False: 21.1M]
  |  Branch (1811:55): [True: 18, False: 21.1M]
  |  Branch (1811:75): [True: 57.8k, False: 21.1M]
  ------------------
 1812|   180k|                     break;
 1813|   180k|                  }
 1814|  22.1M|               }
 1815|  32.3M|               if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1815:20): [True: 1.06M, False: 31.3M]
  |  Branch (1815:33): [True: 2.04M, False: 29.2M]
  ------------------
 1816|  3.10M|                  if (!in_flow) break;
  ------------------
  |  Branch (1816:23): [True: 2.14k, False: 3.10M]
  ------------------
 1817|       |
 1818|  3.10M|                  auto continuation = it;
 1819|  3.10M|                  skip_newline(continuation, end);
 1820|  3.10M|                  int32_t continuation_indent = 0;
 1821|  25.3M|                  while (continuation != end && (*continuation == ' ' || *continuation == '\t')) {
  ------------------
  |  Branch (1821:26): [True: 25.3M, False: 714]
  |  Branch (1821:50): [True: 22.2M, False: 3.18M]
  |  Branch (1821:74): [True: 81.1k, False: 3.10M]
  ------------------
 1822|  22.2M|                     if (*continuation == ' ') ++continuation_indent;
  ------------------
  |  Branch (1822:26): [True: 22.2M, False: 81.1k]
  ------------------
 1823|  22.2M|                     ++continuation;
 1824|  22.2M|                  }
 1825|       |
 1826|  3.10M|                  if (continuation == end) {
  ------------------
  |  Branch (1826:23): [True: 714, False: 3.10M]
  ------------------
 1827|    714|                     break;
 1828|    714|                  }
 1829|       |
 1830|  3.10M|                  if (*continuation == '#') {
  ------------------
  |  Branch (1830:23): [True: 51.2k, False: 3.05M]
  ------------------
 1831|  51.2k|                     it = continuation;
 1832|  51.2k|                     skip_comment(it, end);
 1833|  51.2k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (1833:26): [True: 51.1k, False: 50]
  |  Branch (1833:40): [True: 18.1k, False: 33.0k]
  |  Branch (1833:55): [True: 32.9k, False: 94]
  ------------------
 1834|  51.1k|                        skip_newline(it, end);
 1835|  51.1k|                        continue;
 1836|  51.1k|                     }
 1837|    144|                     break;
 1838|  51.2k|                  }
 1839|       |
 1840|       |                  // A continuation line starting with flow terminators or ':' does
 1841|       |                  // not belong to the key content.
 1842|  3.05M|                  if (*continuation == ',' || *continuation == ']' || *continuation == '}' || *continuation == ':') {
  ------------------
  |  Branch (1842:23): [True: 224k, False: 2.82M]
  |  Branch (1842:47): [True: 14, False: 2.82M]
  |  Branch (1842:71): [True: 21.6k, False: 2.80M]
  |  Branch (1842:95): [True: 224k, False: 2.58M]
  ------------------
 1843|   469k|                     break;
 1844|   469k|                  }
 1845|       |
 1846|  2.58M|                  if (ctx.explicit_mapping_key_context) {
  ------------------
  |  Branch (1846:23): [True: 212k, False: 2.37M]
  ------------------
 1847|   212k|                     if (*continuation == '?' || *continuation == ':') {
  ------------------
  |  Branch (1847:26): [True: 1.86k, False: 210k]
  |  Branch (1847:50): [True: 0, False: 210k]
  ------------------
 1848|  1.86k|                        auto after = continuation + 1;
 1849|  1.86k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1849:29): [True: 8, False: 1.86k]
  |  Branch (1849:45): [True: 10, False: 1.85k]
  |  Branch (1849:62): [True: 10, False: 1.84k]
  |  Branch (1849:80): [True: 6, False: 1.83k]
  |  Branch (1849:98): [True: 6, False: 1.82k]
  ------------------
 1850|     40|                           break;
 1851|     40|                        }
 1852|  1.86k|                     }
 1853|       |
 1854|   212k|                     if (*continuation == '&' || *continuation == '*' || *continuation == '!') {
  ------------------
  |  Branch (1854:26): [True: 6, False: 212k]
  |  Branch (1854:50): [True: 10, False: 212k]
  |  Branch (1854:74): [True: 18, False: 212k]
  ------------------
 1855|     34|                        break;
 1856|     34|                     }
 1857|       |
 1858|   212k|                     if (*continuation == '-') {
  ------------------
  |  Branch (1858:26): [True: 7.51k, False: 205k]
  ------------------
 1859|  7.51k|                        auto after = continuation + 1;
 1860|  7.51k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1860:29): [True: 8, False: 7.50k]
  |  Branch (1860:45): [True: 6, False: 7.49k]
  |  Branch (1860:62): [True: 6, False: 7.49k]
  |  Branch (1860:80): [True: 6, False: 7.48k]
  |  Branch (1860:98): [True: 6, False: 7.47k]
  ------------------
 1861|     32|                           break;
 1862|     32|                        }
 1863|  7.51k|                     }
 1864|       |
 1865|   212k|                     if (ctx.current_indent() >= 0 && continuation_indent <= ctx.current_indent()) {
  ------------------
  |  Branch (1865:26): [True: 914, False: 211k]
  |  Branch (1865:55): [True: 408, False: 506]
  ------------------
 1866|    408|                        break;
 1867|    408|                     }
 1868|       |
 1869|       |                     // A continuation line that contains an implicit mapping-key
 1870|       |                     // indicator (": " / ":\n") starts a new entry, not key text.
 1871|   212k|                     {
 1872|   212k|                        auto scan = continuation;
 1873|  1.44M|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (1873:32): [True: 1.44M, False: 2.07k]
  |  Branch (1873:47): [True: 1.27M, False: 168k]
  |  Branch (1873:64): [True: 1.23M, False: 41.8k]
  ------------------
 1874|  1.23M|                           if (*scan == ':') {
  ------------------
  |  Branch (1874:32): [True: 14.9k, False: 1.21M]
  ------------------
 1875|  14.9k|                              auto after_colon = scan + 1;
 1876|  14.9k|                              const bool tight_key_colon =
 1877|  14.9k|                                 (scan == continuation) || (*(scan - 1) != ' ' && *(scan - 1) != '\t');
  ------------------
  |  Branch (1877:34): [True: 0, False: 14.9k]
  |  Branch (1877:61): [True: 9.64k, False: 5.27k]
  |  Branch (1877:83): [True: 9.30k, False: 346]
  ------------------
 1878|  14.9k|                              if (tight_key_colon &&
  ------------------
  |  Branch (1878:35): [True: 9.30k, False: 5.62k]
  ------------------
 1879|  9.30k|                                  (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (1879:36): [True: 22, False: 9.28k]
  |  Branch (1879:58): [True: 6, False: 9.27k]
  |  Branch (1879:81): [True: 6, False: 9.26k]
  ------------------
 1880|  9.26k|                                   *after_colon == '\n' || *after_colon == '\r')) {
  ------------------
  |  Branch (1880:36): [True: 6, False: 9.26k]
  |  Branch (1880:60): [True: 22, False: 9.24k]
  ------------------
 1881|     62|                                 break;
 1882|     62|                              }
 1883|  14.9k|                           }
 1884|  1.23M|                           ++scan;
 1885|  1.23M|                        }
 1886|   212k|                        if (scan != end && *scan == ':') {
  ------------------
  |  Branch (1886:29): [True: 210k, False: 2.07k]
  |  Branch (1886:44): [True: 62, False: 210k]
  ------------------
 1887|     62|                           break;
 1888|     62|                        }
 1889|   212k|                     }
 1890|   212k|                  }
 1891|       |
 1892|  2.58M|                  if (!key.empty() && key.back() != ' ') {
  ------------------
  |  Branch (1892:23): [True: 2.34M, False: 240k]
  |  Branch (1892:39): [True: 1.09M, False: 1.25M]
  ------------------
 1893|  1.09M|                     key.push_back(' ');
 1894|  1.09M|                  }
 1895|  2.58M|                  it = continuation;
 1896|  2.58M|                  continue;
 1897|  2.58M|               }
 1898|  29.2M|               if (in_flow && (c == ',' || c == ']' || c == '}')) break;
  ------------------
  |  Branch (1898:20): [True: 27.1M, False: 2.07M]
  |  Branch (1898:32): [True: 2.59M, False: 24.5M]
  |  Branch (1898:44): [True: 276, False: 24.5M]
  |  Branch (1898:56): [True: 708k, False: 23.8M]
  ------------------
 1899|  25.9M|               if (c == '#') {
  ------------------
  |  Branch (1899:20): [True: 3.28M, False: 22.6M]
  ------------------
 1900|  3.28M|                  if (key.empty() || key.back() == ' ' || key.back() == '\t') break;
  ------------------
  |  Branch (1900:23): [True: 6.94k, False: 3.27M]
  |  Branch (1900:38): [True: 22.1k, False: 3.25M]
  |  Branch (1900:59): [True: 4.81k, False: 3.24M]
  ------------------
 1901|  3.28M|               }
 1902|       |
 1903|  25.9M|               if (forbidden_control_table[uint8_t(c)]) [[unlikely]] {
  ------------------
  |  Branch (1903:20): [True: 14.0k, False: 25.9M]
  ------------------
 1904|  14.0k|                  ctx.error = error_code::invalid_control_character;
 1905|  14.0k|                  return false;
 1906|  14.0k|               }
 1907|  25.9M|               key.push_back(c);
 1908|  25.9M|               ++it;
 1909|  25.9M|            }
 1910|       |
 1911|       |            // Trim trailing whitespace from key
 1912|  12.2M|            while (!key.empty() && (key.back() == ' ' || key.back() == '\t')) {
  ------------------
  |  Branch (1912:20): [True: 9.36M, False: 2.93M]
  |  Branch (1912:37): [True: 1.67M, False: 7.68M]
  |  Branch (1912:58): [True: 175k, False: 7.51M]
  ------------------
 1913|  1.85M|               key.pop_back();
 1914|  1.85M|            }
 1915|       |
 1916|       |            // Empty keys are valid YAML (":" in block or flow mappings).
 1917|  10.4M|         }
 1918|       |
 1919|  11.8M|         if (bool(ctx.error)) return false;
  ------------------
  |  Branch (1919:14): [True: 944, False: 11.8M]
  ------------------
 1920|       |
 1921|       |         // Implicit mapping keys must be single-line in both block and flow styles.
 1922|  11.8M|         if (quoted_key_spans_lines && !in_flow) {
  ------------------
  |  Branch (1922:14): [True: 14.0k, False: 11.8M]
  |  Branch (1922:40): [True: 90, False: 13.9k]
  ------------------
 1923|     90|            ctx.error = error_code::syntax_error;
 1924|     90|            return false;
 1925|     90|         }
 1926|       |
 1927|       |         // Store anchor on key if present
 1928|  11.8M|         if (has_key_anchor) {
  ------------------
  |  Branch (1928:14): [True: 1.67M, False: 10.1M]
  ------------------
 1929|  1.67M|            ctx.anchors[std::move(key_anchor_name)] = {key_start, &*it, ctx.current_indent()};
 1930|  1.67M|         }
 1931|       |
 1932|  11.8M|         return true;
 1933|  11.8M|      }
_ZZN3glz4yaml14parse_yaml_keyINS0_12yaml_contextEPKcS4_EEbRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_bENKUlNS0_8yaml_tagEE_clESI_:
 1585|  13.5M|         auto validate_key_tag = [&](const yaml_tag tag) {
 1586|  13.5M|            if (tag == yaml_tag::unknown) {
  ------------------
  |  Branch (1586:17): [True: 116, False: 13.5M]
  ------------------
 1587|    116|               ctx.error = error_code::syntax_error;
 1588|    116|               return false;
 1589|    116|            }
 1590|  13.5M|            if (!tag_valid_for_string(tag)) {
  ------------------
  |  Branch (1590:17): [True: 92, False: 13.4M]
  ------------------
 1591|     92|               ctx.error = error_code::syntax_error;
 1592|     92|               return false;
 1593|     92|            }
 1594|  13.4M|            return true;
 1595|  13.5M|         };
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  5.36M|      {
  275|  5.36M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  5.36M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  5.36M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  5.36M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_:
 5725|  7.87M|      {
 5726|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5727|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5728|  7.87M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5729|  7.87M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5730|  7.87M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5731|  7.87M|                       "the internally tagged shape, so it is rejected here instead.");
 5732|  7.87M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5732:14): [True: 0, False: 7.87M]
  ------------------
 5733|      0|            return;
 5734|       |
 5735|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5736|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5737|       |         // indent stack does not cover.
 5738|  7.87M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5739|  7.87M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5739:14): [True: 2.51k, False: 7.87M]
  ------------------
 5740|  2.51k|            return;
 5741|       |
 5742|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5743|       |         // For nested values, only skip inline whitespace to preserve block structure
 5744|  7.87M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5744:14): [True: 6.12M, False: 1.74M]
  ------------------
 5745|  6.12M|            yaml::skip_ws_newlines_comments(it, end);
 5746|  6.12M|         }
 5747|  1.74M|         else {
 5748|  1.74M|            yaml::skip_inline_ws(it, end);
 5749|  1.74M|         }
 5750|       |
 5751|  7.87M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5751:14): [True: 110, False: 7.87M]
  ------------------
 5752|    110|            ctx.error = error_code::unexpected_end;
 5753|    110|            return;
 5754|    110|         }
 5755|       |
 5756|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5757|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5758|       |         // same variant definitions round-trip across both formats.
 5759|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5760|       |            using V = std::remove_cvref_t<T>;
 5761|       |            const bool value_is_mapping =
 5762|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5763|       |            if (value_is_mapping) {
 5764|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5765|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5766|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5767|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5768|       |               auto tag_ctx = ctx.make_speculative();
 5769|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5770|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5771|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5772|       |               if (index < ids_v<V>.size()) {
 5773|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5774|       |                  emplace_runtime_variant(value, index);
 5775|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5776|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5777|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5778|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5779|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5780|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5781|       |                     return;
 5782|       |                  }
 5783|       |                  std::visit(
 5784|       |                     [&](auto&& alt) {
 5785|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5786|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5787|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5788|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5789|       |                        }
 5790|       |                        else if constexpr (custom_read<Alt>) {
 5791|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5792|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5793|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5794|       |                           // entry, then hand the remaining mapping to the custom handler.
 5795|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5796|       |                              ctx.error = error_code::feature_not_supported;
 5797|       |                              ctx.custom_error_message =
 5798|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5799|       |                           }
 5800|       |                           else {
 5801|       |                              ctx.scratch.clear();
 5802|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5803|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5804|       |                                    ctx.error = error_code::feature_not_supported;
 5805|       |                                    ctx.custom_error_message =
 5806|       |                                       "the tag must be the first key for a custom variant alternative";
 5807|       |                                 }
 5808|       |                                 else {
 5809|       |                                    yaml::skip_inline_ws(it, end);
 5810|       |                                    if (it == end || *it != ':') {
 5811|       |                                       ctx.error = error_code::syntax_error;
 5812|       |                                    }
 5813|       |                                    else {
 5814|       |                                       ++it;
 5815|       |                                       yaml::skip_inline_ws(it, end);
 5816|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5817|       |                                       if (!bool(ctx.error)) {
 5818|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5819|       |                                          // was the whole mapping: leave the alternative default.
 5820|       |                                          auto probe = it;
 5821|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5822|       |                                          if (probe == end) {
 5823|       |                                             it = probe;
 5824|       |                                          }
 5825|       |                                          else {
 5826|       |                                             // Publish the mapping's column so the custom handler's block
 5827|       |                                             // mapping (which would otherwise discover its own indent) reads
 5828|       |                                             // the remaining entries at the variant's indent and dedents
 5829|       |                                             // correctly in every context (root, sequence, nested).
 5830|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5831|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5832|       |                                             ctx.forced_block_mapping_indent = -1;
 5833|       |                                          }
 5834|       |                                       }
 5835|       |                                    }
 5836|       |                                 }
 5837|       |                              }
 5838|       |                           }
 5839|       |                        }
 5840|       |                        else {
 5841|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5842|       |                           // the value, but the mapping must still be consumed.
 5843|       |                           walk_tagged_mapping<Opts>(
 5844|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5845|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5846|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5847|       |                              });
 5848|       |                        }
 5849|       |                     },
 5850|       |                     value);
 5851|       |                  ctx.pop_indent();
 5852|       |                  return;
 5853|       |               }
 5854|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5855|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5856|       |               // otherwise the deduction path reports no_matching_variant_type.
 5857|       |            }
 5858|       |         }
 5859|       |
 5860|  7.87M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5861|  7.87M|            using V = std::remove_cvref_t<T>;
 5862|  7.87M|            using counts = yaml_variant_type_count<V>;
 5863|  7.87M|            const char c = *it;
 5864|  7.87M|            auto is_plain_scalar_boundary = [](const char ch) {
 5865|  7.87M|               switch (ch) {
 5866|  7.87M|               case ' ':
 5867|  7.87M|               case '\t':
 5868|  7.87M|               case '\n':
 5869|  7.87M|               case '\r':
 5870|  7.87M|               case ',':
 5871|  7.87M|               case ']':
 5872|  7.87M|               case '}':
 5873|  7.87M|                  return true;
 5874|  7.87M|               default:
 5875|  7.87M|                  return false;
 5876|  7.87M|               }
 5877|  7.87M|            };
 5878|       |
 5879|  7.87M|            auto has_indented_block_continuation = [&](auto word_end) {
 5880|  7.87M|               if constexpr (yaml::check_flow_context(Opts)) {
 5881|  7.87M|                  return false;
 5882|  7.87M|               }
 5883|  7.87M|               if (ctx.current_indent() < 0) {
 5884|  7.87M|                  return false;
 5885|  7.87M|               }
 5886|  7.87M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5887|  7.87M|                  return false;
 5888|  7.87M|               }
 5889|       |
 5890|  7.87M|               auto look = word_end;
 5891|  7.87M|               yaml::skip_newline(look, end);
 5892|  7.87M|               while (look != end) {
 5893|  7.87M|                  int32_t line_indent = 0;
 5894|  7.87M|                  while (look != end && *look == ' ') {
 5895|  7.87M|                     ++line_indent;
 5896|  7.87M|                     ++look;
 5897|  7.87M|                  }
 5898|  7.87M|                  if (look != end && *look == '\t') {
 5899|  7.87M|                     return false;
 5900|  7.87M|                  }
 5901|  7.87M|                  if (look == end || *look == '\n' || *look == '\r') {
 5902|  7.87M|                     if (look != end) {
 5903|  7.87M|                        yaml::skip_newline(look, end);
 5904|  7.87M|                        continue;
 5905|  7.87M|                     }
 5906|  7.87M|                     return false;
 5907|  7.87M|                  }
 5908|  7.87M|                  if (*look == '#') {
 5909|  7.87M|                     yaml::skip_comment(look, end);
 5910|  7.87M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5911|  7.87M|                        yaml::skip_newline(look, end);
 5912|  7.87M|                        continue;
 5913|  7.87M|                     }
 5914|  7.87M|                     return false;
 5915|  7.87M|                  }
 5916|       |
 5917|       |                  // If the next non-empty line is an implicit mapping entry,
 5918|       |                  // don't treat it as scalar continuation for auto-deduced
 5919|       |                  // booleans/nulls.
 5920|  7.87M|                  {
 5921|  7.87M|                     auto scan = look;
 5922|  7.87M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5923|  7.87M|                        if (*scan == ':') {
 5924|  7.87M|                           auto after_colon = scan + 1;
 5925|  7.87M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5926|  7.87M|                               *after_colon == '\n' || *after_colon == '\r') {
 5927|  7.87M|                              return false;
 5928|  7.87M|                           }
 5929|  7.87M|                        }
 5930|  7.87M|                        ++scan;
 5931|  7.87M|                     }
 5932|  7.87M|                  }
 5933|       |
 5934|  7.87M|                  return line_indent > ctx.current_indent();
 5935|  7.87M|               }
 5936|  7.87M|               return false;
 5937|  7.87M|            };
 5938|  7.87M|            auto is_word_boundary = [&](const auto ptr) {
 5939|  7.87M|               if (ptr == end) {
 5940|  7.87M|                  return true;
 5941|  7.87M|               }
 5942|  7.87M|               if (*ptr == ':') {
 5943|  7.87M|                  auto next = ptr + 1;
 5944|  7.87M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5945|  7.87M|               }
 5946|  7.87M|               return is_plain_scalar_boundary(*ptr);
 5947|  7.87M|            };
 5948|       |
 5949|  7.87M|            switch (c) {
 5950|  2.08M|            case '&': {
  ------------------
  |  Branch (5950:13): [True: 2.08M, False: 5.79M]
  ------------------
 5951|       |               // Anchor before value: parse name, then re-dispatch
 5952|  2.08M|               ++it;
 5953|  2.08M|               auto aname = yaml::parse_anchor_name(it, end);
 5954|  2.08M|               if (aname.empty()) {
  ------------------
  |  Branch (5954:20): [True: 66, False: 2.08M]
  ------------------
 5955|     66|                  ctx.error = error_code::syntax_error;
 5956|     66|                  return;
 5957|     66|               }
 5958|  2.08M|               yaml::skip_inline_ws(it, end);
 5959|  2.08M|               bool anchor_on_same_line = true;
 5960|  2.08M|               bool value_is_indentless_sequence = false;
 5961|  2.08M|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5961:20): [True: 12.6k, False: 2.06M]
  |  Branch (5961:33): [True: 90.7k, False: 1.97M]
  |  Branch (5961:48): [True: 130k, False: 1.84M]
  |  Branch (5961:63): [True: 31.8k, False: 1.81M]
  ------------------
 5962|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5963|       |                  // next line (indented past current context) or if this is an empty node.
 5964|   265k|                  bool value_on_next_line = false;
 5965|   265k|                  if (it != end) {
  ------------------
  |  Branch (5965:23): [True: 253k, False: 12.6k]
  ------------------
 5966|   253k|                     auto peek = it;
 5967|       |                     // Skip comment if present
 5968|   253k|                     if (*peek == '#') {
  ------------------
  |  Branch (5968:26): [True: 31.8k, False: 221k]
  ------------------
 5969|   225k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5969:32): [True: 225k, False: 10]
  |  Branch (5969:47): [True: 207k, False: 18.7k]
  |  Branch (5969:64): [True: 194k, False: 13.1k]
  ------------------
 5970|  31.8k|                     }
 5971|       |                     // Skip newline
 5972|   253k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5972:26): [True: 253k, False: 10]
  |  Branch (5972:42): [True: 109k, False: 143k]
  |  Branch (5972:59): [True: 143k, False: 0]
  ------------------
 5973|   253k|                        yaml::skip_newline(peek, end);
 5974|       |                        // Skip blank lines
 5975|   401k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5975:32): [True: 391k, False: 10.2k]
  |  Branch (5975:48): [True: 55.3k, False: 336k]
  |  Branch (5975:65): [True: 93.2k, False: 242k]
  ------------------
 5976|   148k|                           yaml::skip_newline(peek, end);
 5977|   148k|                        }
 5978|       |                        // Measure indent of next content line
 5979|   253k|                        int32_t next_indent = 0;
 5980|   487k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5980:32): [True: 472k, False: 14.6k]
  |  Branch (5980:47): [True: 234k, False: 238k]
  ------------------
 5981|   234k|                           ++next_indent;
 5982|   234k|                           ++peek;
 5983|   234k|                        }
 5984|   253k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5984:29): [True: 238k, False: 14.6k]
  |  Branch (5984:44): [True: 235k, False: 3.18k]
  |  Branch (5984:61): [True: 233k, False: 2.08k]
  ------------------
 5985|   233k|                           const bool indentless_sequence =
 5986|   233k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5986:31): [True: 231k, False: 1.93k]
  |  Branch (5986:69): [True: 49.8k, False: 181k]
  ------------------
 5987|  49.8k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5987:32): [True: 3.71k, False: 46.1k]
  ------------------
 5988|  46.1k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5988:32): [True: 43.4k, False: 2.66k]
  ------------------
 5989|  47.1k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5989:32): [True: 5.85k, False: 41.3k]
  ------------------
 5990|  41.3k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5990:33): [True: 28.5k, False: 12.7k]
  |  Branch (5990:61): [True: 27.1k, False: 1.43k]
  ------------------
 5991|   233k|                           value_is_indentless_sequence = indentless_sequence;
 5992|   233k|                           const bool same_indent_property_node =
 5993|   233k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5993:31): [True: 25.4k, False: 207k]
  ------------------
 5994|  25.4k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5994:32): [True: 820, False: 24.6k]
  |  Branch (5994:48): [True: 4.03k, False: 20.6k]
  |  Branch (5994:64): [True: 266, False: 20.3k]
  |  Branch (5994:80): [True: 478, False: 19.8k]
  |  Branch (5994:96): [True: 442, False: 19.4k]
  ------------------
 5995|  19.4k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5995:32): [True: 2.42k, False: 17.0k]
  |  Branch (5995:48): [True: 1.75k, False: 15.2k]
  |  Branch (5995:65): [True: 990, False: 14.2k]
  |  Branch (5995:81): [True: 406, False: 13.8k]
  ------------------
 5996|   233k|                           value_on_next_line =
 5997|   233k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5997:31): [True: 165k, False: 67.7k]
  |  Branch (5997:71): [True: 32.9k, False: 34.7k]
  |  Branch (5997:94): [True: 11.6k, False: 23.1k]
  ------------------
 5998|   233k|                        }
 5999|   253k|                     }
 6000|   253k|                  }
 6001|   265k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6001:23): [True: 55.6k, False: 209k]
  ------------------
 6002|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6003|  55.6k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6004|  55.6k|                     return;
 6005|  55.6k|                  }
 6006|       |                  // Value is on next line — advance past newline/blank lines to the content
 6007|   209k|                  if (*it == '#') {
  ------------------
  |  Branch (6007:23): [True: 23.3k, False: 186k]
  ------------------
 6008|   189k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6008:29): [True: 189k, False: 0]
  |  Branch (6008:42): [True: 171k, False: 18.4k]
  |  Branch (6008:57): [True: 166k, False: 4.83k]
  ------------------
 6009|  23.3k|                  }
 6010|   209k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6010:23): [True: 209k, False: 0]
  ------------------
 6011|   318k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6011:26): [True: 318k, False: 0]
  |  Branch (6011:40): [True: 30.1k, False: 288k]
  |  Branch (6011:55): [True: 78.1k, False: 209k]
  ------------------
 6012|   108k|                     yaml::skip_newline(it, end);
 6013|   108k|                  }
 6014|   209k|                  yaml::skip_inline_ws(it, end);
 6015|   209k|                  anchor_on_same_line = false;
 6016|   209k|               }
 6017|       |
 6018|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6019|       |                  if (anchor_on_same_line && *it == '-' &&
 6020|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 6021|       |                     // "&anchor - item" is malformed in block context.
 6022|       |                     ctx.error = error_code::syntax_error;
 6023|       |                     return;
 6024|       |                  }
 6025|       |               }
 6026|       |
 6027|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6028|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6029|  2.02M|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6029:20): [True: 2.02M, False: 6]
  |  Branch (6029:33): [True: 1.51k, False: 2.02M]
  |  Branch (6029:47): [True: 24, False: 1.48k]
  ------------------
 6030|     24|                  ctx.error = error_code::syntax_error;
 6031|     24|                  return;
 6032|     24|               }
 6033|       |
 6034|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6035|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 6036|       |                     auto probe = it + 1;
 6037|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6038|       |                     if (nested_anchor_name.empty()) {
 6039|       |                        ctx.error = error_code::syntax_error;
 6040|       |                        return;
 6041|       |                     }
 6042|       |                     yaml::skip_inline_ws(probe, end);
 6043|       |                     // Allow nested anchor usage only when it clearly starts a
 6044|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 6045|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 6046|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 6047|       |                        ctx.error = error_code::syntax_error;
 6048|       |                        return;
 6049|       |                     }
 6050|       |                  }
 6051|       |               }
 6052|       |
 6053|  2.02M|               const char* anchor_start = &*it;
 6054|  2.02M|               const int32_t anchor_indent = ctx.current_indent();
 6055|       |
 6056|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6057|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 6058|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 6059|       |                  // next line, the anchor applies to the entire next-line content.
 6060|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 6061|       |                     auto key_start = it;
 6062|       |                     if (*key_start == '!') {
 6063|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6064|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 6065|       |                           ctx.error = error_code::syntax_error;
 6066|       |                           return;
 6067|       |                        }
 6068|       |                        yaml::skip_inline_ws(key_start, end);
 6069|       |                        if (key_start == end) {
 6070|       |                           ctx.error = error_code::unexpected_end;
 6071|       |                           return;
 6072|       |                        }
 6073|       |                        if (*key_start == '\n' || *key_start == '\r') {
 6074|       |                           ctx.error = error_code::syntax_error;
 6075|       |                           return;
 6076|       |                        }
 6077|       |
 6078|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 6079|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 6080|       |                        // key-span registration below while the untagged spelling was rejected;
 6081|       |                        // an alias node carries no other properties either way.
 6082|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 6083|       |                           ctx.error = error_code::syntax_error;
 6084|       |                           return;
 6085|       |                        }
 6086|       |                     }
 6087|       |
 6088|       |                     // Find the key span by scanning to the key-value separator
 6089|       |                     auto key_scan = key_start;
 6090|       |                     auto key_end = key_start;
 6091|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6092|       |                        // Quoted key: skip to closing quote
 6093|       |                        const char quote = *key_scan;
 6094|       |                        ++key_scan;
 6095|       |                        while (key_scan != end && *key_scan != quote) {
 6096|       |                           if (*key_scan == '\\' && quote == '"') {
 6097|       |                              ++key_scan;
 6098|       |                              if (key_scan != end) ++key_scan;
 6099|       |                           }
 6100|       |                           else {
 6101|       |                              ++key_scan;
 6102|       |                           }
 6103|       |                        }
 6104|       |                        if (key_scan == end) {
 6105|       |                           ctx.error = error_code::syntax_error;
 6106|       |                           return;
 6107|       |                        }
 6108|       |                        ++key_scan; // past closing quote
 6109|       |                        key_end = key_scan;
 6110|       |                        yaml::skip_inline_ws(key_scan, end);
 6111|       |                     }
 6112|       |                     else {
 6113|       |                        // Plain key: scan to ':'
 6114|       |                        while (key_scan != end) {
 6115|       |                           if (*key_scan == ':') {
 6116|       |                              auto next = key_scan + 1;
 6117|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6118|       |                                 break;
 6119|       |                              }
 6120|       |                           }
 6121|       |                           ++key_scan;
 6122|       |                        }
 6123|       |                        key_end = key_scan;
 6124|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6125|       |                           --key_end;
 6126|       |                        }
 6127|       |                     }
 6128|       |                     if (key_scan == end || *key_scan != ':') {
 6129|       |                        ctx.error = error_code::syntax_error;
 6130|       |                        return;
 6131|       |                     }
 6132|       |                     // Store anchor with just the key text span
 6133|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6134|       |                     it = key_start;
 6135|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6136|       |                     if constexpr (counts::n_object > 0) {
 6137|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6138|       |                                                                                                        end);
 6139|       |                     }
 6140|       |                     else {
 6141|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6142|       |                     }
 6143|       |                     return;
 6144|       |                  }
 6145|       |               }
 6146|       |
 6147|  2.02M|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6148|  2.02M|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6149|  2.02M|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6150|  2.02M|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6151|  2.02M|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6151:20): [True: 2.01M, False: 7.33k]
  ------------------
 6152|  2.01M|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6153|  2.01M|               }
 6154|  2.02M|               return;
 6155|  2.02M|            }
 6156|   462k|            case '*': {
  ------------------
  |  Branch (6156:13): [True: 462k, False: 7.40M]
  ------------------
 6157|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6158|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6160|       |                     if constexpr (counts::n_object > 0) {
 6161|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|       |                                                                                                        end);
 6163|       |                        return;
 6164|       |                     }
 6165|       |                     else {
 6166|       |                        ctx.error = error_code::syntax_error;
 6167|       |                        return;
 6168|       |                     }
 6169|       |                  }
 6170|       |               }
 6171|       |
 6172|       |               // Alias value: look up anchor and replay
 6173|   462k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6174|   462k|               return;
 6175|  2.02M|            }
 6176|   590k|            case '!': {
  ------------------
  |  Branch (6176:13): [True: 590k, False: 7.28M]
  ------------------
 6177|       |               // Tag - parse it and dispatch based on tag type
 6178|   590k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6179|   590k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6179:20): [True: 34, False: 590k]
  ------------------
 6180|     34|                  ctx.error = error_code::syntax_error;
 6181|     34|                  return;
 6182|     34|               }
 6183|   590k|               yaml::skip_inline_ws(it, end);
 6184|   590k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6184:20): [True: 588k, False: 2.16k]
  |  Branch (6184:33): [True: 38.3k, False: 549k]
  ------------------
 6185|  38.3k|                  yaml::skip_comment(it, end);
 6186|  38.3k|               }
 6187|   590k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6187:20): [True: 586k, False: 3.41k]
  |  Branch (6187:34): [True: 35.3k, False: 551k]
  |  Branch (6187:49): [True: 101k, False: 450k]
  ------------------
 6188|   136k|                  auto content = it;
 6189|   136k|                  yaml::skip_newline(content, end);
 6190|   136k|                  yaml::skip_to_content(content, end);
 6191|       |
 6192|   136k|                  bool consume_following_content = false;
 6193|   136k|                  auto content_token = content;
 6194|   136k|                  if (content != end) {
  ------------------
  |  Branch (6194:23): [True: 128k, False: 8.68k]
  ------------------
 6195|   128k|                     auto indent_probe = content;
 6196|   128k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6197|   128k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6197:26): [True: 6, False: 128k]
  ------------------
 6198|      6|                        return;
 6199|   128k|                     content_token = indent_probe;
 6200|       |
 6201|       |                     // A tag at the end of a sequence/map entry has an empty value
 6202|       |                     // unless the next non-empty content is nested under the current node.
 6203|   128k|                     bool tagged_indentless_sequence = false;
 6204|   128k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6204:26): [True: 18.5k, False: 109k]
  |  Branch (6204:56): [True: 18.5k, False: 0]
  |  Branch (6204:79): [True: 17.1k, False: 1.42k]
  ------------------
 6205|  17.1k|                        const auto after_dash = indent_probe + 1;
 6206|  17.1k|                        if (after_dash == end ||
  ------------------
  |  Branch (6206:29): [True: 1.48k, False: 15.6k]
  ------------------
 6207|  16.4k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6207:29): [True: 15.0k, False: 650]
  ------------------
 6208|  16.4k|                           tagged_indentless_sequence =
 6209|  16.4k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6209:31): [True: 1.52k, False: 14.9k]
  ------------------
 6210|  14.9k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6210:32): [True: 9.36k, False: 5.60k]
  |  Branch (6210:60): [True: 1.98k, False: 7.38k]
  ------------------
 6211|  16.4k|                        }
 6212|  17.1k|                     }
 6213|       |
 6214|   128k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6214:50): [True: 56.2k, False: 71.9k]
  ------------------
 6215|  71.9k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6215:50): [True: 40.7k, False: 31.1k]
  |  Branch (6215:93): [True: 3.50k, False: 27.6k]
  ------------------
 6216|   128k|                  }
 6217|       |
 6218|   136k|                  if (consume_following_content) {
  ------------------
  |  Branch (6218:23): [True: 100k, False: 36.3k]
  ------------------
 6219|   100k|                     it = content_token;
 6220|   100k|                  }
 6221|  36.3k|                  else {
 6222|  36.3k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6222:26): [True: 1.00k, False: 35.3k]
  ------------------
 6223|  1.00k|                        if constexpr (counts::n_str > 0) {
 6224|  1.00k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6225|  1.00k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6226|  1.00k|                           value = StrType{};
 6227|  1.00k|                           return;
 6228|  1.00k|                        }
 6229|  1.00k|                     }
 6230|  36.3k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6230:26): [True: 578, False: 35.7k]
  ------------------
 6231|    578|                        if constexpr (counts::n_null > 0) {
 6232|    578|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6233|    578|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6234|    578|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6234:32): [True: 0, False: 578]
  ------------------
 6235|    578|                           return;
 6236|    578|                        }
 6237|    578|                     }
 6238|  36.3k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6238:26): [True: 32.4k, False: 3.94k]
  ------------------
 6239|  32.4k|                        if constexpr (counts::n_null > 0) {
 6240|  32.4k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6241|  32.4k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6242|  32.4k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6242:32): [True: 0, False: 32.4k]
  ------------------
 6243|  32.4k|                           return;
 6244|  32.4k|                        }
 6245|  32.4k|                     }
 6246|  36.3k|                  }
 6247|   136k|               }
 6248|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6249|       |                  // In block context, a comma immediately after a tag token is malformed
 6250|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6251|       |                  if (it != end && *it == ',') {
 6252|       |                     ctx.error = error_code::syntax_error;
 6253|       |                     return;
 6254|       |                  }
 6255|       |                  if constexpr (counts::n_object > 0) {
 6256|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6257|       |                     const bool starts_block_sequence_entry =
 6258|       |                        (it != end && *it == '-') &&
 6259|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6260|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6261|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6262|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6263|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6264|       |                        return;
 6265|       |                     }
 6266|       |                  }
 6267|       |               }
 6268|   590k|               if (it == end) {
  ------------------
  |  Branch (6268:20): [True: 3.41k, False: 586k]
  ------------------
 6269|  3.41k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6269:23): [True: 1.39k, False: 2.01k]
  ------------------
 6270|  1.39k|                     if constexpr (counts::n_str > 0) {
 6271|  1.39k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6272|  1.39k|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6273|  1.39k|                        value = StrType{};
 6274|  1.39k|                        return;
 6275|  1.39k|                     }
 6276|  1.39k|                  }
 6277|  3.41k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6277:23): [True: 2.00k, False: 1.40k]
  ------------------
 6278|  2.00k|                     if constexpr (counts::n_null > 0) {
 6279|  2.00k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6280|  2.00k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6281|  2.00k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6281:29): [True: 0, False: 2.00k]
  ------------------
 6282|  2.00k|                        return;
 6283|  2.00k|                     }
 6284|  2.00k|                  }
 6285|      0|                  ctx.error = error_code::unexpected_end;
 6286|  3.41k|                  return;
 6287|  3.41k|               }
 6288|   586k|               switch (tag) {
 6289|  2.02k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6289:16): [True: 2.02k, False: 584k]
  ------------------
 6290|  2.02k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6291|  2.02k|                  return;
 6292|  9.03k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6292:16): [True: 9.03k, False: 577k]
  ------------------
 6293|  19.7k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6293:16): [True: 10.6k, False: 576k]
  ------------------
 6294|  19.7k|                  if constexpr (counts::n_num > 0) {
 6295|  19.7k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6296|  19.7k|                     return;
 6297|       |                  }
 6298|       |                  else { // else used to fix MSVC unreachable code warning
 6299|       |                     ctx.error = error_code::syntax_error;
 6300|       |                     return;
 6301|       |                  }
 6302|  60.2k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6302:16): [True: 40.5k, False: 546k]
  ------------------
 6303|  60.2k|                  if constexpr (counts::n_bool > 0) {
 6304|  60.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6305|  60.2k|                     return;
 6306|       |                  }
 6307|       |                  else { // else used to fix MSVC unreachable code warning
 6308|       |                     ctx.error = error_code::syntax_error;
 6309|       |                     return;
 6310|       |                  }
 6311|  62.8k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6311:16): [True: 2.63k, False: 584k]
  ------------------
 6312|  62.8k|                  if constexpr (counts::n_null > 0) {
 6313|  62.8k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6314|  62.8k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6315|  62.8k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6315:26): [True: 0, False: 62.8k]
  ------------------
 6316|  62.8k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6317|  62.8k|                     return;
 6318|       |                  }
 6319|       |                  else { // else used to fix MSVC unreachable code warning
 6320|       |                     ctx.error = error_code::syntax_error;
 6321|       |                     return;
 6322|       |                  }
 6323|   122k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6323:16): [True: 59.5k, False: 527k]
  ------------------
 6324|   122k|                  if constexpr (counts::n_object > 0) {
 6325|   122k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6326|   122k|                                                                                                     end);
 6327|   122k|                     return;
 6328|       |                  }
 6329|       |                  else { // else used to fix MSVC unreachable code warning
 6330|       |                     ctx.error = error_code::syntax_error;
 6331|       |                     return;
 6332|       |                  }
 6333|   155k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6333:16): [True: 33.5k, False: 553k]
  ------------------
 6334|   155k|                  if constexpr (counts::n_array > 0) {
 6335|   155k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6336|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                        if (it != end && *it == '-') {
 6338|       |                           ctx.allow_indentless_sequence = true;
 6339|       |                        }
 6340|       |                     }
 6341|   155k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6342|   155k|                                                                                                    end);
 6343|   155k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6344|   155k|                     return;
 6345|       |                  }
 6346|       |                  else { // else used to fix MSVC unreachable code warning
 6347|       |                     ctx.error = error_code::syntax_error;
 6348|       |                     return;
 6349|       |                  }
 6350|   550k|               default: {
  ------------------
  |  Branch (6350:16): [True: 395k, False: 191k]
  ------------------
 6351|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6352|       |                  // Preserve collection kinds, otherwise treat as string content.
 6353|   550k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6353:23): [True: 395k, False: 155k]
  |  Branch (6353:36): [True: 184k, False: 210k]
  ------------------
 6354|   184k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6355|   184k|                     return;
 6356|   184k|                  }
 6357|       |
 6358|   366k|                  if constexpr (counts::n_array > 0) {
 6359|   366k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6359:26): [True: 210k, False: 155k]
  |  Branch (6359:39): [True: 2.13k, False: 208k]
  ------------------
 6360|  2.13k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6361|  2.13k|                                                                                                       end);
 6362|  2.13k|                        return;
 6363|  2.13k|                     }
 6364|   366k|                  }
 6365|   366k|                  if constexpr (counts::n_object > 0) {
 6366|   366k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6366:26): [True: 208k, False: 158k]
  |  Branch (6366:39): [True: 2.89k, False: 205k]
  ------------------
 6367|  2.89k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6368|  2.89k|                                                                                                        end);
 6369|  2.89k|                        return;
 6370|  2.89k|                     }
 6371|   366k|                  }
 6372|       |
 6373|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6374|       |                     if constexpr (counts::n_array > 0) {
 6375|       |                        const bool starts_block_sequence_entry =
 6376|       |                           (it != end && *it == '-') &&
 6377|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6378|       |                        if (starts_block_sequence_entry) {
 6379|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6380|       |                                                                                                          it, end);
 6381|       |                           return;
 6382|       |                        }
 6383|       |                     }
 6384|       |                     if constexpr (counts::n_object > 0) {
 6385|       |                        const bool starts_explicit_mapping_indicator =
 6386|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6387|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6388|       |                        if (starts_explicit_mapping_indicator) {
 6389|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6390|       |                                                                                                           it, end);
 6391|       |                           return;
 6392|       |                        }
 6393|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6394|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6395|       |                                                                                                           it, end);
 6396|       |                           return;
 6397|       |                        }
 6398|       |                     }
 6399|       |                  }
 6400|       |
 6401|   366k|                  if constexpr (counts::n_str > 0) {
 6402|   366k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6403|   366k|                     return;
 6404|   366k|                  }
 6405|       |
 6406|       |                  // Fall back if no string alternative exists.
 6407|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6408|   366k|                  return;
 6409|   550k|               }
 6410|   586k|               }
 6411|      0|               return;
 6412|   586k|            }
 6413|  1.87M|            case '{':
  ------------------
  |  Branch (6413:13): [True: 1.87M, False: 5.99M]
  ------------------
 6414|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6415|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6416|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6417|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6418|       |                                                                                                     end);
 6419|       |                     return;
 6420|       |                  }
 6421|       |               }
 6422|       |               // Flow mapping - object type
 6423|  1.87M|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6424|  1.87M|               return;
 6425|  90.8k|            case '[':
  ------------------
  |  Branch (6425:13): [True: 90.8k, False: 7.78M]
  ------------------
 6426|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6427|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6428|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6429|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6430|       |                                                                                                     end);
 6431|       |                     return;
 6432|       |                  }
 6433|       |               }
 6434|       |               // Flow sequence - array type
 6435|  90.8k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6436|  90.8k|               return;
 6437|   465k|            case '?':
  ------------------
  |  Branch (6437:13): [True: 465k, False: 7.40M]
  ------------------
 6438|       |               // Explicit mapping key indicator ("? key")
 6439|   465k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6439:20): [True: 465k, False: 470]
  |  Branch (6439:39): [True: 6, False: 465k]
  ------------------
 6440|      6|                  ctx.error = error_code::syntax_error;
 6441|      6|                  return;
 6442|      6|               }
 6443|   465k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6443:20): [True: 465k, False: 470]
  |  Branch (6443:40): [True: 139k, False: 325k]
  |  Branch (6443:56): [True: 250k, False: 74.9k]
  |  Branch (6443:73): [True: 35.5k, False: 39.4k]
  ------------------
 6444|   426k|                  if constexpr (counts::n_object > 0) {
 6445|   426k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6446|   426k|                                                                                                     end);
 6447|   426k|                     return;
 6448|   426k|                  }
 6449|   426k|               }
 6450|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6451|   465k|               return;
 6452|     14|            case '%':
  ------------------
  |  Branch (6452:13): [True: 14, False: 7.87M]
  ------------------
 6453|       |               // Reserved directive indicator is not a plain scalar start.
 6454|     14|               ctx.error = error_code::syntax_error;
 6455|     14|               return;
 6456|  39.1k|            case '"':
  ------------------
  |  Branch (6456:13): [True: 39.1k, False: 7.83M]
  ------------------
 6457|  49.1k|            case '\'':
  ------------------
  |  Branch (6457:13): [True: 9.98k, False: 7.86M]
  ------------------
 6458|       |               // Could be a quoted string OR a quoted key in a block mapping
 6459|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6460|  49.1k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6461|  49.1k|               return;
 6462|  36.1k|            case 't':
  ------------------
  |  Branch (6462:13): [True: 36.1k, False: 7.83M]
  ------------------
 6463|  72.0k|            case 'T':
  ------------------
  |  Branch (6463:13): [True: 35.9k, False: 7.83M]
  ------------------
 6464|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6465|  72.0k|               if constexpr (counts::n_bool > 0) {
 6466|  72.0k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6466:23): [True: 70.0k, False: 2.03k]
  |  Branch (6466:44): [True: 32.2k, False: 37.8k]
  |  Branch (6466:60): [True: 28.5k, False: 3.65k]
  |  Branch (6466:76): [True: 23.9k, False: 4.60k]
  ------------------
 6467|  46.1k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6467:44): [True: 5.01k, False: 41.0k]
  |  Branch (6467:60): [True: 2.03k, False: 2.98k]
  |  Branch (6467:76): [True: 1.37k, False: 658]
  ------------------
 6468|       |                     // Check what follows the word "true"
 6469|  25.3k|                     const auto after_true = it + 4;
 6470|  25.3k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6471|       |
 6472|  25.3k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6472:26): [True: 23.4k, False: 1.83k]
  ------------------
 6473|  23.4k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6473:29): [True: 0, False: 23.4k]
  ------------------
 6474|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|      0|                           return;
 6476|      0|                        }
 6477|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6478|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6479|  23.4k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6479:29): [True: 22.8k, False: 668]
  |  Branch (6479:47): [True: 14.4k, False: 8.41k]
  ------------------
 6480|  14.4k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6480:30): [True: 256, False: 14.1k]
  |  Branch (6480:47): [True: 3.57k, False: 10.5k]
  |  Branch (6480:63): [True: 5.45k, False: 5.12k]
  |  Branch (6480:80): [True: 716, False: 4.40k]
  |  Branch (6480:97): [True: 4.40k, False: 0]
  ------------------
 6481|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6482|  14.4k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6483|  14.4k|                           return;
 6484|  14.4k|                        }
 6485|  9.08k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6486|  9.08k|                                                                                                      end);
 6487|  9.08k|                        return;
 6488|  23.4k|                     }
 6489|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6490|  25.3k|                  }
 6491|  72.0k|               }
 6492|  48.6k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6493|  72.0k|               return;
 6494|  94.4k|            case 'f':
  ------------------
  |  Branch (6494:13): [True: 94.4k, False: 7.77M]
  ------------------
 6495|   115k|            case 'F':
  ------------------
  |  Branch (6495:13): [True: 20.5k, False: 7.85M]
  ------------------
 6496|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6497|   115k|               if constexpr (counts::n_bool > 0) {
 6498|   115k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6498:23): [True: 114k, False: 980]
  |  Branch (6498:44): [True: 64.2k, False: 49.8k]
  |  Branch (6498:60): [True: 48.5k, False: 15.6k]
  |  Branch (6498:76): [True: 45.4k, False: 3.15k]
  |  Branch (6498:92): [True: 41.4k, False: 3.94k]
  ------------------
 6499|  72.5k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6499:44): [True: 8.79k, False: 63.7k]
  |  Branch (6499:60): [True: 7.70k, False: 1.08k]
  |  Branch (6499:76): [True: 4.39k, False: 3.31k]
  |  Branch (6499:92): [True: 3.46k, False: 936]
  ------------------
 6500|       |                     // Check what follows the word "false"
 6501|  44.9k|                     const auto after_false = it + 5;
 6502|  44.9k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6503|       |
 6504|  44.9k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6504:26): [True: 35.8k, False: 9.10k]
  ------------------
 6505|  35.8k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6505:29): [True: 0, False: 35.8k]
  ------------------
 6506|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|      0|                           return;
 6508|      0|                        }
 6509|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6510|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6511|  35.8k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6511:29): [True: 35.5k, False: 342]
  |  Branch (6511:47): [True: 25.8k, False: 9.63k]
  ------------------
 6512|  25.8k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6512:30): [True: 3.39k, False: 22.4k]
  |  Branch (6512:47): [True: 3.99k, False: 18.4k]
  |  Branch (6512:63): [True: 8.70k, False: 9.78k]
  |  Branch (6512:80): [True: 9.11k, False: 676]
  |  Branch (6512:97): [True: 676, False: 0]
  ------------------
 6513|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6514|  25.8k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6515|  25.8k|                           return;
 6516|  25.8k|                        }
 6517|  9.97k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6518|  9.97k|                                                                                                      end);
 6519|  9.97k|                        return;
 6520|  35.8k|                     }
 6521|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6522|  44.9k|                  }
 6523|   115k|               }
 6524|  79.1k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6525|   115k|               return;
 6526|  57.5k|            case 'n':
  ------------------
  |  Branch (6526:13): [True: 57.5k, False: 7.81M]
  ------------------
 6527|  89.8k|            case 'N':
  ------------------
  |  Branch (6527:13): [True: 32.2k, False: 7.83M]
  ------------------
 6528|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6529|  89.8k|               if constexpr (counts::n_null > 0) {
 6530|  89.8k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6530:23): [True: 88.0k, False: 1.77k]
  |  Branch (6530:44): [True: 55.1k, False: 32.9k]
  |  Branch (6530:60): [True: 46.3k, False: 8.78k]
  |  Branch (6530:76): [True: 44.8k, False: 1.46k]
  ------------------
 6531|  48.2k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6531:44): [True: 10.8k, False: 32.3k]
  |  Branch (6531:60): [True: 8.72k, False: 2.10k]
  |  Branch (6531:76): [True: 3.38k, False: 5.34k]
  ------------------
 6532|       |                     // Check what follows the word "null"
 6533|  48.2k|                     const auto after_null = it + 4;
 6534|  48.2k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6535|       |
 6536|  48.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6536:26): [True: 41.8k, False: 6.45k]
  ------------------
 6537|  41.8k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6537:29): [True: 0, False: 41.8k]
  ------------------
 6538|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|      0|                           return;
 6540|      0|                        }
 6541|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6542|       |                        // "null: value" should parse as {null: value}, not as the null type
 6543|  41.8k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6543:29): [True: 40.2k, False: 1.57k]
  |  Branch (6543:47): [True: 18.1k, False: 22.0k]
  ------------------
 6544|  18.1k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6544:30): [True: 510, False: 17.6k]
  |  Branch (6544:47): [True: 534, False: 17.0k]
  |  Branch (6544:63): [True: 16.1k, False: 910]
  |  Branch (6544:80): [True: 560, False: 350]
  |  Branch (6544:97): [True: 350, False: 0]
  ------------------
 6545|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6546|  18.1k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6547|  18.1k|                           return;
 6548|  18.1k|                        }
 6549|  23.6k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6550|  23.6k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6551|  23.6k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6551:29): [True: 0, False: 23.6k]
  ------------------
 6552|  23.6k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6553|  23.6k|                        return;
 6554|  41.8k|                     }
 6555|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6556|  48.2k|                  }
 6557|  89.8k|               }
 6558|  48.0k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6559|  89.8k|               return;
 6560|  6.59k|            case '~':
  ------------------
  |  Branch (6560:13): [True: 6.59k, False: 7.86M]
  ------------------
 6561|       |               // Null indicator
 6562|  6.59k|               if constexpr (counts::n_null > 0) {
 6563|  6.59k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6564|  6.59k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6565|  6.59k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6565:23): [True: 0, False: 6.59k]
  ------------------
 6566|  6.59k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6567|  6.59k|                  return;
 6568|  6.59k|               }
 6569|      0|               break; // Fall through to try other types
 6570|   290k|            case '-':
  ------------------
  |  Branch (6570:13): [True: 290k, False: 7.58M]
  ------------------
 6571|       |               // Could be negative number or block sequence indicator
 6572|   290k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6572:20): [True: 6.90k, False: 283k]
  |  Branch (6572:41): [True: 200k, False: 82.5k]
  ------------------
 6573|       |                  // Block sequence indicator "- "
 6574|   207k|                  if constexpr (counts::n_array > 0) {
 6575|   207k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6576|   207k|                                                                                                    end);
 6577|   207k|                     return;
 6578|   207k|                  }
 6579|   207k|               }
 6580|   290k|               if constexpr (counts::n_num > 0) {
 6581|   290k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6581:23): [True: 82.5k, False: 207k]
  |  Branch (6581:43): [True: 4.97k, False: 77.5k]
  |  Branch (6581:94): [True: 6.42k, False: 71.1k]
  ------------------
 6582|  11.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6583|  11.4k|                     return;
 6584|  11.4k|                  }
 6585|   290k|               }
 6586|   278k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6587|   290k|               return;
 6588|  48.1k|            case '+':
  ------------------
  |  Branch (6588:13): [True: 48.1k, False: 7.82M]
  ------------------
 6589|   127k|            case '.':
  ------------------
  |  Branch (6589:13): [True: 79.4k, False: 7.79M]
  ------------------
 6590|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6591|       |               // Try parsing as number speculatively, fall back to string on failure
 6592|   127k|               if constexpr (counts::n_num > 0) {
 6593|   127k|                  auto start_it = it;
 6594|   127k|                  auto temp_ctx = ctx.make_speculative();
 6595|   127k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6596|   127k|                                                                                               end);
 6597|   127k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6598|   127k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6599|   127k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6599:23): [True: 14.6k, False: 112k]
  ------------------
 6600|  14.6k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6601|  14.6k|                     return; // Successfully parsed as number
 6602|  14.6k|                  }
 6603|   112k|                  it = start_it; // Restore and fall through to string
 6604|   112k|               }
 6605|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6606|   127k|               return;
 6607|  1.55M|            default:
  ------------------
  |  Branch (6607:13): [True: 1.55M, False: 6.31M]
  ------------------
 6608|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6609|  1.55M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6609:20): [True: 1.16M, False: 390k]
  |  Branch (6609:32): [True: 678k, False: 490k]
  ------------------
 6610|       |                  // Try block mapping first (e.g., "123key: value")
 6611|   678k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6611:23): [True: 25.7k, False: 652k]
  ------------------
 6612|  25.7k|                     return;
 6613|  25.7k|                  }
 6614|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6615|   652k|                  if constexpr (counts::n_num > 0) {
 6616|   652k|                     auto start_it = it;
 6617|   652k|                     auto temp_ctx = ctx.make_speculative();
 6618|   652k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6619|   652k|                                                                                                  end);
 6620|   652k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6621|   652k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6622|   652k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6622:26): [True: 532k, False: 119k]
  ------------------
 6623|   532k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6624|   532k|                        return; // Successfully parsed as number
 6625|   532k|                     }
 6626|   119k|                     it = start_it; // Restore and fall through to string
 6627|   119k|                  }
 6628|       |                  // Fall through to string
 6629|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6630|   652k|                  return;
 6631|   678k|               }
 6632|       |               // Plain scalar - try block mapping, then string
 6633|   880k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6634|   880k|               return;
 6635|  7.87M|            }
 6636|  7.87M|         }
 6637|       |
 6638|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6639|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6640|       |
 6641|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6642|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6643|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6644|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6645|  7.87M|         error_code expansion_error{};
 6646|  7.87M|         std::string_view expansion_message{};
 6647|       |
 6648|  7.87M|         auto try_parse = [&]<size_t I>() -> bool {
 6649|  7.87M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6650|  7.87M|            auto start = it;
 6651|       |
 6652|  7.87M|            V v{};
 6653|  7.87M|            auto temp_ctx = ctx.make_speculative();
 6654|  7.87M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6655|  7.87M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6656|  7.87M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6657|       |
 6658|  7.87M|            if (!bool(temp_ctx.error)) {
 6659|  7.87M|               value = std::move(v);
 6660|  7.87M|               ctx.anchors = std::move(temp_ctx.anchors);
 6661|  7.87M|               return true;
 6662|  7.87M|            }
 6663|       |
 6664|  7.87M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6665|  7.87M|               expansion_error = temp_ctx.error;
 6666|  7.87M|               expansion_message = temp_ctx.custom_error_message;
 6667|  7.87M|            }
 6668|  7.87M|            it = start;
 6669|  7.87M|            return false;
 6670|  7.87M|         };
 6671|       |
 6672|  7.87M|         bool parsed = false;
 6673|  7.87M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6674|  7.87M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6675|  7.87M|         }(std::make_index_sequence<N>{});
 6676|       |
 6677|  7.87M|         if (!parsed) {
  ------------------
  |  Branch (6677:14): [True: 0, False: 7.87M]
  ------------------
 6678|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6678:17): [True: 0, False: 0]
  ------------------
 6679|      0|               ctx.error = expansion_error;
 6680|      0|               ctx.custom_error_message = expansion_message;
 6681|      0|            }
 6682|      0|            else {
 6683|      0|               ctx.error = error_code::no_matching_variant_type;
 6684|      0|            }
 6685|      0|         }
 6686|  7.87M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|   646k|      {
  301|   646k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 646k]
  |  Branch (301:27): [True: 0, False: 646k]
  ------------------
  302|       |
  303|   646k|         ++it; // skip '*'
  304|   646k|         auto name = parse_anchor_name(it, end);
  305|   646k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 36, False: 646k]
  ------------------
  306|     36|            ctx.error = error_code::syntax_error;
  307|     36|            return true;
  308|     36|         }
  309|       |
  310|   646k|         auto anchor_it = ctx.anchors.find(name);
  311|   646k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 40, False: 646k]
  ------------------
  312|     40|            ctx.error = error_code::syntax_error; // undefined alias
  313|     40|            return true;
  314|     40|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|   646k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   646k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 162k, False: 484k]
  ------------------
  322|   162k|            return true;
  323|   162k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|   484k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 374, False: 484k]
  ------------------
  329|    374|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    374|            return true;
  331|    374|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|   484k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   484k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 484k]
  ------------------
  339|      6|            return true;
  340|       |
  341|   484k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 60, False: 484k]
  ------------------
  342|     60|            ctx.error = error_code::exceeded_max_expansion;
  343|     60|            ctx.custom_error_message = "alias expansion";
  344|     60|            return true;
  345|     60|         }
  346|       |
  347|   484k|         auto replay_it = span.begin;
  348|   484k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   484k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   484k|         ctx.indent_stack.clear();
  353|   484k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 52.9k, False: 431k]
  ------------------
  354|  52.9k|            ctx.push_indent(span.base_indent - 1);
  355|  52.9k|         }
  356|       |
  357|   484k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   484k|         using V = std::remove_cvref_t<T>;
  360|   484k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   484k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   484k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   484k|         return true;
  367|   484k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|  1.18M|      {
 5284|  1.18M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|  1.18M|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|  1.18M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|  1.18M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|  1.18M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 1.18M, False: 0]
  ------------------
 5294|  1.18M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|  1.18M|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1960|  1.22M|      {
 1961|  1.22M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 3.48k, False: 1.21M]
  ------------------
 1962|  3.48k|            return;
 1963|       |
 1964|  1.21M|         yaml::node_preamble_state preamble{};
 1965|  1.21M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 35.9k, False: 1.18M]
  ------------------
 1966|  1.21M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  35.9k|            return;
 1968|       |
 1969|  1.18M|         std::string str;
 1970|  1.18M|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|  1.18M|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 1.18M, False: 0]
  ------------------
 1973|  26.2k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 26.2k, False: 1.15M]
  ------------------
 1974|  26.2k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  26.2k|            break;
 1976|  5.30k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 5.30k, False: 1.17M]
  ------------------
 1977|  5.30k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  5.30k|            break;
 1979|  3.28k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 3.28k, False: 1.17M]
  ------------------
 1980|  9.65k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 6.37k, False: 1.17M]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  9.65k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  9.65k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 2.93k, False: 6.71k]
  ------------------
 1986|  9.65k|            break;
 1987|  1.14M|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 1.14M, False: 41.2k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|       |               if (ctx.current_indent() >= 0) {
 1992|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|       |               }
 1994|       |               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|       |               }
 1998|       |            }
 1999|  1.14M|            else {
 2000|  1.14M|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|  1.14M|            }
 2002|  1.14M|            break;
 2003|  1.18M|         }
 2004|       |
 2005|  1.18M|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 1.18M, False: 196]
  ------------------
 2006|  1.18M|            value = std::move(str);
 2007|  1.18M|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|  1.18M|         }
 2009|  1.18M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  1.21M|      {
  466|  1.21M|         skip_inline_ws(it, end);
  467|       |
  468|  1.21M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 10, False: 1.21M]
  ------------------
  469|     10|            if constexpr (!AllowEmptyInput) {
  470|     10|               ctx.error = error_code::unexpected_end;
  471|     10|            }
  472|     10|            return true;
  473|     10|         }
  474|       |
  475|  1.21M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.21M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 1.21M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  1.21M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 1.21M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  1.21M|         skip_inline_ws(it, end);
  486|       |
  487|  1.21M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 1.21M]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  1.21M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 35.8k, False: 1.18M]
  ------------------
  495|  35.8k|            return true;
  496|  35.8k|         }
  497|       |
  498|  1.18M|         return false;
  499|  1.21M|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1966|  1.21M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  1.21M|      {
  409|  1.21M|         state.has_anchor = false;
  410|  1.21M|         state.anchor_name.clear();
  411|  1.21M|         state.anchor_start = nullptr;
  412|  1.21M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.21M|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  1.21M|            else {
  421|  1.21M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 35.8k, False: 1.18M]
  ------------------
  422|  1.21M|            }
  423|  1.21M|         }
  424|       |
  425|  1.21M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.18M, False: 35.8k]
  |  Branch (425:27): [True: 36.0k, False: 1.14M]
  ------------------
  426|  36.0k|            ++it;
  427|  36.0k|            auto name = parse_anchor_name(it, end);
  428|  36.0k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 24, False: 36.0k]
  ------------------
  429|     24|               ctx.error = error_code::syntax_error;
  430|     24|               return true;
  431|     24|            }
  432|  36.0k|            skip_inline_ws(it, end);
  433|  36.0k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 22, False: 36.0k]
  ------------------
  434|     22|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     22|                  ctx.error = error_code::unexpected_end;
  436|     22|               }
  437|     22|               return true;
  438|     22|            }
  439|  36.0k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  36.0k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 18, False: 36.0k]
  ------------------
  441|     18|                  ctx.error = error_code::syntax_error;
  442|     18|                  return true;
  443|     18|               }
  444|  36.0k|            }
  445|  36.0k|            state.has_anchor = true;
  446|  36.0k|            state.anchor_name = std::string(name);
  447|  36.0k|            state.anchor_start = &*it;
  448|  36.0k|         }
  449|       |
  450|  1.21M|         return false;
  451|  1.21M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|  1.21M|      {
  301|  1.21M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.21M]
  |  Branch (301:27): [True: 1.18M, False: 35.8k]
  ------------------
  302|       |
  303|  35.8k|         ++it; // skip '*'
  304|  35.8k|         auto name = parse_anchor_name(it, end);
  305|  35.8k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 18, False: 35.8k]
  ------------------
  306|     18|            ctx.error = error_code::syntax_error;
  307|     18|            return true;
  308|     18|         }
  309|       |
  310|  35.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  35.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 30, False: 35.7k]
  ------------------
  312|     30|            ctx.error = error_code::syntax_error; // undefined alias
  313|     30|            return true;
  314|     30|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  35.7k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  35.7k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.15k, False: 34.6k]
  ------------------
  322|  1.15k|            return true;
  323|  1.15k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  34.6k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 6, False: 34.6k]
  ------------------
  329|      6|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      6|            return true;
  331|      6|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  34.6k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  34.6k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 30, False: 34.5k]
  ------------------
  339|     30|            return true;
  340|       |
  341|  34.5k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 32, False: 34.5k]
  ------------------
  342|     32|            ctx.error = error_code::exceeded_max_expansion;
  343|     32|            ctx.custom_error_message = "alias expansion";
  344|     32|            return true;
  345|     32|         }
  346|       |
  347|  34.5k|         auto replay_it = span.begin;
  348|  34.5k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  34.5k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  34.5k|         ctx.indent_stack.clear();
  353|  34.5k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 12.6k, False: 21.9k]
  ------------------
  354|  12.6k|            ctx.push_indent(span.base_indent - 1);
  355|  12.6k|         }
  356|       |
  357|  34.5k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  34.5k|         using V = std::remove_cvref_t<T>;
  360|  34.5k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  34.5k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  34.5k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  34.5k|         return true;
  367|  34.5k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   811k|      {
 5284|   811k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   811k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   811k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   811k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   811k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 811k, False: 0]
  ------------------
 5294|   811k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   811k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2115|   820k|      {
 2116|   820k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 820k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|   820k|         yaml::node_preamble_state preamble{};
 2120|   820k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 13.5k, False: 807k]
  ------------------
 2121|   820k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   820k|                   return yaml::tag_valid_for_float(tag);
 2123|   820k|                }
 2124|   820k|                else {
 2125|   820k|                   return yaml::tag_valid_for_int(tag);
 2126|   820k|                }
 2127|   820k|             }))
 2128|  13.5k|            return;
 2129|       |
 2130|   807k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|   807k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|   807k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|   807k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 87.3k, False: 720k]
  ------------------
 2138|  87.3k|               ++it;
 2139|  87.3k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 78.2k, False: 9.09k]
  |  Branch (2139:38): [True: 4.38k, False: 73.8k]
  |  Branch (2139:74): [True: 3.99k, False: 69.8k]
  ------------------
 2140|  69.8k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 1.52k, False: 68.3k]
  ------------------
 2141|  9.89k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  9.89k|                  it += 3;
 2143|  9.89k|                  finalize();
 2144|  9.89k|                  return;
 2145|  9.89k|               }
 2146|  77.4k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 68.3k, False: 9.09k]
  |  Branch (2146:38): [True: 2.21k, False: 66.1k]
  |  Branch (2146:74): [True: 1.78k, False: 64.3k]
  ------------------
 2147|  64.3k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 4.78k, False: 59.5k]
  ------------------
 2148|  8.78k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  8.78k|                  it += 3;
 2150|  8.78k|                  finalize();
 2151|  8.78k|                  return;
 2152|  8.78k|               }
 2153|  68.6k|               it = start;
 2154|  68.6k|            }
 2155|       |
 2156|   788k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 11.5k, False: 777k]
  |  Branch (2156:31): [True: 48.1k, False: 729k]
  ------------------
 2157|  59.6k|               const char sign = *it;
 2158|  59.6k|               ++it;
 2159|  59.6k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 58.4k, False: 1.22k]
  |  Branch (2159:33): [True: 11.4k, False: 47.0k]
  ------------------
 2160|  11.4k|                  ++it;
 2161|  11.4k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 9.94k, False: 1.47k]
  |  Branch (2161:41): [True: 4.05k, False: 5.89k]
  |  Branch (2161:77): [True: 1.32k, False: 4.56k]
  ------------------
 2162|  7.45k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 2.07k, False: 2.49k]
  ------------------
 2163|  7.45k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 5.02k, False: 2.42k]
  ------------------
 2164|  5.02k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  5.02k|                     }
 2166|  2.42k|                     else {
 2167|  2.42k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|  2.42k|                     }
 2169|  7.45k|                     it += 3;
 2170|  7.45k|                     finalize();
 2171|  7.45k|                     return;
 2172|  7.45k|                  }
 2173|  11.4k|               }
 2174|  52.2k|               it = start;
 2175|  52.2k|            }
 2176|   788k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|   781k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  41.7M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 41.7M, False: 31.7k]
  ------------------
 2183|  41.7M|            const char c = *it;
 2184|  41.7M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 63.8k, False: 41.6M]
  |  Branch (2184:29): [True: 27.2k, False: 41.6M]
  |  Branch (2184:42): [True: 36.9k, False: 41.5M]
  |  Branch (2184:55): [True: 9.72k, False: 41.5M]
  |  Branch (2184:68): [True: 576k, False: 41.0M]
  |  Branch (2184:80): [True: 3.89k, False: 41.0M]
  |  Branch (2184:92): [True: 4.23k, False: 40.9M]
  |  Branch (2184:104): [True: 29.6k, False: 40.9M]
  ------------------
 2185|   752k|               break;
 2186|   752k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  40.9M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 17.5M, False: 23.4M]
  ------------------
 2189|  17.5M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 2.07k, False: 17.5M]
  |  Branch (2189:39): [True: 16.4k, False: 17.5M]
  |  Branch (2189:59): [True: 406, False: 17.5M]
  |  Branch (2189:80): [True: 1.12k, False: 17.5M]
  |  Branch (2189:101): [True: 3.27k, False: 17.5M]
  ------------------
 2190|  23.2k|                  break;
 2191|  23.2k|               }
 2192|  17.5M|            }
 2193|  40.9M|            ++it;
 2194|  40.9M|         }
 2195|       |
 2196|   807k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|   807k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 800, False: 806k]
  ------------------
 2199|    800|            ctx.error = error_code::parse_number_failure;
 2200|    800|            return;
 2201|    800|         }
 2202|       |
 2203|       |         // Handle hex, octal, binary
 2204|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2205|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2206|       |               int base = 10;
 2207|       |               size_t offset = 0;
 2208|       |
 2209|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2210|       |                  base = 16;
 2211|       |                  offset = 2;
 2212|       |               }
 2213|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2214|       |                  base = 8;
 2215|       |                  offset = 2;
 2216|       |               }
 2217|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2218|       |                  base = 2;
 2219|       |                  offset = 2;
 2220|       |               }
 2221|       |
 2222|       |               if (base != 10) {
 2223|       |                  const auto digits = num_str.substr(offset);
 2224|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2225|       |
 2226|       |                  std::string clean_storage;
 2227|       |                  std::string_view clean_view;
 2228|       |
 2229|       |                  if (has_underscores) {
 2230|       |                     clean_storage.reserve(digits.size());
 2231|       |                     for (char c : digits) {
 2232|       |                        if (c != '_') {
 2233|       |                           clean_storage.push_back(c);
 2234|       |                        }
 2235|       |                     }
 2236|       |                     clean_view = clean_storage;
 2237|       |                  }
 2238|       |                  else {
 2239|       |                     clean_view = digits;
 2240|       |                  }
 2241|       |
 2242|       |                  auto [ptr, ec] =
 2243|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2244|       |                  if (ec != std::errc{}) {
 2245|       |                     ctx.error = error_code::parse_number_failure;
 2246|       |                  }
 2247|       |                  finalize();
 2248|       |                  return;
 2249|       |               }
 2250|       |            }
 2251|       |         }
 2252|   806k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|   806k|            bool negative = false;
 2254|   806k|            std::string_view digits = num_str;
 2255|       |
 2256|   806k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 780k, False: 26.1k]
  |  Branch (2256:37): [True: 45.7k, False: 734k]
  |  Branch (2256:62): [True: 6.50k, False: 728k]
  ------------------
 2257|  52.2k|               negative = (digits.front() == '-');
 2258|  52.2k|               digits.remove_prefix(1);
 2259|  52.2k|            }
 2260|       |
 2261|   806k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 176k, False: 629k]
  |  Branch (2261:38): [True: 55.2k, False: 121k]
  ------------------
 2262|  55.2k|               int base = 10;
 2263|  55.2k|               size_t offset = 0;
 2264|       |
 2265|  55.2k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 7.95k, False: 47.3k]
  |  Branch (2265:40): [True: 1.74k, False: 45.5k]
  ------------------
 2266|  9.69k|                  base = 16;
 2267|  9.69k|                  offset = 2;
 2268|  9.69k|               }
 2269|  45.5k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 1.27k, False: 44.2k]
  |  Branch (2269:45): [True: 2.86k, False: 41.4k]
  ------------------
 2270|  4.13k|                  base = 8;
 2271|  4.13k|                  offset = 2;
 2272|  4.13k|               }
 2273|  41.4k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 998, False: 40.4k]
  |  Branch (2273:45): [True: 1.18k, False: 39.2k]
  ------------------
 2274|  2.17k|                  base = 2;
 2275|  2.17k|                  offset = 2;
 2276|  2.17k|               }
 2277|       |
 2278|  55.2k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 16.0k, False: 39.2k]
  ------------------
 2279|  16.0k|                  auto raw_digits = digits.substr(offset);
 2280|  16.0k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  16.0k|                  std::string clean_storage;
 2283|  16.0k|                  std::string_view clean_view;
 2284|  16.0k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 5.65k, False: 10.3k]
  ------------------
 2285|  5.65k|                     clean_storage.reserve(raw_digits.size());
 2286|  2.25M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 2.25M, False: 5.65k]
  ------------------
 2287|  2.25M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 2.23M, False: 15.2k]
  ------------------
 2288|  2.23M|                           clean_storage.push_back(c);
 2289|  2.23M|                        }
 2290|  2.25M|                     }
 2291|  5.65k|                     clean_view = clean_storage;
 2292|  5.65k|                  }
 2293|  10.3k|                  else {
 2294|  10.3k|                     clean_view = raw_digits;
 2295|  10.3k|                  }
 2296|       |
 2297|  16.0k|                  uint64_t parsed_int{};
 2298|  16.0k|                  auto [ptr, ec] =
 2299|  16.0k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  16.0k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 7.77k, False: 8.23k]
  |  Branch (2300:44): [True: 3.02k, False: 5.21k]
  ------------------
 2301|  10.7k|                     ctx.error = error_code::parse_number_failure;
 2302|  10.7k|                     finalize();
 2303|  10.7k|                     return;
 2304|  10.7k|                  }
 2305|       |
 2306|  5.21k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  5.21k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 3.56k, False: 1.64k]
  ------------------
 2308|  5.21k|                  finalize();
 2309|  5.21k|                  return;
 2310|  16.0k|               }
 2311|  55.2k|            }
 2312|   806k|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|   790k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|   806k|         std::string clean_storage;
 2318|   806k|         std::string_view clean_view;
 2319|       |
 2320|   806k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 9.15k, False: 797k]
  ------------------
 2321|  9.15k|            clean_storage.reserve(num_str.size());
 2322|  29.3M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 29.3M, False: 9.15k]
  ------------------
 2323|  29.3M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 29.3M, False: 54.1k]
  ------------------
 2324|  29.3M|                  clean_storage.push_back(c);
 2325|  29.3M|               }
 2326|  29.3M|            }
 2327|  9.15k|            clean_view = clean_storage;
 2328|  9.15k|         }
 2329|   797k|         else {
 2330|   797k|            clean_view = num_str;
 2331|   797k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|   806k|         auto parse_view = clean_view;
 2336|   806k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 764k, False: 42.2k]
  |  Branch (2336:37): [True: 45.7k, False: 718k]
  ------------------
 2337|  45.7k|            parse_view.remove_prefix(1);
 2338|  45.7k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 18.0k, False: 27.6k]
  ------------------
 2339|  18.0k|               ctx.error = error_code::parse_number_failure;
 2340|  18.0k|               return;
 2341|  18.0k|            }
 2342|  45.7k|         }
 2343|       |
 2344|   788k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|   788k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2346|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2347|   788k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 119k, False: 669k]
  |  Branch (2347:45): [True: 123k, False: 545k]
  ------------------
 2348|   200k|               ctx.error = error_code::parse_number_failure;
 2349|   200k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|   788k|         finalize();
 2360|   788k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERdNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EdE2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   820k|      {
  466|   820k|         skip_inline_ws(it, end);
  467|       |
  468|   820k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 260, False: 820k]
  ------------------
  469|    260|            if constexpr (!AllowEmptyInput) {
  470|    260|               ctx.error = error_code::unexpected_end;
  471|    260|            }
  472|    260|            return true;
  473|    260|         }
  474|       |
  475|   820k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   820k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 66, False: 820k]
  ------------------
  477|     66|            ctx.error = error_code::syntax_error;
  478|     66|            return true;
  479|     66|         }
  480|   820k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 62, False: 820k]
  ------------------
  481|     62|            ctx.error = error_code::syntax_error;
  482|     62|            return true;
  483|     62|         }
  484|       |
  485|   820k|         skip_inline_ws(it, end);
  486|       |
  487|   820k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 144, False: 820k]
  ------------------
  488|    144|            if constexpr (!AllowEmptyInput) {
  489|    144|               ctx.error = error_code::unexpected_end;
  490|    144|            }
  491|    144|            return true;
  492|    144|         }
  493|       |
  494|   820k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 13.0k, False: 807k]
  ------------------
  495|  13.0k|            return true;
  496|  13.0k|         }
  497|       |
  498|   807k|         return false;
  499|   820k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2120|   820k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|   820k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   820k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|   820k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   820k|      {
  409|   820k|         state.has_anchor = false;
  410|   820k|         state.anchor_name.clear();
  411|   820k|         state.anchor_start = nullptr;
  412|   820k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   820k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   820k|            else {
  421|   820k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 12.5k, False: 807k]
  ------------------
  422|   820k|            }
  423|   820k|         }
  424|       |
  425|   820k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 807k, False: 12.5k]
  |  Branch (425:27): [True: 10.0k, False: 797k]
  ------------------
  426|  10.0k|            ++it;
  427|  10.0k|            auto name = parse_anchor_name(it, end);
  428|  10.0k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 266, False: 9.82k]
  ------------------
  429|    266|               ctx.error = error_code::syntax_error;
  430|    266|               return true;
  431|    266|            }
  432|  9.82k|            skip_inline_ws(it, end);
  433|  9.82k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 246, False: 9.57k]
  ------------------
  434|    246|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    246|                  ctx.error = error_code::unexpected_end;
  436|    246|               }
  437|    246|               return true;
  438|    246|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  9.57k|            state.has_anchor = true;
  446|  9.57k|            state.anchor_name = std::string(name);
  447|  9.57k|            state.anchor_start = &*it;
  448|  9.57k|         }
  449|       |
  450|   819k|         return false;
  451|   820k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   820k|      {
  301|   820k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 820k]
  |  Branch (301:27): [True: 807k, False: 12.5k]
  ------------------
  302|       |
  303|  12.5k|         ++it; // skip '*'
  304|  12.5k|         auto name = parse_anchor_name(it, end);
  305|  12.5k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 188, False: 12.3k]
  ------------------
  306|    188|            ctx.error = error_code::syntax_error;
  307|    188|            return true;
  308|    188|         }
  309|       |
  310|  12.3k|         auto anchor_it = ctx.anchors.find(name);
  311|  12.3k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 752, False: 11.5k]
  ------------------
  312|    752|            ctx.error = error_code::syntax_error; // undefined alias
  313|    752|            return true;
  314|    752|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  11.5k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  11.5k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.58k, False: 9.98k]
  ------------------
  322|  1.58k|            return true;
  323|  1.58k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  9.98k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 172, False: 9.81k]
  ------------------
  329|    172|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    172|            return true;
  331|    172|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  9.81k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  9.81k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 9.80k]
  ------------------
  339|      4|            return true;
  340|       |
  341|  9.80k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 9.80k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  9.80k|         auto replay_it = span.begin;
  348|  9.80k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  9.80k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  9.80k|         ctx.indent_stack.clear();
  353|  9.80k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 3.59k, False: 6.21k]
  ------------------
  354|  3.59k|            ctx.push_indent(span.base_indent - 1);
  355|  3.59k|         }
  356|       |
  357|  9.80k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  9.80k|         using V = std::remove_cvref_t<T>;
  360|  9.80k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  9.80k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  9.80k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  9.80k|         return true;
  367|  9.80k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|   788k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|  59.5k|      {
 5284|  59.5k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|  59.5k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|  59.5k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|  59.5k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|  59.5k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 59.5k, False: 0]
  ------------------
 5294|  59.5k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|  59.5k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2080|  69.5k|      {
 2081|  69.5k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 69.5k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  69.5k|         yaml::node_preamble_state preamble{};
 2085|  69.5k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 11.1k, False: 58.4k]
  ------------------
 2086|  69.5k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  11.1k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  58.4k|         std::string str;
 2091|  58.4k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  58.4k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 6.49k, False: 51.9k]
  |  Branch (2093:31): [True: 1.25k, False: 50.6k]
  |  Branch (2093:48): [True: 1.33k, False: 49.3k]
  |  Branch (2093:65): [True: 910, False: 48.4k]
  |  Branch (2093:81): [True: 1.63k, False: 46.7k]
  |  Branch (2093:97): [True: 198, False: 46.5k]
  ------------------
 2094|  46.5k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 2.15k, False: 44.4k]
  |  Branch (2094:29): [True: 1.28k, False: 43.1k]
  |  Branch (2094:44): [True: 1.72k, False: 41.4k]
  ------------------
 2095|  16.9k|            value = true;
 2096|  16.9k|         }
 2097|  41.4k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 11.3k, False: 30.1k]
  |  Branch (2097:37): [True: 3.17k, False: 26.9k]
  |  Branch (2097:55): [True: 3.70k, False: 23.2k]
  |  Branch (2097:73): [True: 474, False: 22.7k]
  |  Branch (2097:88): [True: 13.3k, False: 9.45k]
  |  Branch (2097:103): [True: 340, False: 9.11k]
  ------------------
 2098|  41.2k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 992, False: 8.12k]
  |  Branch (2098:35): [True: 354, False: 7.76k]
  |  Branch (2098:51): [True: 7.58k, False: 180]
  ------------------
 2099|  41.2k|            value = false;
 2100|  41.2k|         }
 2101|    180|         else {
 2102|    180|            ctx.error = error_code::expected_true_or_false;
 2103|    180|         }
 2104|       |
 2105|  58.4k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  58.4k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  69.5k|      {
  466|  69.5k|         skip_inline_ws(it, end);
  467|       |
  468|  69.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 69.5k]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|  69.5k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  69.5k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 69.5k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  69.5k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 69.5k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  69.5k|         skip_inline_ws(it, end);
  486|       |
  487|  69.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 69.5k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  69.5k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 11.1k, False: 58.4k]
  ------------------
  495|  11.1k|            return true;
  496|  11.1k|         }
  497|       |
  498|  58.4k|         return false;
  499|  69.5k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2086|  69.5k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERbNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  69.5k|      {
  409|  69.5k|         state.has_anchor = false;
  410|  69.5k|         state.anchor_name.clear();
  411|  69.5k|         state.anchor_start = nullptr;
  412|  69.5k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  69.5k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  69.5k|            else {
  421|  69.5k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 11.1k, False: 58.4k]
  ------------------
  422|  69.5k|            }
  423|  69.5k|         }
  424|       |
  425|  69.5k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 58.4k, False: 11.1k]
  |  Branch (425:27): [True: 9.49k, False: 48.9k]
  ------------------
  426|  9.49k|            ++it;
  427|  9.49k|            auto name = parse_anchor_name(it, end);
  428|  9.49k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 10, False: 9.48k]
  ------------------
  429|     10|               ctx.error = error_code::syntax_error;
  430|     10|               return true;
  431|     10|            }
  432|  9.48k|            skip_inline_ws(it, end);
  433|  9.48k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 12, False: 9.47k]
  ------------------
  434|     12|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     12|                  ctx.error = error_code::unexpected_end;
  436|     12|               }
  437|     12|               return true;
  438|     12|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  9.47k|            state.has_anchor = true;
  446|  9.47k|            state.anchor_name = std::string(name);
  447|  9.47k|            state.anchor_start = &*it;
  448|  9.47k|         }
  449|       |
  450|  69.5k|         return false;
  451|  69.5k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  69.5k|      {
  301|  69.5k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 69.5k]
  |  Branch (301:27): [True: 58.4k, False: 11.1k]
  ------------------
  302|       |
  303|  11.1k|         ++it; // skip '*'
  304|  11.1k|         auto name = parse_anchor_name(it, end);
  305|  11.1k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 24, False: 11.0k]
  ------------------
  306|     24|            ctx.error = error_code::syntax_error;
  307|     24|            return true;
  308|     24|         }
  309|       |
  310|  11.0k|         auto anchor_it = ctx.anchors.find(name);
  311|  11.0k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 38, False: 11.0k]
  ------------------
  312|     38|            ctx.error = error_code::syntax_error; // undefined alias
  313|     38|            return true;
  314|     38|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  11.0k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  11.0k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.04k, False: 10.0k]
  ------------------
  322|  1.04k|            return true;
  323|  1.04k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  10.0k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 0, False: 10.0k]
  ------------------
  329|      0|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      0|            return true;
  331|      0|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  10.0k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  10.0k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 10.0k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  10.0k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 10.0k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  10.0k|         auto replay_it = span.begin;
  348|  10.0k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  10.0k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  10.0k|         ctx.indent_stack.clear();
  353|  10.0k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.87k, False: 8.12k]
  ------------------
  354|  1.87k|            ctx.push_indent(span.base_indent - 1);
  355|  1.87k|         }
  356|       |
  357|  10.0k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  10.0k|         using V = std::remove_cvref_t<T>;
  360|  10.0k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  10.0k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  10.0k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  10.0k|         return true;
  367|  10.0k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2466|  32.9k|      {
 2467|  32.9k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 32.9k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  32.9k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  32.9k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 10, False: 32.8k]
  ------------------
 2473|     10|            ctx.error = error_code::unexpected_end;
 2474|     10|            return;
 2475|     10|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  32.8k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 6.59k, False: 26.2k]
  ------------------
 2479|  6.59k|            ++it;
 2480|  6.59k|            return;
 2481|  6.59k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  26.2k|         auto start = it;
 2485|   121k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 119k, False: 1.58k]
  |  Branch (2485:30): [True: 94.7k, False: 24.7k]
  ------------------
 2486|  94.7k|            ++it;
 2487|  94.7k|         }
 2488|       |
 2489|  26.2k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  26.2k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 28, False: 26.2k]
  ------------------
 2491|     28|            ctx.error = error_code::syntax_error;
 2492|     28|         }
 2493|  26.2k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|  2.91M|      {
 5284|  2.91M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|  2.91M|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|  2.91M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|  2.91M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|  2.91M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 2.91M, False: 0]
  ------------------
 5294|  2.91M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|  2.91M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4593|  2.95M|      {
 4594|  2.95M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4594:14): [True: 0, False: 2.95M]
  ------------------
 4595|      0|            return;
 4596|       |
 4597|  2.95M|         yaml::node_preamble_state preamble{};
 4598|  2.95M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4598:14): [True: 46.9k, False: 2.91M]
  ------------------
 4599|  2.95M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4600|  46.9k|            return;
 4601|       |
 4602|  2.91M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4603|  2.91M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4604|       |
 4605|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4606|       |         // value of a key that existed before the read and adds new keys, while
 4607|       |         // pre-existing keys the document does not mention are preserved (like a
 4608|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4609|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4610|       |         // mappings disallow duplicate keys and the conformance suite expects
 4611|       |         // first-wins, which falls out of emplace into an empty map. Any
 4612|       |         // pre-existing entry the document leaves untouched is restored on scope
 4613|       |         // exit (including error paths). When the target starts empty (the common
 4614|       |         // case) this is a no-op with negligible cost.
 4615|  2.91M|         std::remove_cvref_t<T> preexisting_entries;
 4616|  2.91M|         if (!value.empty()) {
  ------------------
  |  Branch (4616:14): [True: 0, False: 2.91M]
  ------------------
 4617|      0|            preexisting_entries = std::move(value);
 4618|      0|            value.clear();
 4619|      0|         }
 4620|  2.91M|         struct merge_restore_guard
 4621|  2.91M|         {
 4622|  2.91M|            std::remove_cvref_t<T>& target;
 4623|  2.91M|            std::remove_cvref_t<T>& saved;
 4624|  2.91M|            ~merge_restore_guard()
 4625|  2.91M|            {
 4626|       |               // emplace is a no-op for keys the document already wrote, so only
 4627|       |               // untouched pre-existing entries are put back.
 4628|  2.91M|               for (auto& entry : saved) {
 4629|  2.91M|                  target.emplace(entry.first, std::move(entry.second));
 4630|  2.91M|               }
 4631|  2.91M|            }
 4632|  2.91M|         } merge_restore{value, preexisting_entries};
 4633|       |
 4634|  2.91M|         const bool treat_as_block_mapping =
 4635|  2.91M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4635:13): [Folded, False: 2.91M]
  |  Branch (4635:48): [True: 0, False: 0]
  |  Branch (4635:62): [True: 0, False: 0]
  ------------------
 4636|       |
 4637|  2.91M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4637:14): [True: 1.89M, False: 1.01M]
  |  Branch (4637:28): [True: 0, Folded]
  ------------------
 4638|       |            // Flow mapping
 4639|  1.89M|            ++it;
 4640|       |            // Skip whitespace and newlines after opening brace
 4641|  1.89M|            yaml::skip_ws_and_newlines(it, end);
 4642|       |
 4643|  1.89M|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4643:17): [True: 1.89M, False: 1.12k]
  |  Branch (4643:30): [True: 41.1k, False: 1.85M]
  ------------------
 4644|  41.1k|               ++it;
 4645|  41.1k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4646|  41.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4646:20): [True: 6, False: 41.1k]
  ------------------
 4647|      6|                  return;
 4648|  41.1k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4649|  41.1k|               return;
 4650|  41.1k|            }
 4651|       |
 4652|  5.55M|            while (it != end) {
  ------------------
  |  Branch (4652:20): [True: 5.54M, False: 8.73k]
  ------------------
 4653|       |               // Skip whitespace and newlines at start of each iteration
 4654|  5.54M|               yaml::skip_ws_and_newlines(it, end);
 4655|       |
 4656|  5.54M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4656:20): [True: 5.54M, False: 0]
  |  Branch (4656:33): [True: 64.3k, False: 5.48M]
  ------------------
 4657|  64.3k|                  ++it;
 4658|  64.3k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4659|  64.3k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4659:23): [True: 6, False: 64.3k]
  ------------------
 4660|      6|                     return;
 4661|  64.3k|                  break;
 4662|  64.3k|               }
 4663|       |
 4664|  5.48M|               bool explicit_flow_key = false;
 4665|  5.48M|               auto explicit_probe = it;
 4666|  5.48M|               yaml::skip_inline_ws(explicit_probe, end);
 4667|  5.48M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4667:20): [True: 5.48M, False: 0]
  |  Branch (4667:45): [True: 68.2k, False: 5.41M]
  ------------------
 4668|  68.2k|                  const auto after_q = explicit_probe + 1;
 4669|  68.2k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4669:23): [True: 8, False: 68.2k]
  |  Branch (4669:41): [True: 28.2k, False: 40.0k]
  ------------------
 4670|  40.0k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4670:23): [True: 6.94k, False: 33.1k]
  |  Branch (4670:42): [True: 924, False: 32.1k]
  ------------------
 4671|  36.0k|                     explicit_flow_key = true;
 4672|  36.0k|                     it = explicit_probe + 1;
 4673|  36.0k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4674|  36.0k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4674:26): [True: 6, False: 36.0k]
  ------------------
 4675|      6|                        return;
 4676|  36.0k|                  }
 4677|  68.2k|               }
 4678|       |               // Parse key
 4679|  5.48M|               key_t key{};
 4680|  5.48M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4681|  5.48M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4681:23): [True: 36.0k, False: 5.44M]
  |  Branch (4681:44): [True: 36.0k, False: 14]
  |  Branch (4681:58): [True: 1.58k, False: 34.4k]
  |  Branch (4681:72): [True: 16.3k, False: 18.1k]
  |  Branch (4681:86): [True: 978, False: 17.1k]
  ------------------
 4682|  18.9k|                     key.clear();
 4683|  18.9k|                  }
 4684|  5.46M|                  else {
 4685|  5.46M|                     auto key_probe = it;
 4686|  5.46M|                     yaml::skip_inline_ws(key_probe, end);
 4687|       |
 4688|       |                     // Use full node parsing only for structurally complex flow keys.
 4689|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4690|  5.46M|                     bool parse_complex_flow_key = false;
 4691|  5.46M|                     if (key_probe != end) {
  ------------------
  |  Branch (4691:26): [True: 5.46M, False: 14]
  ------------------
 4692|  5.46M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4692:29): [True: 8.76k, False: 5.45M]
  |  Branch (4692:50): [True: 71.8k, False: 5.38M]
  ------------------
 4693|  80.6k|                           parse_complex_flow_key = true;
 4694|  80.6k|                        }
 4695|  5.38M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4695:34): [True: 1.66M, False: 3.71M]
  ------------------
 4696|  1.66M|                           ++key_probe;
 4697|  1.66M|                           yaml::parse_anchor_name(key_probe, end);
 4698|  1.66M|                           yaml::skip_inline_ws(key_probe, end);
 4699|  1.66M|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4699:32): [True: 1.66M, False: 48]
  |  Branch (4699:53): [True: 8.93k, False: 1.65M]
  |  Branch (4699:74): [True: 769k, False: 886k]
  ------------------
 4700|   778k|                              parse_complex_flow_key = true;
 4701|   778k|                           }
 4702|  1.66M|                        }
 4703|  5.46M|                     }
 4704|       |
 4705|  5.46M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4705:26): [True: 858k, False: 4.60M]
  ------------------
 4706|   858k|                        glz::generic key_node{};
 4707|   858k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4708|   858k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4708:29): [True: 3.40k, False: 855k]
  ------------------
 4709|  3.40k|                           return;
 4710|   855k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4710:29): [True: 14, False: 855k]
  ------------------
 4711|     14|                           return;
 4712|   855k|                     }
 4713|  4.60M|                     else {
 4714|  4.60M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4714:29): [True: 79.6k, False: 4.52M]
  ------------------
 4715|  79.6k|                           return;
 4716|  79.6k|                        }
 4717|  4.60M|                     }
 4718|  5.46M|                  }
 4719|       |               }
 4720|       |               else {
 4721|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4722|       |                     ctx.error = error_code::syntax_error;
 4723|       |                     return;
 4724|       |                  }
 4725|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4726|       |                  if (bool(ctx.error)) [[unlikely]]
 4727|       |                     return;
 4728|       |               }
 4729|       |
 4730|       |               // Separation between flow key and ':' may include comments/newlines.
 4731|       |               // In flow context, newlines are allowed between key and ':'.
 4732|  5.39M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4733|  5.48M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4733:20): [True: 10, False: 5.48M]
  ------------------
 4734|     10|                  return;
 4735|       |
 4736|  5.48M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4737|  5.48M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4738|  5.48M|                     val = {};
 4739|  5.48M|                     return true;
 4740|  5.48M|                  }
 4741|  5.48M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4742|  5.48M|                     val = glz::generic{};
 4743|  5.48M|                     return true;
 4744|  5.48M|                  }
 4745|  5.48M|                  else {
 4746|  5.48M|                     static constexpr std::string_view null_value{"null"};
 4747|  5.48M|                     auto null_it = null_value.data();
 4748|  5.48M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4749|  5.48M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4750|  5.48M|                     return !bool(ctx.error);
 4751|  5.48M|                  }
 4752|  5.48M|               };
 4753|       |
 4754|  5.48M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4754:20): [True: 5.39M, False: 83.1k]
  |  Branch (4754:34): [True: 2.17M, False: 3.22M]
  |  Branch (4754:48): [True: 1.03M, False: 2.19M]
  ------------------
 4755|  3.20M|                  val_t val{};
 4756|  3.20M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4756:23): [True: 0, False: 3.20M]
  ------------------
 4757|      0|                     return;
 4758|       |
 4759|  3.20M|                  value.emplace(std::move(key), std::move(val));
 4760|       |
 4761|  3.20M|                  if (*it == '}') {
  ------------------
  |  Branch (4761:23): [True: 1.03M, False: 2.17M]
  ------------------
 4762|  1.03M|                     ++it;
 4763|  1.03M|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4764|  1.03M|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4764:26): [True: 12, False: 1.03M]
  ------------------
 4765|     12|                        return;
 4766|  1.03M|                     break;
 4767|  1.03M|                  }
 4768|       |
 4769|  2.17M|                  ++it; // skip comma
 4770|  2.17M|                  yaml::skip_ws_and_newlines(it, end);
 4771|  2.17M|                  continue;
 4772|  3.20M|               }
 4773|       |
 4774|  2.27M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4774:20): [True: 83.1k, False: 2.19M]
  |  Branch (4774:33): [True: 50, False: 2.19M]
  ------------------
 4775|    144|                  ctx.error = error_code::syntax_error;
 4776|    144|                  return;
 4777|    144|               }
 4778|  2.27M|               ++it;
 4779|       |
 4780|  2.27M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4781|  2.27M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4781:20): [True: 8, False: 2.27M]
  ------------------
 4782|      8|                  return;
 4783|       |
 4784|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4785|  2.27M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4785:20): [True: 2.19M, False: 83.0k]
  |  Branch (4785:34): [True: 117k, False: 2.07M]
  |  Branch (4785:48): [True: 34.6k, False: 2.03M]
  ------------------
 4786|   152k|                  val_t val{};
 4787|   152k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4787:23): [True: 0, False: 152k]
  ------------------
 4788|      0|                     return;
 4789|       |
 4790|   152k|                  value.emplace(std::move(key), std::move(val));
 4791|       |
 4792|   152k|                  if (*it == '}') {
  ------------------
  |  Branch (4792:23): [True: 34.6k, False: 117k]
  ------------------
 4793|  34.6k|                     ++it;
 4794|  34.6k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4795|  34.6k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4795:26): [True: 6, False: 34.6k]
  ------------------
 4796|      6|                        return;
 4797|  34.6k|                     break;
 4798|  34.6k|                  }
 4799|       |
 4800|   117k|                  ++it; // skip comma
 4801|   117k|                  yaml::skip_ws_and_newlines(it, end);
 4802|   117k|                  continue;
 4803|   152k|               }
 4804|       |
 4805|       |               // Parse value
 4806|  2.12M|               val_t val{};
 4807|  2.12M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4808|  2.12M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 2.98k, False: 2.11M]
  ------------------
 4809|  2.98k|                  return;
 4810|       |
 4811|  2.11M|               value.emplace(std::move(key), std::move(val));
 4812|       |
 4813|  2.11M|               yaml::skip_inline_ws(it, end);
 4814|       |
 4815|  2.11M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4815:20): [True: 2.03M, False: 83.0k]
  |  Branch (4815:33): [True: 606k, False: 1.42M]
  ------------------
 4816|   606k|                  ++it;
 4817|   606k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4818|   606k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4818:23): [True: 6, False: 606k]
  ------------------
 4819|      6|                     return;
 4820|   606k|                  break;
 4821|   606k|               }
 4822|  1.51M|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4822:25): [True: 1.42M, False: 83.0k]
  |  Branch (4822:38): [True: 1.32M, False: 105k]
  ------------------
 4823|  1.32M|                  ++it;
 4824|       |                  // Skip whitespace and newlines after comma
 4825|  1.32M|                  yaml::skip_ws_and_newlines(it, end);
 4826|  1.32M|               }
 4827|   189k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4827:25): [True: 105k, False: 83.0k]
  |  Branch (4827:39): [True: 60.2k, False: 45.6k]
  |  Branch (4827:54): [True: 45.6k, False: 16]
  ------------------
 4828|       |                  // Newlines may precede either the closing brace or the
 4829|       |                  // separator comma for the next entry.
 4830|   105k|                  yaml::skip_ws_and_newlines(it, end);
 4831|   105k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4831:23): [True: 105k, False: 20]
  |  Branch (4831:36): [True: 17.2k, False: 88.6k]
  ------------------
 4832|  17.2k|                     ++it;
 4833|  17.2k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4834|  17.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4834:26): [True: 6, False: 17.2k]
  ------------------
 4835|      6|                        return;
 4836|  17.2k|                     break;
 4837|  17.2k|                  }
 4838|  88.7k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4838:23): [True: 88.6k, False: 20]
  |  Branch (4838:36): [True: 88.6k, False: 22]
  ------------------
 4839|  88.6k|                     ++it;
 4840|  88.6k|                     yaml::skip_ws_and_newlines(it, end);
 4841|  88.6k|                     continue;
 4842|  88.6k|                  }
 4843|     42|                  ctx.error = error_code::syntax_error;
 4844|     42|                  return;
 4845|  88.7k|               }
 4846|  83.0k|               else {
 4847|  83.0k|                  ctx.error = error_code::syntax_error;
 4848|  83.0k|                  return;
 4849|  83.0k|               }
 4850|  2.11M|            }
 4851|  1.85M|         }
 4852|  1.01M|         else {
 4853|       |            // Block mapping - use shared loop with map-specific callback
 4854|  1.01M|            yaml::parse_block_mapping_loop<Opts>(
 4855|  1.01M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4856|  1.01M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|  1.01M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4858|  1.01M|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|  1.01M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|  1.01M|                           if (ctx.stream_begin) {
 4866|  1.01M|                              auto is_line_content_start = [&](auto pos) {
 4867|  1.01M|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|  1.01M|                              };
 4869|       |
 4870|  1.01M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|  1.01M|                                 const char* line = ctx.line_begin_of(pos);
 4872|  1.01M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|  1.01M|                                 return line != end && *line == ':';
 4874|  1.01M|                              };
 4875|       |
 4876|  1.01M|                              if (!is_line_content_start(it) &&
 4877|  1.01M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4878|  1.01M|                                  !line_has_explicit_value_indicator(it)) {
 4879|  1.01M|                                 ctx.error = error_code::syntax_error;
 4880|  1.01M|                                 return false;
 4881|  1.01M|                              }
 4882|  1.01M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|  1.01M|                           }
 4884|  1.01M|                        }
 4885|       |
 4886|  1.01M|                        if (*it == '-' &&
 4887|  1.01M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4888|  1.01M|                            !line_starts_with_explicit_value_indicator) {
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|  1.01M|                           ctx.error = error_code::syntax_error;
 4891|  1.01M|                           return false;
 4892|  1.01M|                        }
 4893|       |
 4894|  1.01M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4895|  1.01M|                           return false;
 4896|  1.01M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|  1.01M|                        ctx.pop_indent();
 4898|  1.01M|                     }
 4899|  1.01M|                     else {
 4900|  1.01M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|  1.01M|                        if (nested_indent >= 0) {
 4902|  1.01M|                           yaml::skip_to_content(it, end);
 4903|  1.01M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4904|  1.01M|                              ctx.error = error_code::syntax_error;
 4905|  1.01M|                              return false;
 4906|  1.01M|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|  1.01M|                           const int32_t value_indent =
 4910|  1.01M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4911|  1.01M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4912|  1.01M|                              return false;
 4913|  1.01M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|  1.01M|                           ctx.pop_indent();
 4915|  1.01M|                        }
 4916|  1.01M|                     }
 4917|  1.01M|                     return !bool(ctx.error);
 4918|  1.01M|                  };
 4919|       |
 4920|       |                  // Explicit key entry form:
 4921|       |                  // ? key
 4922|       |                  // : value
 4923|  1.01M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4924|  1.01M|                     ctx.error = error_code::syntax_error;
 4925|  1.01M|                     return false;
 4926|  1.01M|                  }
 4927|  1.01M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4928|  1.01M|                     ++it; // skip '?'
 4929|  1.01M|                     yaml::skip_inline_ws(it, end);
 4930|       |
 4931|  1.01M|                     const int32_t explicit_value_indicator_indent =
 4932|  1.01M|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4933|       |
 4934|  1.01M|                     key_t key{};
 4935|  1.01M|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4936|  1.01M|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|  1.01M|                           return yaml::materialize_key(key, key_node, ctx);
 4938|  1.01M|                        };
 4939|       |
 4940|  1.01M|                        auto key_it = it;
 4941|  1.01M|                        yaml::skip_inline_ws(key_it, end);
 4942|       |
 4943|  1.01M|                        auto content = key_it;
 4944|  1.01M|                        yaml::skip_to_content(content, end);
 4945|  1.01M|                        bool handled_anchor_only_empty_key = false;
 4946|       |
 4947|       |                        // Anchor on an empty explicit key node:
 4948|       |                        //   ? &a
 4949|       |                        //   : value
 4950|  1.01M|                        if (content != end && *content == '&') {
 4951|  1.01M|                           auto anchor_probe = content + 1;
 4952|  1.01M|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4953|  1.01M|                           if (!anchor_name.empty()) {
 4954|  1.01M|                              auto after_anchor = anchor_probe;
 4955|  1.01M|                              yaml::skip_inline_ws(after_anchor, end);
 4956|       |
 4957|  1.01M|                              auto value_indicator = after_anchor;
 4958|  1.01M|                              if (value_indicator != end && *value_indicator == ':') {
 4959|  1.01M|                                 key.clear();
 4960|  1.01M|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4961|  1.01M|                                 it = value_indicator;
 4962|  1.01M|                                 handled_anchor_only_empty_key = true;
 4963|  1.01M|                              }
 4964|  1.01M|                              else {
 4965|  1.01M|                                 if (value_indicator != end && *value_indicator == '#') {
 4966|  1.01M|                                    yaml::skip_comment(value_indicator, end);
 4967|  1.01M|                                 }
 4968|  1.01M|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4969|  1.01M|                                    yaml::skip_newline(value_indicator, end);
 4970|  1.01M|                                    auto value_line = value_indicator;
 4971|  1.01M|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4972|  1.01M|                                    if (bool(ctx.error)) [[unlikely]]
 4973|  1.01M|                                       return false;
 4974|  1.01M|                                    if (value_line != end && *value_line == ':' &&
 4975|  1.01M|                                        value_indent == explicit_value_indicator_indent) {
 4976|  1.01M|                                       key.clear();
 4977|  1.01M|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4978|  1.01M|                                       it = value_line;
 4979|  1.01M|                                       handled_anchor_only_empty_key = true;
 4980|  1.01M|                                    }
 4981|  1.01M|                                    else if (value_line != end && *value_line == ':') {
 4982|       |                                       // In explicit-key form ("? &a"), a following ':'
 4983|       |                                       // starts the outer value indicator only at the same
 4984|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4985|  1.01M|                                       ctx.error = error_code::syntax_error;
 4986|  1.01M|                                       return false;
 4987|  1.01M|                                    }
 4988|  1.01M|                                 }
 4989|  1.01M|                              }
 4990|  1.01M|                           }
 4991|  1.01M|                        }
 4992|       |
 4993|  1.01M|                        const bool key_content_spans_lines = [&] {
 4994|  1.01M|                           auto scan = key_it;
 4995|  1.01M|                           while (scan != content && scan != end) {
 4996|  1.01M|                              if (*scan == '\n' || *scan == '\r') return true;
 4997|  1.01M|                              ++scan;
 4998|  1.01M|                           }
 4999|  1.01M|                           return false;
 5000|  1.01M|                        }();
 5001|       |
 5002|  1.01M|                        if (handled_anchor_only_empty_key) {
 5003|       |                           // 'it' already points to the explicit value indicator ':'
 5004|  1.01M|                        }
 5005|  1.01M|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5006|  1.01M|                           key.clear();
 5007|  1.01M|                           it = content;
 5008|  1.01M|                        }
 5009|  1.01M|                        else {
 5010|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5011|       |                           // Parse the key node structurally (not via plain-key scanning)
 5012|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5013|       |                           // as complex keys, not split into implicit key/value pairs.
 5014|  1.01M|                           auto key_node_it = content;
 5015|  1.01M|                           auto key_node_end = end;
 5016|  1.01M|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5017|       |                              // In explicit-key form, a following standalone ':'
 5018|       |                              // line (same or lower indentation) belongs to the
 5019|       |                              // outer mapping value, not the key node itself.
 5020|  1.01M|                              auto scan = content;
 5021|  1.01M|                              while (scan != end) {
 5022|  1.01M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5023|  1.01M|                                    ++scan;
 5024|  1.01M|                                 }
 5025|  1.01M|                                 if (scan == end) {
 5026|  1.01M|                                    break;
 5027|  1.01M|                                 }
 5028|       |
 5029|  1.01M|                                 yaml::skip_newline(scan, end);
 5030|  1.01M|                                 auto line_start = scan;
 5031|       |
 5032|  1.01M|                                 int32_t indicator_indent = 0;
 5033|  1.01M|                                 while (scan != end && *scan == ' ') {
 5034|  1.01M|                                    ++indicator_indent;
 5035|  1.01M|                                    ++scan;
 5036|  1.01M|                                 }
 5037|       |
 5038|  1.01M|                                 if (scan != end && *scan == ':') {
 5039|  1.01M|                                    const auto after_colon = scan + 1;
 5040|  1.01M|                                    if ((after_colon == end ||
 5041|  1.01M|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5042|  1.01M|                                        indicator_indent <= line_indent) {
 5043|  1.01M|                                       key_node_end = line_start;
 5044|  1.01M|                                       break;
 5045|  1.01M|                                    }
 5046|  1.01M|                                 }
 5047|  1.01M|                              }
 5048|  1.01M|                           }
 5049|       |
 5050|  1.01M|                           glz::generic key_node{};
 5051|  1.01M|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5052|  1.01M|                           ctx.explicit_mapping_key_context = true;
 5053|  1.01M|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5054|  1.01M|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5055|  1.01M|                           if (bool(ctx.error)) [[unlikely]]
 5056|  1.01M|                              return false;
 5057|  1.01M|                           it = key_node_it;
 5058|  1.01M|                           if (!to_string_key(key_node)) [[unlikely]]
 5059|  1.01M|                              return false;
 5060|  1.01M|                        }
 5061|  1.01M|                     }
 5062|  1.01M|                     else {
 5063|  1.01M|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5064|  1.01M|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5065|  1.01M|                           if (bool(ctx.error)) [[unlikely]]
 5066|  1.01M|                              return false;
 5067|  1.01M|                        }
 5068|  1.01M|                     }
 5069|       |
 5070|  1.01M|                     yaml::skip_inline_ws(it, end);
 5071|  1.01M|                     yaml::skip_comment(it, end);
 5072|       |
 5073|       |                     // Value indicator may appear on the next line at the same indent.
 5074|  1.01M|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5075|  1.01M|                        auto probe = it;
 5076|  1.01M|                        bool found_value_indicator = false;
 5077|       |
 5078|  1.01M|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5079|  1.01M|                           yaml::skip_newline(probe, end);
 5080|       |
 5081|  1.01M|                           auto value_line = probe;
 5082|  1.01M|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5083|  1.01M|                           if (bool(ctx.error)) [[unlikely]]
 5084|  1.01M|                              return false;
 5085|       |
 5086|  1.01M|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5087|  1.01M|                              probe = value_line;
 5088|  1.01M|                              continue; // blank line
 5089|  1.01M|                           }
 5090|  1.01M|                           if (*value_line == '#') {
 5091|  1.01M|                              yaml::skip_comment(value_line, end);
 5092|  1.01M|                              probe = value_line;
 5093|  1.01M|                              continue; // comment-only line
 5094|  1.01M|                           }
 5095|  1.01M|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5096|  1.01M|                              it = value_line;
 5097|  1.01M|                              found_value_indicator = true;
 5098|  1.01M|                           }
 5099|  1.01M|                           break;
 5100|  1.01M|                        }
 5101|       |
 5102|  1.01M|                        if (found_value_indicator) {
 5103|  1.01M|                           yaml::skip_inline_ws(it, end);
 5104|  1.01M|                        }
 5105|  1.01M|                     }
 5106|       |
 5107|  1.01M|                     val_t val{};
 5108|  1.01M|                     if (it != end && *it == ':') {
 5109|  1.01M|                        ++it;
 5110|  1.01M|                        if (it != end && *it == '\t') {
 5111|  1.01M|                           ctx.error = error_code::syntax_error;
 5112|  1.01M|                           return false;
 5113|  1.01M|                        }
 5114|  1.01M|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5115|  1.01M|                           auto probe = it;
 5116|  1.01M|                           yaml::skip_newline(probe, end);
 5117|  1.01M|                           while (probe != end && *probe == ' ') ++probe;
 5118|  1.01M|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5119|  1.01M|                              ctx.error = error_code::syntax_error;
 5120|  1.01M|                              return false;
 5121|  1.01M|                           }
 5122|  1.01M|                        }
 5123|  1.01M|                        yaml::skip_inline_ws(it, end);
 5124|  1.01M|                        if (!parse_map_value(val)) [[unlikely]]
 5125|  1.01M|                           return false;
 5126|  1.01M|                     }
 5127|       |
 5128|  1.01M|                     value.emplace(std::move(key), std::move(val));
 5129|  1.01M|                     return true;
 5130|  1.01M|                  }
 5131|       |
 5132|  1.01M|                  key_t key{};
 5133|  1.01M|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5134|  1.01M|                     auto key_probe = it;
 5135|  1.01M|                     yaml::skip_inline_ws(key_probe, end);
 5136|  1.01M|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5137|  1.01M|                     if (complex_flow_key) {
 5138|  1.01M|                        glz::generic key_node{};
 5139|  1.01M|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5140|  1.01M|                        if (bool(ctx.error)) [[unlikely]]
 5141|  1.01M|                           return false;
 5142|  1.01M|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5143|  1.01M|                           return false;
 5144|  1.01M|                     }
 5145|  1.01M|                     else {
 5146|  1.01M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5147|  1.01M|                           return false;
 5148|  1.01M|                        }
 5149|  1.01M|                     }
 5150|  1.01M|                  }
 5151|  1.01M|                  else {
 5152|  1.01M|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5153|  1.01M|                     if (bool(ctx.error)) [[unlikely]]
 5154|  1.01M|                        return false;
 5155|  1.01M|                  }
 5156|       |
 5157|  1.01M|                  yaml::skip_inline_ws(it, end);
 5158|       |
 5159|  1.01M|                  if (it == end || *it != ':') {
 5160|  1.01M|                     ctx.error = error_code::syntax_error;
 5161|  1.01M|                     return false;
 5162|  1.01M|                  }
 5163|  1.01M|                  ++it;
 5164|  1.01M|                  yaml::skip_inline_ws(it, end);
 5165|       |
 5166|  1.01M|                  val_t val{};
 5167|  1.01M|                  if (!parse_map_value(val)) [[unlikely]]
 5168|  1.01M|                     return false;
 5169|       |
 5170|  1.01M|                  value.emplace(std::move(key), std::move(val));
 5171|  1.01M|                  return true;
 5172|  1.01M|               });
 5173|  1.01M|         }
 5174|       |
 5175|  2.78M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5176|  2.78M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  2.95M|      {
  466|  2.95M|         skip_inline_ws(it, end);
  467|       |
  468|  2.95M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 2.95M]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|  2.95M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  2.95M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 2.95M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  2.95M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 2.95M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  2.95M|         skip_inline_ws(it, end);
  486|       |
  487|  2.95M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 14, False: 2.95M]
  ------------------
  488|     14|            if constexpr (!AllowEmptyInput) {
  489|     14|               ctx.error = error_code::unexpected_end;
  490|     14|            }
  491|     14|            return true;
  492|     14|         }
  493|       |
  494|  2.95M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 46.8k, False: 2.91M]
  ------------------
  495|  46.8k|            return true;
  496|  46.8k|         }
  497|       |
  498|  2.91M|         return false;
  499|  2.95M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4599|  2.95M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  2.95M|      {
  409|  2.95M|         state.has_anchor = false;
  410|  2.95M|         state.anchor_name.clear();
  411|  2.95M|         state.anchor_start = nullptr;
  412|  2.95M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  2.95M|         if constexpr (Policy.allow_alias) {
  415|  2.95M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  2.95M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 2.95M, False: 1.65k]
  ------------------
  417|  2.95M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 46.8k, False: 2.90M]
  ------------------
  418|  2.95M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  2.95M|         }
  424|       |
  425|  2.95M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 2.91M, False: 46.8k]
  |  Branch (425:27): [True: 31.8k, False: 2.87M]
  ------------------
  426|  31.8k|            ++it;
  427|  31.8k|            auto name = parse_anchor_name(it, end);
  428|  31.8k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 31.8k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  31.8k|            skip_inline_ws(it, end);
  433|  31.8k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 22, False: 31.8k]
  ------------------
  434|     22|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     22|                  ctx.error = error_code::unexpected_end;
  436|     22|               }
  437|     22|               return true;
  438|     22|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  31.8k|            state.has_anchor = true;
  446|  31.8k|            state.anchor_name = std::string(name);
  447|  31.8k|            state.anchor_start = &*it;
  448|  31.8k|         }
  449|       |
  450|  2.95M|         return false;
  451|  2.95M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  2.95M|      {
  301|  2.95M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 2.95M]
  |  Branch (301:27): [True: 2.90M, False: 46.8k]
  ------------------
  302|       |
  303|  46.8k|         ++it; // skip '*'
  304|  46.8k|         auto name = parse_anchor_name(it, end);
  305|  46.8k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 16, False: 46.8k]
  ------------------
  306|     16|            ctx.error = error_code::syntax_error;
  307|     16|            return true;
  308|     16|         }
  309|       |
  310|  46.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  46.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 48, False: 46.7k]
  ------------------
  312|     48|            ctx.error = error_code::syntax_error; // undefined alias
  313|     48|            return true;
  314|     48|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  46.7k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  46.7k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 7.12k, False: 39.6k]
  ------------------
  322|  7.12k|            return true;
  323|  7.12k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  39.6k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 50, False: 39.6k]
  ------------------
  329|     50|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     50|            return true;
  331|     50|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  39.6k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  39.6k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 8, False: 39.5k]
  ------------------
  339|      8|            return true;
  340|       |
  341|  39.5k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 20, False: 39.5k]
  ------------------
  342|     20|            ctx.error = error_code::exceeded_max_expansion;
  343|     20|            ctx.custom_error_message = "alias expansion";
  344|     20|            return true;
  345|     20|         }
  346|       |
  347|  39.5k|         auto replay_it = span.begin;
  348|  39.5k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  39.5k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  39.5k|         ctx.indent_stack.clear();
  353|  39.5k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 3.73k, False: 35.8k]
  ------------------
  354|  3.73k|            ctx.push_indent(span.base_indent - 1);
  355|  3.73k|         }
  356|       |
  357|  39.5k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  39.5k|         using V = std::remove_cvref_t<T>;
  360|  39.5k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  39.5k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  39.5k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  39.5k|         return true;
  367|  39.5k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4736|  3.36M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4737|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4738|       |                     val = {};
 4739|       |                     return true;
 4740|       |                  }
 4741|  3.36M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4742|  3.36M|                     val = glz::generic{};
 4743|  3.36M|                     return true;
 4744|       |                  }
 4745|       |                  else {
 4746|       |                     static constexpr std::string_view null_value{"null"};
 4747|       |                     auto null_it = null_value.data();
 4748|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4749|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4750|       |                     return !bool(ctx.error);
 4751|       |                  }
 4752|  3.36M|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|  1.01M|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|  1.01M|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 1.01M]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|  1.01M|         const int32_t parent_indent = ctx.current_indent();
 3722|  1.01M|         const bool discover_indent = (mapping_indent < 0);
 3723|  1.01M|         bool first_key = !discover_indent;
 3724|  1.01M|         bool discovered_first_key_mid_line = false;
 3725|  1.01M|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|  2.35M|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 1.43M, False: 927k]
  ------------------
 3728|  1.43M|            auto line_start = it;
 3729|  1.43M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 1.43M]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|  1.96M|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 1.94M, False: 16.0k]
  ------------------
 3733|  1.94M|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 38.3k, False: 1.90M]
  ------------------
 3734|  38.3k|                  skip_comment(it, end);
 3735|  38.3k|                  skip_newline(it, end);
 3736|  38.3k|                  first_key = false;
 3737|  38.3k|                  line_indent = 0;
 3738|  38.3k|               }
 3739|  1.90M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 46.0k, False: 1.86M]
  |  Branch (3739:40): [True: 392k, False: 1.47M]
  ------------------
 3740|   438k|                  skip_newline(it, end);
 3741|   438k|                  first_key = false;
 3742|   438k|                  line_indent = 0;
 3743|   438k|               }
 3744|  1.47M|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 211k, False: 1.25M]
  ------------------
 3745|   211k|                  line_start = it;
 3746|   211k|                  line_indent = 0;
 3747|   526k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 520k, False: 6.08k]
  |  Branch (3747:39): [True: 315k, False: 205k]
  ------------------
 3748|   315k|                     ++line_indent;
 3749|   315k|                     ++it;
 3750|   315k|                  }
 3751|       |
 3752|   211k|                  bool saw_tab = false;
 3753|   218k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 212k, False: 6.46k]
  |  Branch (3753:40): [True: 1.64k, False: 210k]
  |  Branch (3753:54): [True: 5.79k, False: 204k]
  ------------------
 3754|  7.43k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 5.70k, False: 1.73k]
  |  Branch (3754:43): [True: 1.73k, False: 0]
  ------------------
 3755|  7.43k|                     ++it;
 3756|  7.43k|                  }
 3757|       |
 3758|   211k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 6.46k, False: 204k]
  |  Branch (3758:36): [True: 2.72k, False: 202k]
  |  Branch (3758:51): [True: 5.31k, False: 196k]
  |  Branch (3758:66): [True: 8.94k, False: 187k]
  ------------------
 3759|  23.4k|                     first_key = false;
 3760|  23.4k|                     line_indent = 0;
 3761|  23.4k|                     continue; // Blank or comment line
 3762|  23.4k|                  }
 3763|       |
 3764|   187k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 16, False: 187k]
  ------------------
 3765|     16|                     ctx.error = error_code::syntax_error;
 3766|     16|                     return;
 3767|     16|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   187k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 184k, False: 3.49k]
  |  Branch (3770:46): [True: 742, False: 183k]
  ------------------
 3771|    742|                     it = line_start;
 3772|    742|                     return;
 3773|    742|                  }
 3774|       |
 3775|   186k|                  first_key = false;
 3776|   186k|                  break; // Found content
 3777|   187k|               }
 3778|  1.25M|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 31.7k, False: 1.22M]
  ------------------
 3779|  31.7k|                  line_start = it;
 3780|  69.6k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 69.0k, False: 606]
  |  Branch (3780:40): [True: 1.78k, False: 67.2k]
  |  Branch (3780:54): [True: 36.1k, False: 31.1k]
  ------------------
 3781|  31.7k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 606, False: 31.1k]
  |  Branch (3781:36): [True: 3.12k, False: 28.0k]
  |  Branch (3781:51): [True: 25.5k, False: 2.50k]
  |  Branch (3781:66): [True: 2.49k, False: 16]
  ------------------
 3782|  31.7k|                     first_key = false;
 3783|  31.7k|                     line_indent = 0;
 3784|  31.7k|                     continue; // Blank or comment-only line with tab indentation
 3785|  31.7k|                  }
 3786|     16|                  ctx.error = error_code::syntax_error;
 3787|     16|                  return;
 3788|  31.7k|               }
 3789|  1.22M|               else {
 3790|  1.22M|                  line_start = it;
 3791|  1.22M|                  break; // Content at column 0
 3792|  1.22M|               }
 3793|  1.94M|            }
 3794|       |
 3795|  1.43M|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 16.0k, False: 1.41M]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|  1.41M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 6.79k, False: 1.40M]
  |  Branch (3799:45): [True: 1.43k, False: 1.40M]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|  1.40M|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 1.40M, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|  1.40M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 1.40M, False: 0]
  |  Branch (3806:39): [True: 392k, False: 1.01M]
  |  Branch (3806:62): [True: 69.7k, False: 322k]
  |  Branch (3806:84): [True: 40.4k, False: 29.2k]
  ------------------
 3807|  40.4k|                  it = line_start;
 3808|  40.4k|                  return;
 3809|  40.4k|               }
 3810|  1.36M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 352k, False: 1.01M]
  |  Branch (3810:43): [True: 346, False: 351k]
  ------------------
 3811|    346|                  it = line_start;
 3812|    346|                  return;
 3813|    346|               }
 3814|  1.36M|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|  1.36M|            bool established_mapping_indent_this_line = false;
 3818|  1.36M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 1.01M, False: 351k]
  ------------------
 3819|  1.01M|               mapping_indent = line_indent;
 3820|  1.01M|               established_mapping_indent_this_line = true;
 3821|  1.01M|               discovered_first_key_visual_indent = line_indent;
 3822|  1.01M|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|  1.01M|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 1.01M, False: 0]
  |  Branch (3823:43): [True: 1.01M, False: 0]
  ------------------
 3824|  1.01M|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|  1.01M|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 74, False: 1.01M]
  ------------------
 3826|     74|                        ctx.error = error_code::syntax_error;
 3827|     74|                        return;
 3828|     74|                     }
 3829|       |
 3830|  1.01M|                     discovered_first_key_mid_line = prefix.has_content;
 3831|  1.01M|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 1.01M, False: 3.49k]
  |  Branch (3831:49): [True: 814k, False: 195k]
  ------------------
 3832|   814k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   814k|                     }
 3834|  1.01M|                  }
 3835|  1.01M|               }
 3836|  1.01M|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|  1.36M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 1.36M, False: 74]
  |  Branch (3840:36): [True: 1.36M, False: 0]
  |  Branch (3840:59): [True: 351k, False: 1.01M]
  ------------------
 3841|   351k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 178k, False: 173k]
  ------------------
 3842|   178k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 178k, False: 226]
  |  Branch (3842:43): [True: 95.3k, False: 82.6k]
  ------------------
 3843|  95.3k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 70, False: 95.2k]
  ------------------
 3844|     70|                     ctx.error = error_code::syntax_error;
 3845|     70|                     return;
 3846|     70|                  }
 3847|  95.2k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 5.94k, False: 89.3k]
  ------------------
 3848|  5.94k|                     it = line_start;
 3849|  5.94k|                     return;
 3850|  5.94k|                  }
 3851|  95.2k|               }
 3852|  82.8k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 1.56k, False: 81.3k]
  ------------------
 3853|  1.56k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 6, False: 1.55k]
  |  Branch (3853:47): [True: 0, False: 1.55k]
  ------------------
 3854|  1.55k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 1.55k, False: 0]
  |  Branch (3854:49): [True: 1.55k, False: 0]
  |  Branch (3854:72): [True: 6, False: 1.55k]
  ------------------
 3855|     12|                  ctx.error = error_code::syntax_error;
 3856|     12|                  return;
 3857|     12|               }
 3858|   178k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|  1.35M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 1.35M]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|  1.35M|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 1.35M]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|  1.35M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 74, False: 1.35M]
  |  Branch (3876:32): [True: 0, False: 1.35M]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|  1.35M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 447k, False: 912k]
  |  Branch (3885:53): [True: 119k, False: 327k]
  |  Branch (3885:94): [True: 37.1k, False: 82.0k]
  ------------------
 3886|  37.1k|               const auto after_colon = it + 1;
 3887|  37.1k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 33.0k, False: 4.15k]
  ------------------
 3888|  37.1k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 1.23k, False: 35.9k]
  |  Branch (3888:43): [True: 33.4k, False: 2.51k]
  ------------------
 3889|  34.6k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 2.28k, False: 32.3k]
  ------------------
 3890|  2.28k|                  it = line_start;
 3891|  2.28k|                  return;
 3892|  2.28k|               }
 3893|  37.1k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|  1.35M|            int32_t effective_line_indent = line_indent;
 3897|  1.35M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 1.35M, False: 74]
  |  Branch (3897:36): [True: 1.01M, False: 343k]
  ------------------
 3898|  1.01M|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 814k, False: 199k]
  ------------------
 3899|   814k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 571k, False: 242k]
  |  Branch (3899:52): [True: 350k, False: 221k]
  ------------------
 3900|       |               // The first discovered key has no indentation of its own left to measure: it may
 3901|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3902|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3903|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3904|       |               // key with an empty value takes the following sibling line for nested content
 3905|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3906|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3907|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3908|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3909|       |               // 7FWL and HMQ5 pin that case.
 3910|   463k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   463k|            }
 3912|       |
 3913|  1.35M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 16.5k, False: 1.34M]
  ------------------
 3914|  16.5k|               return;
 3915|  16.5k|            }
 3916|  1.34M|            first_key = false;
 3917|       |
 3918|  1.34M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 1.34M]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|  1.34M|            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|  1.34M|               auto flow_end = it;
 3925|  1.34M|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|  1.34M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3926:20): [True: 16, False: 1.34M]
  ------------------
 3927|     16|                  return;
 3928|  1.34M|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3928:20): [True: 1.11M, False: 225k]
  |  Branch (3928:40): [True: 585k, False: 530k]
  |  Branch (3928:60): [True: 23.5k, False: 506k]
  |  Branch (3928:80): [True: 106k, False: 400k]
  ------------------
 3929|   715k|                  it = flow_end;
 3930|   715k|                  return;
 3931|   715k|               }
 3932|  1.34M|            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|  1.34M|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 437k, False: 903k]
  ------------------
 3938|   437k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 109k, False: 327k]
  |  Branch (3938:34): [True: 2.21k, False: 325k]
  ------------------
 3939|   112k|                  auto peek = it;
 3940|   112k|                  skip_inline_ws(peek, end);
 3941|   112k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 101k, False: 10.3k]
  |  Branch (3941:38): [True: 95.3k, False: 6.49k]
  |  Branch (3941:55): [True: 93.0k, False: 2.32k]
  |  Branch (3941:72): [True: 89.4k, False: 3.57k]
  ------------------
 3942|  89.4k|                     continue; // At leading indent of new line
 3943|  89.4k|                  }
 3944|   112k|               }
 3945|   348k|               skip_inline_ws(it, end);
 3946|   348k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 337k, False: 10.3k]
  |  Branch (3946:33): [True: 18.7k, False: 319k]
  ------------------
 3947|  18.7k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  18.7k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 18.7k, False: 0]
  ------------------
 3949|  18.7k|                        const char prev = *(it - 1);
 3950|  18.7k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 7.67k, False: 11.0k]
  |  Branch (3950:44): [True: 2.72k, False: 4.95k]
  |  Branch (3950:60): [True: 1.13k, False: 1.58k]
  |  Branch (3950:76): [True: 12, False: 1.12k]
  ------------------
 3951|     12|                           ctx.error = error_code::syntax_error;
 3952|     12|                           return;
 3953|     12|                        }
 3954|  18.7k|                     }
 3955|  18.7k|                  }
 3956|  18.7k|               }
 3957|  18.7k|               skip_comment(it, end);
 3958|   348k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 337k, False: 10.4k]
  |  Branch (3958:34): [True: 69.4k, False: 268k]
  |  Branch (3958:49): [True: 134k, False: 133k]
  ------------------
 3959|   203k|                  skip_newline(it, end);
 3960|   203k|               }
 3961|   144k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 133k, False: 10.4k]
  ------------------
 3962|       |                  // The entry stopped part way along its line with something other than
 3963|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3964|       |                  // separator, say. The next pass measures indent as though this were the start
 3965|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3966|   133k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   133k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 48, False: 133k]
  ------------------
 3968|     48|                        ctx.error = error_code::syntax_error;
 3969|     48|                        return;
 3970|     48|                     }
 3971|   133k|                  }
 3972|   133k|               }
 3973|   348k|            }
 3974|  1.34M|         }
 3975|  1.01M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_i:
 4855|  1.35M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4856|  1.35M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|  1.35M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4858|  1.35M|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|  1.35M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|  1.35M|                           if (ctx.stream_begin) {
 4866|  1.35M|                              auto is_line_content_start = [&](auto pos) {
 4867|  1.35M|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|  1.35M|                              };
 4869|       |
 4870|  1.35M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|  1.35M|                                 const char* line = ctx.line_begin_of(pos);
 4872|  1.35M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|  1.35M|                                 return line != end && *line == ':';
 4874|  1.35M|                              };
 4875|       |
 4876|  1.35M|                              if (!is_line_content_start(it) &&
 4877|  1.35M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4878|  1.35M|                                  !line_has_explicit_value_indicator(it)) {
 4879|  1.35M|                                 ctx.error = error_code::syntax_error;
 4880|  1.35M|                                 return false;
 4881|  1.35M|                              }
 4882|  1.35M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|  1.35M|                           }
 4884|  1.35M|                        }
 4885|       |
 4886|  1.35M|                        if (*it == '-' &&
 4887|  1.35M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4888|  1.35M|                            !line_starts_with_explicit_value_indicator) {
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|  1.35M|                           ctx.error = error_code::syntax_error;
 4891|  1.35M|                           return false;
 4892|  1.35M|                        }
 4893|       |
 4894|  1.35M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4895|  1.35M|                           return false;
 4896|  1.35M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|  1.35M|                        ctx.pop_indent();
 4898|  1.35M|                     }
 4899|  1.35M|                     else {
 4900|  1.35M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|  1.35M|                        if (nested_indent >= 0) {
 4902|  1.35M|                           yaml::skip_to_content(it, end);
 4903|  1.35M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4904|  1.35M|                              ctx.error = error_code::syntax_error;
 4905|  1.35M|                              return false;
 4906|  1.35M|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|  1.35M|                           const int32_t value_indent =
 4910|  1.35M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4911|  1.35M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4912|  1.35M|                              return false;
 4913|  1.35M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|  1.35M|                           ctx.pop_indent();
 4915|  1.35M|                        }
 4916|  1.35M|                     }
 4917|  1.35M|                     return !bool(ctx.error);
 4918|  1.35M|                  };
 4919|       |
 4920|       |                  // Explicit key entry form:
 4921|       |                  // ? key
 4922|       |                  // : value
 4923|  1.35M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4923:23): [True: 567k, False: 790k]
  |  Branch (4923:37): [True: 566k, False: 814]
  |  Branch (4923:58): [True: 6, False: 566k]
  ------------------
 4924|      6|                     ctx.error = error_code::syntax_error;
 4925|      6|                     return false;
 4926|      6|                  }
 4927|  1.35M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4927:23): [True: 567k, False: 790k]
  |  Branch (4927:38): [True: 814, False: 566k]
  |  Branch (4927:57): [True: 177k, False: 388k]
  |  Branch (4927:77): [True: 282k, False: 106k]
  |  Branch (4927:98): [True: 88.6k, False: 17.8k]
  ------------------
 4928|   549k|                     ++it; // skip '?'
 4929|   549k|                     yaml::skip_inline_ws(it, end);
 4930|       |
 4931|   549k|                     const int32_t explicit_value_indicator_indent =
 4932|   549k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4932:25): [True: 372k, False: 176k]
  ------------------
 4933|       |
 4934|   549k|                     key_t key{};
 4935|   549k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4936|   549k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   549k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   549k|                        };
 4939|       |
 4940|   549k|                        auto key_it = it;
 4941|   549k|                        yaml::skip_inline_ws(key_it, end);
 4942|       |
 4943|   549k|                        auto content = key_it;
 4944|   549k|                        yaml::skip_to_content(content, end);
 4945|   549k|                        bool handled_anchor_only_empty_key = false;
 4946|       |
 4947|       |                        // Anchor on an empty explicit key node:
 4948|       |                        //   ? &a
 4949|       |                        //   : value
 4950|   549k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4950:29): [True: 544k, False: 4.49k]
  |  Branch (4950:47): [True: 202k, False: 342k]
  ------------------
 4951|   202k|                           auto anchor_probe = content + 1;
 4952|   202k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4953|   202k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4953:32): [True: 201k, False: 24]
  ------------------
 4954|   201k|                              auto after_anchor = anchor_probe;
 4955|   201k|                              yaml::skip_inline_ws(after_anchor, end);
 4956|       |
 4957|   201k|                              auto value_indicator = after_anchor;
 4958|   201k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4958:35): [True: 197k, False: 4.73k]
  |  Branch (4958:61): [True: 10.0k, False: 187k]
  ------------------
 4959|  10.0k|                                 key.clear();
 4960|  10.0k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4961|  10.0k|                                 it = value_indicator;
 4962|  10.0k|                                 handled_anchor_only_empty_key = true;
 4963|  10.0k|                              }
 4964|   191k|                              else {
 4965|   191k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4965:38): [True: 187k, False: 4.73k]
  |  Branch (4965:64): [True: 19.5k, False: 167k]
  ------------------
 4966|  19.5k|                                    yaml::skip_comment(value_indicator, end);
 4967|  19.5k|                                 }
 4968|   191k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4968:38): [True: 187k, False: 4.74k]
  |  Branch (4968:65): [True: 35.8k, False: 151k]
  |  Branch (4968:93): [True: 59.8k, False: 91.4k]
  ------------------
 4969|  95.7k|                                    yaml::skip_newline(value_indicator, end);
 4970|  95.7k|                                    auto value_line = value_indicator;
 4971|  95.7k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4972|  95.7k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4972:41): [True: 6, False: 95.7k]
  ------------------
 4973|      6|                                       return false;
 4974|  95.7k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4974:41): [True: 88.9k, False: 6.75k]
  |  Branch (4974:62): [True: 13.1k, False: 75.8k]
  ------------------
 4975|  13.1k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4975:41): [True: 13.1k, False: 6]
  ------------------
 4976|  13.1k|                                       key.clear();
 4977|  13.1k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4978|  13.1k|                                       it = value_line;
 4979|  13.1k|                                       handled_anchor_only_empty_key = true;
 4980|  13.1k|                                    }
 4981|  82.5k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4981:46): [True: 75.8k, False: 6.75k]
  |  Branch (4981:67): [True: 6, False: 75.8k]
  ------------------
 4982|       |                                       // In explicit-key form ("? &a"), a following ':'
 4983|       |                                       // starts the outer value indicator only at the same
 4984|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4985|      6|                                       ctx.error = error_code::syntax_error;
 4986|      6|                                       return false;
 4987|      6|                                    }
 4988|  95.7k|                                 }
 4989|   191k|                              }
 4990|   201k|                           }
 4991|   202k|                        }
 4992|       |
 4993|   549k|                        const bool key_content_spans_lines = [&] {
 4994|   549k|                           auto scan = key_it;
 4995|   549k|                           while (scan != content && scan != end) {
 4996|   549k|                              if (*scan == '\n' || *scan == '\r') return true;
 4997|   549k|                              ++scan;
 4998|   549k|                           }
 4999|   549k|                           return false;
 5000|   549k|                        }();
 5001|       |
 5002|   549k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5002:29): [True: 23.1k, False: 526k]
  ------------------
 5003|       |                           // 'it' already points to the explicit value indicator ':'
 5004|  23.1k|                        }
 5005|   526k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5005:34): [True: 4.49k, False: 521k]
  |  Branch (5005:53): [True: 14.6k, False: 506k]
  |  Branch (5005:72): [True: 8.52k, False: 6.08k]
  ------------------
 5006|  13.0k|                           key.clear();
 5007|  13.0k|                           it = content;
 5008|  13.0k|                        }
 5009|   513k|                        else {
 5010|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5011|       |                           // Parse the key node structurally (not via plain-key scanning)
 5012|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5013|       |                           // as complex keys, not split into implicit key/value pairs.
 5014|   513k|                           auto key_node_it = content;
 5015|   513k|                           auto key_node_end = end;
 5016|   513k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5017|       |                              // In explicit-key form, a following standalone ':'
 5018|       |                              // line (same or lower indentation) belongs to the
 5019|       |                              // outer mapping value, not the key node itself.
 5020|   513k|                              auto scan = content;
 5021|  3.08M|                              while (scan != end) {
  ------------------
  |  Branch (5021:38): [True: 3.01M, False: 77.3k]
  ------------------
 5022|   387M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5022:41): [True: 386M, False: 318k]
  |  Branch (5022:56): [True: 385M, False: 1.22M]
  |  Branch (5022:73): [True: 384M, False: 1.46M]
  ------------------
 5023|   384M|                                    ++scan;
 5024|   384M|                                 }
 5025|  3.01M|                                 if (scan == end) {
  ------------------
  |  Branch (5025:38): [True: 318k, False: 2.69M]
  ------------------
 5026|   318k|                                    break;
 5027|   318k|                                 }
 5028|       |
 5029|  2.69M|                                 yaml::skip_newline(scan, end);
 5030|  2.69M|                                 auto line_start = scan;
 5031|       |
 5032|  2.69M|                                 int32_t indicator_indent = 0;
 5033|  4.22M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5033:41): [True: 4.14M, False: 77.3k]
  |  Branch (5033:56): [True: 1.53M, False: 2.61M]
  ------------------
 5034|  1.53M|                                    ++indicator_indent;
 5035|  1.53M|                                    ++scan;
 5036|  1.53M|                                 }
 5037|       |
 5038|  2.69M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5038:38): [True: 2.61M, False: 77.3k]
  |  Branch (5038:53): [True: 204k, False: 2.41M]
  ------------------
 5039|   204k|                                    const auto after_colon = scan + 1;
 5040|   204k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5040:42): [True: 4.95k, False: 199k]
  ------------------
 5041|   199k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5041:42): [True: 162k, False: 37.4k]
  ------------------
 5042|   167k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5042:41): [True: 116k, False: 50.5k]
  ------------------
 5043|   116k|                                       key_node_end = line_start;
 5044|   116k|                                       break;
 5045|   116k|                                    }
 5046|   204k|                                 }
 5047|  2.69M|                              }
 5048|   513k|                           }
 5049|       |
 5050|   513k|                           glz::generic key_node{};
 5051|   513k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5052|   513k|                           ctx.explicit_mapping_key_context = true;
 5053|   513k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5054|   513k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5055|   513k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5055:32): [True: 4.61k, False: 508k]
  ------------------
 5056|  4.61k|                              return false;
 5057|   508k|                           it = key_node_it;
 5058|   508k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5058:32): [True: 6, False: 508k]
  ------------------
 5059|      6|                              return false;
 5060|   508k|                        }
 5061|       |                     }
 5062|       |                     else {
 5063|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5064|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5065|       |                           if (bool(ctx.error)) [[unlikely]]
 5066|       |                              return false;
 5067|       |                        }
 5068|       |                     }
 5069|       |
 5070|   544k|                     yaml::skip_inline_ws(it, end);
 5071|   549k|                     yaml::skip_comment(it, end);
 5072|       |
 5073|       |                     // Value indicator may appear on the next line at the same indent.
 5074|   549k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5074:26): [True: 467k, False: 82.1k]
  |  Branch (5074:40): [True: 34.4k, False: 432k]
  |  Branch (5074:55): [True: 92.9k, False: 339k]
  ------------------
 5075|   127k|                        auto probe = it;
 5076|   127k|                        bool found_value_indicator = false;
 5077|       |
 5078|   179k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5078:32): [True: 161k, False: 17.4k]
  |  Branch (5078:49): [True: 41.9k, False: 119k]
  |  Branch (5078:67): [True: 119k, False: 0]
  ------------------
 5079|   161k|                           yaml::skip_newline(probe, end);
 5080|       |
 5081|   161k|                           auto value_line = probe;
 5082|   161k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5083|   161k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5083:32): [True: 8, False: 161k]
  ------------------
 5084|      8|                              return false;
 5085|       |
 5086|   161k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5086:32): [True: 17.2k, False: 144k]
  |  Branch (5086:53): [True: 4.17k, False: 140k]
  |  Branch (5086:76): [True: 13.2k, False: 127k]
  ------------------
 5087|  34.5k|                              probe = value_line;
 5088|  34.5k|                              continue; // blank line
 5089|  34.5k|                           }
 5090|   127k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5090:32): [True: 17.2k, False: 110k]
  ------------------
 5091|  17.2k|                              yaml::skip_comment(value_line, end);
 5092|  17.2k|                              probe = value_line;
 5093|  17.2k|                              continue; // comment-only line
 5094|  17.2k|                           }
 5095|   110k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5095:32): [True: 40.4k, False: 69.6k]
  |  Branch (5095:54): [True: 8.44k, False: 31.9k]
  ------------------
 5096|  8.44k|                              it = value_line;
 5097|  8.44k|                              found_value_indicator = true;
 5098|  8.44k|                           }
 5099|   110k|                           break;
 5100|   127k|                        }
 5101|       |
 5102|   127k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5102:29): [True: 8.44k, False: 119k]
  ------------------
 5103|  8.44k|                           yaml::skip_inline_ws(it, end);
 5104|  8.44k|                        }
 5105|   127k|                     }
 5106|       |
 5107|   549k|                     val_t val{};
 5108|   549k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5108:26): [True: 467k, False: 82.1k]
  |  Branch (5108:39): [True: 172k, False: 294k]
  ------------------
 5109|   172k|                        ++it;
 5110|   172k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5110:29): [True: 164k, False: 7.79k]
  |  Branch (5110:42): [True: 6, False: 164k]
  ------------------
 5111|      6|                           ctx.error = error_code::syntax_error;
 5112|      6|                           return false;
 5113|      6|                        }
 5114|   172k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5114:29): [True: 164k, False: 7.79k]
  |  Branch (5114:43): [True: 18.0k, False: 146k]
  |  Branch (5114:58): [True: 36.7k, False: 109k]
  ------------------
 5115|  54.7k|                           auto probe = it;
 5116|  54.7k|                           yaml::skip_newline(probe, end);
 5117|   155k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5117:35): [True: 143k, False: 11.8k]
  |  Branch (5117:51): [True: 100k, False: 42.9k]
  ------------------
 5118|  54.7k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5118:32): [True: 42.9k, False: 11.8k]
  |  Branch (5118:48): [True: 13.9k, False: 29.0k]
  |  Branch (5118:65): [True: 11.3k, False: 2.60k]
  |  Branch (5118:89): [True: 6, False: 11.3k]
  ------------------
 5119|      6|                              ctx.error = error_code::syntax_error;
 5120|      6|                              return false;
 5121|      6|                           }
 5122|  54.7k|                        }
 5123|   172k|                        yaml::skip_inline_ws(it, end);
 5124|   172k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5124:29): [True: 392, False: 172k]
  ------------------
 5125|    392|                           return false;
 5126|   172k|                     }
 5127|       |
 5128|   548k|                     value.emplace(std::move(key), std::move(val));
 5129|   548k|                     return true;
 5130|   549k|                  }
 5131|       |
 5132|   807k|                  key_t key{};
 5133|   807k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5134|   807k|                     auto key_probe = it;
 5135|   807k|                     yaml::skip_inline_ws(key_probe, end);
 5136|   807k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5136:53): [True: 807k, False: 0]
  |  Branch (5136:74): [True: 3.22k, False: 804k]
  |  Branch (5136:95): [True: 9.33k, False: 795k]
  ------------------
 5137|   807k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5137:26): [True: 12.5k, False: 795k]
  ------------------
 5138|  12.5k|                        glz::generic key_node{};
 5139|  12.5k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5140|  12.5k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5140:29): [True: 706, False: 11.8k]
  ------------------
 5141|    706|                           return false;
 5142|  11.8k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5142:29): [True: 4, False: 11.8k]
  ------------------
 5143|      4|                           return false;
 5144|  11.8k|                     }
 5145|   795k|                     else {
 5146|   795k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5146:29): [True: 7.98k, False: 787k]
  ------------------
 5147|  7.98k|                           return false;
 5148|  7.98k|                        }
 5149|   795k|                     }
 5150|       |                  }
 5151|       |                  else {
 5152|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5153|       |                     if (bool(ctx.error)) [[unlikely]]
 5154|       |                        return false;
 5155|       |                  }
 5156|       |
 5157|   799k|                  yaml::skip_inline_ws(it, end);
 5158|       |
 5159|   807k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5159:23): [True: 8.84k, False: 799k]
  |  Branch (5159:36): [True: 102, False: 799k]
  ------------------
 5160|    248|                     ctx.error = error_code::syntax_error;
 5161|    248|                     return false;
 5162|    248|                  }
 5163|   807k|                  ++it;
 5164|   807k|                  yaml::skip_inline_ws(it, end);
 5165|       |
 5166|   807k|                  val_t val{};
 5167|   807k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5167:23): [True: 2.55k, False: 805k]
  ------------------
 5168|  2.55k|                     return false;
 5169|       |
 5170|   805k|                  value.emplace(std::move(key), std::move(val));
 5171|   805k|                  return true;
 5172|   807k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlvE_clEv:
 4993|   549k|                        const bool key_content_spans_lines = [&] {
 4994|   549k|                           auto scan = key_it;
 4995|   567k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4995:35): [True: 394k, False: 173k]
  |  Branch (4995:54): [True: 394k, False: 0]
  ------------------
 4996|   394k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4996:35): [True: 284k, False: 109k]
  |  Branch (4996:52): [True: 91.7k, False: 18.1k]
  ------------------
 4997|  18.1k|                              ++scan;
 4998|  18.1k|                           }
 4999|   173k|                           return false;
 5000|   549k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4936|   508k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   508k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   508k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4856|   971k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|   971k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4857:26): [True: 946k, False: 25.3k]
  |  Branch (4857:39): [True: 705k, False: 240k]
  ------------------
 4858|   705k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   705k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   705k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4865:32): [True: 705k, False: 0]
  ------------------
 4866|   705k|                              auto is_line_content_start = [&](auto pos) {
 4867|   705k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   705k|                              };
 4869|       |
 4870|   705k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   705k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   705k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   705k|                                 return line != end && *line == ':';
 4874|   705k|                              };
 4875|       |
 4876|   705k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4876:35): [True: 705k, False: 0]
  ------------------
 4877|   705k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4877:35): [True: 32.9k, False: 672k]
  ------------------
 4878|  32.9k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4878:35): [True: 90, False: 32.8k]
  ------------------
 4879|     90|                                 ctx.error = error_code::syntax_error;
 4880|     90|                                 return false;
 4881|     90|                              }
 4882|   705k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   705k|                           }
 4884|   705k|                        }
 4885|       |
 4886|   705k|                        if (*it == '-' &&
  ------------------
  |  Branch (4886:29): [True: 9.97k, False: 695k]
  ------------------
 4887|  9.97k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4887:30): [True: 232, False: 9.74k]
  |  Branch (4887:49): [True: 3.42k, False: 6.32k]
  ------------------
 4888|  3.65k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4888:29): [True: 14, False: 3.64k]
  ------------------
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|     14|                           ctx.error = error_code::syntax_error;
 4891|     14|                           return false;
 4892|     14|                        }
 4893|       |
 4894|   705k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4894:29): [True: 0, False: 705k]
  ------------------
 4895|      0|                           return false;
 4896|   705k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   705k|                        ctx.pop_indent();
 4898|   705k|                     }
 4899|   265k|                     else {
 4900|   265k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|   265k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4901:29): [True: 74.4k, False: 191k]
  ------------------
 4902|  74.4k|                           yaml::skip_to_content(it, end);
 4903|  74.4k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4903:32): [True: 74.4k, False: 0]
  |  Branch (4903:45): [True: 0, False: 74.4k]
  |  Branch (4903:59): [True: 0, False: 0]
  |  Branch (4903:78): [True: 0, False: 0]
  ------------------
 4904|      0|                              ctx.error = error_code::syntax_error;
 4905|      0|                              return false;
 4906|      0|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|  74.4k|                           const int32_t value_indent =
 4910|  74.4k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4910:31): [Folded, False: 74.4k]
  ------------------
 4911|  74.4k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4911:32): [True: 0, False: 74.4k]
  ------------------
 4912|      0|                              return false;
 4913|  74.4k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|  74.4k|                           ctx.pop_indent();
 4915|  74.4k|                        }
 4916|   265k|                     }
 4917|   971k|                     return !bool(ctx.error);
 4918|   971k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISA_EEDaSN_:
 4866|   705k|                              auto is_line_content_start = [&](auto pos) {
 4867|   705k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   705k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISA_EEDaSN_:
 4870|   738k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   738k|                                 const char* line = ctx.line_begin_of(pos);
 4872|  1.32M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4872:41): [True: 1.32M, False: 0]
  |  Branch (4872:57): [True: 590k, False: 739k]
  |  Branch (4872:73): [True: 398, False: 738k]
  ------------------
 4873|   738k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4873:41): [True: 738k, False: 0]
  |  Branch (4873:56): [True: 414k, False: 323k]
  ------------------
 4874|   738k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4625|  2.91M|            {
 4626|       |               // emplace is a no-op for keys the document already wrote, so only
 4627|       |               // untouched pre-existing entries are put back.
 4628|  2.91M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4628:33): [True: 0, False: 2.91M]
  ------------------
 4629|      0|                  target.emplace(entry.first, std::move(entry.second));
 4630|      0|               }
 4631|  2.91M|            }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   334k|      {
 5284|   334k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   334k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   334k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   334k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   334k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 334k, False: 0]
  ------------------
 5294|   334k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   334k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4176|   342k|      {
 4177|   342k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4177:14): [True: 0, False: 342k]
  ------------------
 4178|      0|            return;
 4179|       |
 4180|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4181|   342k|         auto peek = it;
 4182|   342k|         yaml::node_preamble_state preamble{};
 4183|   342k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4183:14): [True: 10.6k, False: 331k]
  ------------------
 4184|   342k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4185|  10.6k|            it = peek;
 4186|  10.6k|            return;
 4187|  10.6k|         }
 4188|       |
 4189|   331k|         if (*peek == '[') {
  ------------------
  |  Branch (4189:14): [True: 95.8k, False: 235k]
  ------------------
 4190|       |            // Flow sequence - consume whitespace and parse
 4191|  95.8k|            it = peek;
 4192|  95.8k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4193|  95.8k|         }
 4194|   235k|         else if (*peek == '-') {
  ------------------
  |  Branch (4194:19): [True: 235k, False: 66]
  ------------------
 4195|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4196|       |            // But if there was a tag, we need to advance past it
 4197|   235k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4197:17): [True: 498, False: 235k]
  |  Branch (4197:57): [True: 5.19k, False: 229k]
  ------------------
 4198|  5.69k|               it = peek;
 4199|  5.69k|            }
 4200|   235k|            int32_t seq_indent = ctx.current_indent();
 4201|   235k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4201:17): [True: 235k, False: 260]
  |  Branch (4201:31): [True: 147k, False: 87.6k]
  ------------------
 4202|   147k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4202:29): [True: 46.6k, False: 101k]
  |  Branch (4202:62): [True: 41.1k, False: 5.50k]
  ------------------
 4203|   147k|                                                          : (ctx.current_indent() + 1);
 4204|   147k|            }
 4205|   235k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4206|   235k|         }
 4207|     66|         else {
 4208|     66|            ctx.error = error_code::syntax_error;
 4209|     66|         }
 4210|       |
 4211|   331k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4212|   331k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_ZNS_4fromILj450ESC_E2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSG_SD_TkNS_10is_contextERSE_SG_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSP_RSS_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   342k|      {
  466|   342k|         skip_inline_ws(it, end);
  467|       |
  468|   342k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 14, False: 342k]
  ------------------
  469|     14|            if constexpr (!AllowEmptyInput) {
  470|     14|               ctx.error = error_code::unexpected_end;
  471|     14|            }
  472|     14|            return true;
  473|     14|         }
  474|       |
  475|   342k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   342k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 14, False: 342k]
  ------------------
  477|     14|            ctx.error = error_code::syntax_error;
  478|     14|            return true;
  479|     14|         }
  480|   342k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 342k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   342k|         skip_inline_ws(it, end);
  486|       |
  487|   342k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 8, False: 342k]
  ------------------
  488|      8|            if constexpr (!AllowEmptyInput) {
  489|      8|               ctx.error = error_code::unexpected_end;
  490|      8|            }
  491|      8|            return true;
  492|      8|         }
  493|       |
  494|   342k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 10.5k, False: 331k]
  ------------------
  495|  10.5k|            return true;
  496|  10.5k|         }
  497|       |
  498|   331k|         return false;
  499|   342k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_ENKUlNSH_8yaml_tagEE_clESR_:
 4184|   342k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   342k|      {
  409|   342k|         state.has_anchor = false;
  410|   342k|         state.anchor_name.clear();
  411|   342k|         state.anchor_start = nullptr;
  412|   342k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   342k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   342k|            else {
  421|   342k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 10.5k, False: 331k]
  ------------------
  422|   342k|            }
  423|   342k|         }
  424|       |
  425|   342k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 331k, False: 10.5k]
  |  Branch (425:27): [True: 6.55k, False: 324k]
  ------------------
  426|  6.55k|            ++it;
  427|  6.55k|            auto name = parse_anchor_name(it, end);
  428|  6.55k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 28, False: 6.52k]
  ------------------
  429|     28|               ctx.error = error_code::syntax_error;
  430|     28|               return true;
  431|     28|            }
  432|  6.52k|            skip_inline_ws(it, end);
  433|  6.52k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 16, False: 6.50k]
  ------------------
  434|     16|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     16|                  ctx.error = error_code::unexpected_end;
  436|     16|               }
  437|     16|               return true;
  438|     16|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  6.50k|            state.has_anchor = true;
  446|  6.50k|            state.anchor_name = std::string(name);
  447|  6.50k|            state.anchor_start = &*it;
  448|  6.50k|         }
  449|       |
  450|   341k|         return false;
  451|   342k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   342k|      {
  301|   342k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 342k]
  |  Branch (301:27): [True: 331k, False: 10.5k]
  ------------------
  302|       |
  303|  10.5k|         ++it; // skip '*'
  304|  10.5k|         auto name = parse_anchor_name(it, end);
  305|  10.5k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 10, False: 10.5k]
  ------------------
  306|     10|            ctx.error = error_code::syntax_error;
  307|     10|            return true;
  308|     10|         }
  309|       |
  310|  10.5k|         auto anchor_it = ctx.anchors.find(name);
  311|  10.5k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 34, False: 10.4k]
  ------------------
  312|     34|            ctx.error = error_code::syntax_error; // undefined alias
  313|     34|            return true;
  314|     34|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  10.4k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  10.4k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.48k, False: 7.98k]
  ------------------
  322|  2.48k|            return true;
  323|  2.48k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  7.98k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 62, False: 7.92k]
  ------------------
  329|     62|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     62|            return true;
  331|     62|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  7.92k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  7.92k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 7.92k]
  ------------------
  339|      4|            return true;
  340|       |
  341|  7.92k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 7.92k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  7.92k|         auto replay_it = span.begin;
  348|  7.92k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  7.92k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  7.92k|         ctx.indent_stack.clear();
  353|  7.92k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.85k, False: 6.06k]
  ------------------
  354|  1.85k|            ctx.push_indent(span.base_indent - 1);
  355|  1.85k|         }
  356|       |
  357|  7.92k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  7.92k|         using V = std::remove_cvref_t<T>;
  360|  7.92k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  7.92k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  7.92k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  7.92k|         return true;
  367|  7.92k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  95.8k|      {
 2665|  95.8k|         using V = std::remove_cvref_t<T>;
 2666|  95.8k|         using value_type = typename V::value_type;
 2667|       |
 2668|  95.8k|         struct sequence_container_adapter
 2669|  95.8k|         {
 2670|  95.8k|            size_t index = 0;
 2671|       |
 2672|  95.8k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  95.8k|            {
 2674|  95.8k|               if constexpr (!resizable<V>) {
 2675|  95.8k|                  return index >= container.size();
 2676|  95.8k|               }
 2677|  95.8k|               else {
 2678|  95.8k|                  (void)container;
 2679|  95.8k|                  return false;
 2680|  95.8k|               }
 2681|  95.8k|            }
 2682|       |
 2683|  95.8k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  95.8k|            inline void append(V& container, value_type&& element) noexcept
 2686|  95.8k|            {
 2687|  95.8k|               if constexpr (emplace_backable<V>) {
 2688|  95.8k|                  container.emplace_back(std::move(element));
 2689|  95.8k|               }
 2690|  95.8k|               else if constexpr (emplaceable<V>) {
 2691|  95.8k|                  container.emplace(std::move(element));
 2692|  95.8k|               }
 2693|  95.8k|            }
 2694|  95.8k|         };
 2695|       |
 2696|  95.8k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 95.8k]
  |  Branch (2696:27): [True: 0, False: 95.8k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|  95.8k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  95.8k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  95.8k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  95.8k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 6, False: 95.8k]
  ------------------
 2709|      6|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  95.8k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 94.1k, False: 1.72k]
  |  Branch (2712:27): [True: 28.1k, False: 65.9k]
  ------------------
 2713|  28.1k|            ++it;
 2714|  28.1k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  28.1k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 10, False: 28.1k]
  ------------------
 2716|     10|               return;
 2717|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|       |               if (ctx.current_indent() < 0) {
 2719|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|       |               }
 2721|       |            }
 2722|  28.1k|            return;
 2723|  28.1k|         }
 2724|       |
 2725|  67.7k|         bool just_saw_comma = false;
 2726|  67.7k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  67.7k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|   105k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 102k, False: 3.35k]
  ------------------
 2731|   102k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|   102k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 102k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|   102k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 102k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|   102k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 13.8k, False: 88.3k]
  ------------------
 2741|  13.8k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 13.8k, False: 0]
  ------------------
 2742|  13.8k|                     ++it;
 2743|  13.8k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  13.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 6, False: 13.8k]
  ------------------
 2745|      6|                        return;
 2746|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|       |                        if (ctx.current_indent() < 0) {
 2748|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|       |                        }
 2750|       |                     }
 2751|  13.8k|                     return;
 2752|  13.8k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  13.8k|               }
 2756|       |
 2757|  88.3k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 10, False: 88.3k]
  |  Branch (2757:34): [True: 12, False: 88.3k]
  ------------------
 2758|     22|                  ctx.error = error_code::syntax_error;
 2759|     22|                  return;
 2760|     22|               }
 2761|  88.3k|               just_saw_comma = false;
 2762|       |
 2763|  88.3k|               value_type element{};
 2764|  88.3k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|  88.3k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 4.42k, False: 83.8k]
  ------------------
 2767|  4.42k|                  return;
 2768|       |
 2769|  83.8k|               bool saw_line_break_before_separator = false;
 2770|  83.8k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|  83.8k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 10, False: 83.8k]
  ------------------
 2772|     10|                  return;
 2773|       |
 2774|  83.8k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 83.6k, False: 256]
  |  Branch (2774:33): [True: 13.7k, False: 69.8k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  13.7k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 6, False: 13.7k]
  ------------------
 2777|      6|                     ctx.error = error_code::syntax_error;
 2778|      6|                     return;
 2779|      6|                  }
 2780|  13.7k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  13.7k|                     glz::generic key_node = std::move(element);
 2782|  13.7k|                     ++it;
 2783|  13.7k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  13.7k|                     glz::generic mapped{};
 2786|  13.7k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  13.7k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 156, False: 13.5k]
  ------------------
 2788|    156|                        return;
 2789|       |
 2790|  13.5k|                     std::string key;
 2791|  13.5k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 4, False: 13.5k]
  ------------------
 2792|      4|                        return;
 2793|       |
 2794|  13.5k|                     glz::generic pair{};
 2795|  13.5k|                     pair[key] = std::move(mapped);
 2796|  13.5k|                     element = std::move(pair);
 2797|       |
 2798|  13.5k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  13.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 4, False: 13.5k]
  ------------------
 2800|      4|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  13.7k|               }
 2807|       |
 2808|  83.8k|               adapter.append(value, std::move(element));
 2809|       |
 2810|  83.8k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 260, False: 83.6k]
  ------------------
 2811|    260|                  ctx.error = error_code::unexpected_end;
 2812|    260|                  return;
 2813|    260|               }
 2814|       |
 2815|  83.6k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 45.5k, False: 38.0k]
  ------------------
 2816|  45.5k|                  ++it;
 2817|  45.5k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  45.5k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 6, False: 45.5k]
  ------------------
 2819|      6|                     return;
 2820|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|       |                     if (ctx.current_indent() < 0) {
 2822|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|       |                     }
 2824|       |                  }
 2825|  45.5k|                  return;
 2826|  45.5k|               }
 2827|  38.0k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 37.8k, False: 250]
  ------------------
 2828|  37.8k|                  ++it;
 2829|  37.8k|                  just_saw_comma = true;
 2830|  37.8k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  37.8k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 6, False: 37.8k]
  ------------------
 2832|      6|                     return;
 2833|  37.8k|               }
 2834|    250|               else {
 2835|    250|                  ctx.error = error_code::syntax_error;
 2836|    250|                  return;
 2837|    250|               }
 2838|  83.6k|            }
 2839|       |         }
 2840|       |         else if constexpr (!resizable<V>) {
 2841|       |            // Fixed-size containers (std::array)
 2842|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2843|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2844|       |               if (bool(ctx.error)) [[unlikely]]
 2845|       |                  return;
 2846|       |
 2847|       |               if (it == end) [[unlikely]] {
 2848|       |                  ctx.error = error_code::unexpected_end;
 2849|       |                  return;
 2850|       |               }
 2851|       |
 2852|       |               if (*it == ']') {
 2853|       |                  if (just_saw_comma) {
 2854|       |                     ++it;
 2855|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2856|       |                     if (bool(ctx.error)) [[unlikely]]
 2857|       |                        return;
 2858|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2859|       |                        if (ctx.current_indent() < 0) {
 2860|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2861|       |                        }
 2862|       |                     }
 2863|       |                     return;
 2864|       |                  }
 2865|       |                  ctx.error = error_code::syntax_error;
 2866|       |                  return;
 2867|       |               }
 2868|       |
 2869|       |               if (*it == ',' || *it == '#') {
 2870|       |                  ctx.error = error_code::syntax_error;
 2871|       |                  return;
 2872|       |               }
 2873|       |               just_saw_comma = false;
 2874|       |
 2875|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2876|       |
 2877|       |               if (bool(ctx.error)) [[unlikely]]
 2878|       |                  return;
 2879|       |
 2880|       |               adapter.commit_fixed_slot();
 2881|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2882|       |               if (bool(ctx.error)) [[unlikely]]
 2883|       |                  return;
 2884|       |
 2885|       |               if (it == end) [[unlikely]] {
 2886|       |                  ctx.error = error_code::unexpected_end;
 2887|       |                  return;
 2888|       |               }
 2889|       |
 2890|       |               if (*it == ']') {
 2891|       |                  ++it;
 2892|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2893|       |                  if (bool(ctx.error)) [[unlikely]]
 2894|       |                     return;
 2895|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2896|       |                     if (ctx.current_indent() < 0) {
 2897|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2898|       |                     }
 2899|       |                  }
 2900|       |                  return;
 2901|       |               }
 2902|       |               else if (*it == ',') {
 2903|       |                  ++it;
 2904|       |                  just_saw_comma = true;
 2905|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2906|       |                  if (bool(ctx.error)) [[unlikely]]
 2907|       |                     return;
 2908|       |               }
 2909|       |               else {
 2910|       |                  ctx.error = error_code::syntax_error;
 2911|       |                  return;
 2912|       |               }
 2913|       |            }
 2914|       |
 2915|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2916|       |            // skip to the closing bracket to consume overflow elements.
 2917|       |            int bracket_depth = 1;
 2918|       |            while (it != end && bracket_depth > 0) {
 2919|       |               if (*it == '[') {
 2920|       |                  ++bracket_depth;
 2921|       |               }
 2922|       |               else if (*it == ']') {
 2923|       |                  --bracket_depth;
 2924|       |               }
 2925|       |               ++it;
 2926|       |            }
 2927|       |         }
 2928|       |         else {
 2929|       |            ctx.error = error_code::syntax_error;
 2930|       |            return;
 2931|       |         }
 2932|  67.7k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   331k|      {
 2649|   331k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   331k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   331k|               value.clear();
 2653|   331k|            }
 2654|       |         }
 2655|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2656|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2657|       |            value.clear();
 2658|       |         }
 2659|   331k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2686|  83.7k|            {
 2687|  83.7k|               if constexpr (emplace_backable<V>) {
 2688|  83.7k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|  83.7k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|   235k|      {
 3160|   235k|         using V = std::remove_cvref_t<T>;
 3161|   235k|         using value_type = typename V::value_type;
 3162|       |
 3163|   235k|         struct sequence_container_adapter
 3164|   235k|         {
 3165|   235k|            size_t index = 0;
 3166|       |
 3167|   235k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|   235k|            {
 3169|   235k|               if constexpr (!resizable<V>) {
 3170|   235k|                  return index >= container.size();
 3171|   235k|               }
 3172|   235k|               else {
 3173|   235k|                  (void)container;
 3174|   235k|                  return false;
 3175|   235k|               }
 3176|   235k|            }
 3177|       |
 3178|   235k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|   235k|            inline void append(V& container, value_type&& element) noexcept
 3181|   235k|            {
 3182|   235k|               if constexpr (emplace_backable<V>) {
 3183|   235k|                  container.emplace_back(std::move(element));
 3184|   235k|               }
 3185|   235k|               else if constexpr (emplaceable<V>) {
 3186|   235k|                  container.emplace(std::move(element));
 3187|   235k|               }
 3188|   235k|            }
 3189|   235k|         };
 3190|       |
 3191|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3192|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3193|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3194|   235k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|   235k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|   235k|         bool first_item = true;
 3200|   235k|         bool has_pending_item_anchor = false;
 3201|   235k|         std::string pending_item_anchor_name{};
 3202|   235k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   592k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 552k, False: 40.2k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   552k|            int32_t line_indent = 0;
 3215|   552k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   552k|            auto line_start = it;
 3217|       |
 3218|   768k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 749k, False: 18.9k]
  ------------------
 3219|   749k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 33.2k, False: 716k]
  ------------------
 3220|  33.2k|                  skip_comment(it, end);
 3221|  33.2k|                  skip_newline(it, end);
 3222|  33.2k|                  line_start = it;
 3223|  33.2k|                  line_indent = 0;
 3224|  33.2k|               }
 3225|   716k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 48.1k, False: 667k]
  |  Branch (3225:40): [True: 102k, False: 565k]
  ------------------
 3226|   150k|                  skip_newline(it, end);
 3227|   150k|                  line_start = it;
 3228|   150k|                  line_indent = 0;
 3229|   150k|               }
 3230|   565k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 56.0k, False: 509k]
  ------------------
 3231|  56.0k|                  line_start = it;
 3232|  56.0k|                  line_indent = 0;
 3233|  4.76M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 4.75M, False: 4.13k]
  |  Branch (3233:39): [True: 4.70M, False: 51.9k]
  ------------------
 3234|  4.70M|                     ++line_indent;
 3235|  4.70M|                     ++it;
 3236|  4.70M|                  }
 3237|       |
 3238|  56.0k|                  bool saw_tab = false;
 3239|  66.1k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 61.1k, False: 5.05k]
  |  Branch (3239:40): [True: 4.82k, False: 56.3k]
  |  Branch (3239:54): [True: 5.31k, False: 51.0k]
  ------------------
 3240|  10.1k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 6.54k, False: 3.58k]
  |  Branch (3240:43): [True: 3.58k, False: 0]
  ------------------
 3241|  10.1k|                     ++it;
 3242|  10.1k|                  }
 3243|       |
 3244|  56.0k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 5.05k, False: 51.0k]
  |  Branch (3244:36): [True: 1.42k, False: 49.5k]
  |  Branch (3244:51): [True: 9.97k, False: 39.6k]
  |  Branch (3244:66): [True: 5.51k, False: 34.0k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  21.9k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 16.9k, False: 5.05k]
  |  Branch (3246:39): [True: 5.51k, False: 11.4k]
  ------------------
 3247|  5.51k|                        skip_comment(it, end);
 3248|  5.51k|                     }
 3249|  21.9k|                     line_indent = 0;
 3250|  21.9k|                     continue;
 3251|  21.9k|                  }
 3252|       |
 3253|  34.0k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 10, False: 34.0k]
  ------------------
 3254|     10|                     ctx.error = error_code::syntax_error;
 3255|     10|                     return;
 3256|     10|                  }
 3257|  34.0k|                  break; // Found content
 3258|  34.0k|               }
 3259|   509k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 10.2k, False: 498k]
  ------------------
 3260|  10.2k|                  line_start = it;
 3261|  30.7k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 30.5k, False: 254]
  |  Branch (3261:40): [True: 540, False: 29.9k]
  |  Branch (3261:54): [True: 19.9k, False: 9.99k]
  ------------------
 3262|  10.2k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 254, False: 9.99k]
  |  Branch (3262:36): [True: 3.33k, False: 6.66k]
  |  Branch (3262:51): [True: 1.16k, False: 5.50k]
  |  Branch (3262:66): [True: 5.47k, False: 24]
  ------------------
 3263|  10.2k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 9.97k, False: 254]
  |  Branch (3263:39): [True: 5.47k, False: 4.49k]
  ------------------
 3264|  5.47k|                        skip_comment(it, end);
 3265|  5.47k|                     }
 3266|  10.2k|                     line_indent = 0;
 3267|  10.2k|                     continue;
 3268|  10.2k|                  }
 3269|     24|                  ctx.error = error_code::syntax_error;
 3270|     24|                  return;
 3271|  10.2k|               }
 3272|   498k|               else {
 3273|       |                  // At content (no leading space on this line)
 3274|       |                  // If first item and at '-', whitespace was consumed by caller;
 3275|       |                  // treat as having correct indentation
 3276|   498k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 235k, False: 263k]
  |  Branch (3276:37): [True: 235k, False: 254]
  ------------------
 3277|   235k|                     line_indent = sequence_indent;
 3278|   235k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   235k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 235k, False: 0]
  |  Branch (3279:49): [True: 235k, False: 0]
  ------------------
 3280|   235k|                           auto probe = it;
 3281|   235k|                           int32_t leading_ws = 0;
 3282|   235k|                           bool saw_tab = false;
 3283|   448k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 448k, False: 0]
  |  Branch (3283:64): [True: 200k, False: 248k]
  |  Branch (3283:87): [True: 13.2k, False: 235k]
  ------------------
 3284|   213k|                              --probe;
 3285|   213k|                              ++leading_ws;
 3286|   213k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 2.32k, False: 211k]
  |  Branch (3286:52): [True: 11.9k, False: 199k]
  ------------------
 3287|   213k|                           }
 3288|   235k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 0, False: 235k]
  |  Branch (3288:61): [True: 14.0k, False: 221k]
  |  Branch (3288:85): [True: 65.1k, False: 156k]
  ------------------
 3289|  79.2k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 6, False: 79.2k]
  ------------------
 3290|      6|                                 ctx.error = error_code::syntax_error;
 3291|      6|                                 return;
 3292|      6|                              }
 3293|  79.2k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  79.2k|                           }
 3295|   235k|                        }
 3296|   235k|                     }
 3297|   235k|                  }
 3298|   235k|                  break;
 3299|   498k|               }
 3300|   749k|            }
 3301|       |
 3302|   552k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 18.9k, False: 533k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   533k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 7.44k, False: 525k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   525k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 80.9k, False: 444k]
  ------------------
 3309|  80.9k|               it = line_start;
 3310|  80.9k|               return;
 3311|  80.9k|            }
 3312|       |
 3313|   444k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 25.0k, False: 419k]
  ------------------
 3314|       |               // Standalone anchor lines before "- item" are only supported for
 3315|       |               // indentless mapping values. At top-level block sequences these are
 3316|       |               // malformed in yaml-test-suite cases.
 3317|  25.0k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 88, False: 24.9k]
  ------------------
 3318|     88|                  ctx.error = error_code::syntax_error;
 3319|     88|                  return;
 3320|     88|               }
 3321|       |
 3322|  24.9k|               ++it;
 3323|  24.9k|               auto pending_name = parse_anchor_name(it, end);
 3324|  24.9k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 18, False: 24.9k]
  ------------------
 3325|     18|                  ctx.error = error_code::syntax_error;
 3326|     18|                  return;
 3327|     18|               }
 3328|  24.9k|               skip_inline_ws(it, end);
 3329|  24.9k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 24.8k, False: 42]
  |  Branch (3329:33): [True: 1.65k, False: 23.2k]
  ------------------
 3330|  1.65k|                  skip_comment(it, end);
 3331|  1.65k|               }
 3332|       |
 3333|  24.9k|               has_pending_item_anchor = true;
 3334|  24.9k|               pending_item_anchor_name = std::string(pending_name);
 3335|  24.9k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  24.9k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 42, False: 24.8k]
  |  Branch (3337:34): [True: 15.3k, False: 9.55k]
  |  Branch (3337:49): [True: 32, False: 15.3k]
  ------------------
 3338|     74|                  ctx.error = error_code::syntax_error;
 3339|     74|                  return;
 3340|     74|               }
 3341|       |
 3342|  24.8k|               skip_newline(it, end);
 3343|  24.8k|               continue;
 3344|  24.9k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   419k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 79.8k, False: 339k]
  ------------------
 3348|  79.8k|               it = line_start;
 3349|  79.8k|               return;
 3350|  79.8k|            }
 3351|       |
 3352|       |            // Compute the actual column of this sequence dash.
 3353|       |            // This is needed by plain-scalar multiline folding to distinguish
 3354|       |            // sibling "- item" entries from deeper "- " continuation content.
 3355|   339k|            dash_col = line_indent;
 3356|   339k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   339k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 339k, False: 6]
  ------------------
 3358|   339k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   339k|               }
 3360|   339k|            }
 3361|       |
 3362|   339k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   339k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 331k, False: 8.61k]
  |  Branch (3365:30): [True: 6.91k, False: 324k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  6.91k|               it = line_start;
 3368|  6.91k|               return;
 3369|  6.91k|            }
 3370|       |
 3371|   332k|            bool saw_tab_after_dash = false;
 3372|   577k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 566k, False: 11.2k]
  |  Branch (3372:34): [True: 183k, False: 382k]
  |  Branch (3372:48): [True: 61.2k, False: 321k]
  ------------------
 3373|   244k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 2.61k, False: 242k]
  |  Branch (3373:59): [True: 59.7k, False: 182k]
  ------------------
 3374|   244k|               ++it;
 3375|   244k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   332k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 59.7k, False: 273k]
  |  Branch (3377:39): [True: 59.2k, False: 516]
  |  Branch (3377:52): [True: 482, False: 58.7k]
  ------------------
 3378|    482|               const auto after_dash = it + 1;
 3379|    482|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 6, False: 476]
  |  Branch (3379:41): [True: 6, False: 470]
  ------------------
 3380|     12|                  ctx.error = error_code::syntax_error;
 3381|     12|                  return;
 3382|     12|               }
 3383|    482|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   332k|            auto parse_element = [&](auto& element) {
 3387|   332k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   332k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   332k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   332k|                     return;
 3397|   332k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   332k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   332k|                  ctx.sequence_item_value_context = true;
 3400|   332k|                  ctx.sequence_dash_indent = dash_col;
 3401|   332k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   332k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   332k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   332k|                  ctx.pop_indent();
 3405|   332k|               }
 3406|   332k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   332k|                  skip_ws_and_comment(it, end);
 3409|   332k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   332k|                  auto nested_start = it;
 3413|   332k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   332k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   332k|                     return;
 3416|   332k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   332k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   332k|                  if (nested_indent > effective_line_indent) {
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|   332k|                     const int32_t element_indent =
 3428|   332k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   332k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   332k|                        return;
 3431|   332k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   332k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   332k|                     ctx.sequence_item_value_context = true;
 3434|   332k|                     ctx.sequence_dash_indent = dash_col;
 3435|   332k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   332k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   332k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   332k|                     ctx.pop_indent();
 3439|   332k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   332k|               }
 3442|       |
 3443|   332k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   332k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   332k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   332k|                                                                      pending_item_anchor_indent};
 3447|   332k|                  has_pending_item_anchor = false;
 3448|   332k|               }
 3449|   332k|            };
 3450|       |
 3451|   332k|            if constexpr (emplace_backable<V>) {
 3452|   332k|               auto& element = value.emplace_back();
 3453|   332k|               parse_element(element);
 3454|       |            }
 3455|       |            else if constexpr (emplaceable<V>) {
 3456|       |               value_type element{};
 3457|       |               parse_element(element);
 3458|       |               if (!bool(ctx.error)) {
 3459|       |                  adapter.append(value, std::move(element));
 3460|       |               }
 3461|       |            }
 3462|       |            else if constexpr (!resizable<V>) {
 3463|       |               parse_element(value[adapter.index]);
 3464|       |               adapter.commit_fixed_slot();
 3465|       |            }
 3466|       |            else {
 3467|       |               ctx.error = error_code::syntax_error;
 3468|       |               return;
 3469|       |            }
 3470|       |
 3471|   332k|            first_item = false;
 3472|       |
 3473|   332k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 898, False: 331k]
  ------------------
 3474|    898|               return;
 3475|       |
 3476|       |            // Note: after parsing nested block content, iterator may already be
 3477|       |            // at the start of the next line. The outer loop will handle it.
 3478|   332k|         }
 3479|   235k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3386|   332k|            auto parse_element = [&](auto& element) {
 3387|   332k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 321k, False: 11.2k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   332k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 321k, False: 11.2k]
  |  Branch (3390:33): [True: 190k, False: 130k]
  ------------------
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   190k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 190k]
  ------------------
 3396|      0|                     return;
 3397|   190k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   190k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   190k|                  ctx.sequence_item_value_context = true;
 3400|   190k|                  ctx.sequence_dash_indent = dash_col;
 3401|   190k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   190k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   190k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   190k|                  ctx.pop_indent();
 3405|   190k|               }
 3406|   141k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   141k|                  skip_ws_and_comment(it, end);
 3409|   141k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   141k|                  auto nested_start = it;
 3413|   141k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   141k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 6, False: 141k]
  ------------------
 3415|      6|                     return;
 3416|   141k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   141k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 7.80k, False: 134k]
  ------------------
 3422|   141k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 29.1k, False: 112k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  29.1k|                     const int32_t element_indent =
 3428|  29.1k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 29.1k]
  ------------------
 3429|  29.1k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 29.1k]
  ------------------
 3430|      0|                        return;
 3431|  29.1k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  29.1k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  29.1k|                     ctx.sequence_item_value_context = true;
 3434|  29.1k|                     ctx.sequence_dash_indent = dash_col;
 3435|  29.1k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  29.1k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  29.1k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  29.1k|                     ctx.pop_indent();
 3439|  29.1k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   141k|               }
 3442|       |
 3443|   332k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 12.8k, False: 319k]
  |  Branch (3443:47): [True: 12.7k, False: 98]
  ------------------
 3444|  12.7k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 11.6k, False: 1.10k]
  ------------------
 3445|  12.7k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  12.7k|                                                                      pending_item_anchor_indent};
 3447|  12.7k|                  has_pending_item_anchor = false;
 3448|  12.7k|               }
 3449|   332k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5503|  1.38M|   {
 5504|  1.38M|      if constexpr (yaml::check_flow_context(Opts)) {
 5505|       |         // In flow context, only treat plain content as an implicit "key: value"
 5506|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5507|  1.38M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5508|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5509|       |            // once per entry per nesting level over the whole remaining flow collection.
 5510|  1.38M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5511|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5512|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5513|       |            // flow-context plain scalar, so every one of them is an indicator.
 5514|  1.38M|            bool at_node_start = true;
 5515|  1.38M|            int depth = 0;
 5516|  1.38M|            while (pos != stop) {
 5517|  1.38M|               const char c = *pos;
 5518|  1.38M|               if (c == ' ' || c == '\t') {
 5519|  1.38M|                  ++pos;
 5520|  1.38M|                  continue;
 5521|  1.38M|               }
 5522|  1.38M|               const bool node_start = std::exchange(at_node_start, false);
 5523|       |
 5524|  1.38M|               if ((c == '"' || c == '\'') && node_start) {
 5525|  1.38M|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5526|  1.38M|                  continue;
 5527|  1.38M|               }
 5528|  1.38M|               if (c == '[' || c == '{') {
 5529|  1.38M|                  ++depth;
 5530|  1.38M|                  at_node_start = true;
 5531|  1.38M|                  ++pos;
 5532|  1.38M|                  continue;
 5533|  1.38M|               }
 5534|  1.38M|               if (c == ']' || c == '}') {
 5535|  1.38M|                  if (depth == 0) return false;
 5536|  1.38M|                  --depth;
 5537|  1.38M|                  ++pos;
 5538|  1.38M|                  continue;
 5539|  1.38M|               }
 5540|  1.38M|               if (c == ',' && depth == 0) return false;
 5541|  1.38M|               if (c == ':' && depth == 0) {
 5542|  1.38M|                  auto next = pos + 1;
 5543|  1.38M|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5544|  1.38M|               }
 5545|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5546|  1.38M|               if (c == ',' || c == ':') {
 5547|  1.38M|                  at_node_start = true;
 5548|  1.38M|                  ++pos;
 5549|  1.38M|                  continue;
 5550|  1.38M|               }
 5551|  1.38M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5552|  1.38M|                  at_node_start = true;
 5553|  1.38M|                  continue;
 5554|  1.38M|               }
 5555|  1.38M|               ++pos;
 5556|  1.38M|            }
 5557|  1.38M|            return false;
 5558|  1.38M|         };
 5559|       |
 5560|  1.38M|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5560:14): [True: 577k, False: 810k]
  |  Branch (5560:49): [True: 18.5k, False: 792k]
  ------------------
 5561|   595k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5561:17): [True: 525k, False: 70.1k]
  ------------------
 5562|   525k|               return;
 5563|   525k|            }
 5564|  70.1k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5564:17): [True: 2.29k, False: 67.9k]
  ------------------
 5565|  2.29k|               return;
 5566|  2.29k|            }
 5567|  70.1k|         }
 5568|       |
 5569|   860k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5570|   860k|         return;
 5571|  1.38M|      }
 5572|       |
 5573|  1.38M|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5573:11): [True: 0, False: 1.38M]
  ------------------
 5574|      0|         return;
 5575|      0|      }
 5576|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5577|  1.38M|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5577:11): [True: 0, False: 1.38M]
  ------------------
 5578|      0|         return;
 5579|      0|      }
 5580|  1.38M|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5581|  1.38M|   }
_ZZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_ENKUlT_E_clISO_EEDaSX_:
 5507|  1.38M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5508|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5509|       |            // once per entry per nesting level over the whole remaining flow collection.
 5510|  1.38M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5511|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5512|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5513|       |            // flow-context plain scalar, so every one of them is an indicator.
 5514|  1.38M|            bool at_node_start = true;
 5515|  1.38M|            int depth = 0;
 5516|  18.0M|            while (pos != stop) {
  ------------------
  |  Branch (5516:20): [True: 17.8M, False: 169k]
  ------------------
 5517|  17.8M|               const char c = *pos;
 5518|  17.8M|               if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (5518:20): [True: 2.01M, False: 15.8M]
  |  Branch (5518:32): [True: 295k, False: 15.5M]
  ------------------
 5519|  2.31M|                  ++pos;
 5520|  2.31M|                  continue;
 5521|  2.31M|               }
 5522|  15.5M|               const bool node_start = std::exchange(at_node_start, false);
 5523|       |
 5524|  15.5M|               if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (5524:21): [True: 182k, False: 15.3M]
  |  Branch (5524:33): [True: 51.3k, False: 15.3M]
  |  Branch (5524:47): [True: 64.5k, False: 169k]
  ------------------
 5525|  64.5k|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
  ------------------
  |  Branch (5525:23): [True: 26.2k, False: 38.2k]
  ------------------
 5526|  38.2k|                  continue;
 5527|  64.5k|               }
 5528|  15.4M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5528:20): [True: 111k, False: 15.3M]
  |  Branch (5528:32): [True: 224k, False: 15.1M]
  ------------------
 5529|   335k|                  ++depth;
 5530|   335k|                  at_node_start = true;
 5531|   335k|                  ++pos;
 5532|   335k|                  continue;
 5533|   335k|               }
 5534|  15.1M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5534:20): [True: 83.8k, False: 15.0M]
  |  Branch (5534:32): [True: 164k, False: 14.8M]
  ------------------
 5535|   248k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5535:23): [True: 139k, False: 108k]
  ------------------
 5536|   108k|                  --depth;
 5537|   108k|                  ++pos;
 5538|   108k|                  continue;
 5539|   248k|               }
 5540|  14.8M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5540:20): [True: 584k, False: 14.3M]
  |  Branch (5540:32): [True: 371k, False: 213k]
  ------------------
 5541|  14.5M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5541:20): [True: 924k, False: 13.5M]
  |  Branch (5541:32): [True: 680k, False: 243k]
  ------------------
 5542|   680k|                  auto next = pos + 1;
 5543|   680k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5543:26): [True: 10.4k, False: 670k]
  |  Branch (5543:41): [True: 409k, False: 261k]
  |  Branch (5543:57): [True: 56.1k, False: 205k]
  |  Branch (5543:74): [True: 50.7k, False: 154k]
  |  Branch (5543:91): [True: 50.8k, False: 103k]
  ------------------
 5544|   680k|               }
 5545|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5546|  13.8M|               if (c == ',' || c == ':') {
  ------------------
  |  Branch (5546:20): [True: 213k, False: 13.6M]
  |  Branch (5546:32): [True: 243k, False: 13.3M]
  ------------------
 5547|   456k|                  at_node_start = true;
 5548|   456k|                  ++pos;
 5549|   456k|                  continue;
 5550|   456k|               }
 5551|  13.3M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
  ------------------
  |  Branch (5551:20): [True: 1.58M, False: 11.7M]
  |  Branch (5551:34): [True: 245k, False: 1.33M]
  ------------------
 5552|   245k|                  at_node_start = true;
 5553|   245k|                  continue;
 5554|   245k|               }
 5555|  13.1M|               ++pos;
 5556|  13.1M|            }
 5557|   169k|            return false;
 5558|  1.38M|         };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISM_EEDaSZ_:
 5938|   118k|            auto is_word_boundary = [&](const auto ptr) {
 5939|   118k|               if (ptr == end) {
  ------------------
  |  Branch (5939:20): [True: 2.58k, False: 115k]
  ------------------
 5940|  2.58k|                  return true;
 5941|  2.58k|               }
 5942|   115k|               if (*ptr == ':') {
  ------------------
  |  Branch (5942:20): [True: 62.6k, False: 53.3k]
  ------------------
 5943|  62.6k|                  auto next = ptr + 1;
 5944|  62.6k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5944:26): [True: 4.15k, False: 58.4k]
  |  Branch (5944:43): [True: 8.10k, False: 50.3k]
  |  Branch (5944:59): [True: 30.3k, False: 20.0k]
  |  Branch (5944:76): [True: 10.3k, False: 9.64k]
  |  Branch (5944:93): [True: 5.43k, False: 4.21k]
  ------------------
 5945|  62.6k|               }
 5946|  53.3k|               return is_plain_scalar_boundary(*ptr);
 5947|   115k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5864|  53.3k|            auto is_plain_scalar_boundary = [](const char ch) {
 5865|  53.3k|               switch (ch) {
 5866|  4.23k|               case ' ':
  ------------------
  |  Branch (5866:16): [True: 4.23k, False: 49.0k]
  ------------------
 5867|  7.52k|               case '\t':
  ------------------
  |  Branch (5867:16): [True: 3.28k, False: 50.0k]
  ------------------
 5868|  11.7k|               case '\n':
  ------------------
  |  Branch (5868:16): [True: 4.22k, False: 49.0k]
  ------------------
 5869|  30.1k|               case '\r':
  ------------------
  |  Branch (5869:16): [True: 18.3k, False: 34.9k]
  ------------------
 5870|  36.9k|               case ',':
  ------------------
  |  Branch (5870:16): [True: 6.84k, False: 46.4k]
  ------------------
 5871|  38.6k|               case ']':
  ------------------
  |  Branch (5871:16): [True: 1.63k, False: 51.6k]
  ------------------
 5872|  40.1k|               case '}':
  ------------------
  |  Branch (5872:16): [True: 1.54k, False: 51.7k]
  ------------------
 5873|  40.1k|                  return true;
 5874|  13.1k|               default:
  ------------------
  |  Branch (5874:16): [True: 13.1k, False: 40.1k]
  ------------------
 5875|  13.1k|                  return false;
 5876|  53.3k|               }
 5877|  53.3k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISM_EEDaSZ_:
 5879|   101k|            auto has_indented_block_continuation = [&](auto word_end) {
 5880|   101k|               if constexpr (yaml::check_flow_context(Opts)) {
 5881|   101k|                  return false;
 5882|   101k|               }
 5883|   101k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5883:20): [True: 0, False: 101k]
  ------------------
 5884|      0|                  return false;
 5885|      0|               }
 5886|   101k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5886:20): [True: 101k, False: 0]
  |  Branch (5886:40): [True: 0, False: 0]
  |  Branch (5886:61): [True: 0, False: 0]
  ------------------
 5887|      0|                  return false;
 5888|      0|               }
 5889|       |
 5890|   101k|               auto look = word_end;
 5891|   101k|               yaml::skip_newline(look, end);
 5892|   101k|               while (look != end) {
  ------------------
  |  Branch (5892:23): [True: 0, False: 101k]
  ------------------
 5893|      0|                  int32_t line_indent = 0;
 5894|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5894:26): [True: 0, False: 0]
  |  Branch (5894:41): [True: 0, False: 0]
  ------------------
 5895|      0|                     ++line_indent;
 5896|      0|                     ++look;
 5897|      0|                  }
 5898|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5898:23): [True: 0, False: 0]
  |  Branch (5898:38): [True: 0, False: 0]
  ------------------
 5899|      0|                     return false;
 5900|      0|                  }
 5901|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5901:23): [True: 0, False: 0]
  |  Branch (5901:38): [True: 0, False: 0]
  |  Branch (5901:55): [True: 0, False: 0]
  ------------------
 5902|      0|                     if (look != end) {
  ------------------
  |  Branch (5902:26): [True: 0, False: 0]
  ------------------
 5903|      0|                        yaml::skip_newline(look, end);
 5904|      0|                        continue;
 5905|      0|                     }
 5906|      0|                     return false;
 5907|      0|                  }
 5908|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5908:23): [True: 0, False: 0]
  ------------------
 5909|      0|                     yaml::skip_comment(look, end);
 5910|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5910:26): [True: 0, False: 0]
  |  Branch (5910:42): [True: 0, False: 0]
  |  Branch (5910:59): [True: 0, False: 0]
  ------------------
 5911|      0|                        yaml::skip_newline(look, end);
 5912|      0|                        continue;
 5913|      0|                     }
 5914|      0|                     return false;
 5915|      0|                  }
 5916|       |
 5917|       |                  // If the next non-empty line is an implicit mapping entry,
 5918|       |                  // don't treat it as scalar continuation for auto-deduced
 5919|       |                  // booleans/nulls.
 5920|      0|                  {
 5921|      0|                     auto scan = look;
 5922|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5922:29): [True: 0, False: 0]
  |  Branch (5922:44): [True: 0, False: 0]
  |  Branch (5922:61): [True: 0, False: 0]
  ------------------
 5923|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5923:29): [True: 0, False: 0]
  ------------------
 5924|      0|                           auto after_colon = scan + 1;
 5925|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5925:32): [True: 0, False: 0]
  |  Branch (5925:54): [True: 0, False: 0]
  |  Branch (5925:77): [True: 0, False: 0]
  ------------------
 5926|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5926:32): [True: 0, False: 0]
  |  Branch (5926:56): [True: 0, False: 0]
  ------------------
 5927|      0|                              return false;
 5928|      0|                           }
 5929|      0|                        }
 5930|      0|                        ++scan;
 5931|      0|                     }
 5932|      0|                  }
 5933|       |
 5934|      0|                  return line_indent > ctx.current_indent();
 5935|      0|               }
 5936|   101k|               return false;
 5937|   101k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5457|  1.27M|   {
 5458|  1.27M|      using counts = yaml_variant_type_count<Variant>;
 5459|       |      if constexpr (counts::n_object == 0) {
 5460|       |         return false;
 5461|       |      }
 5462|  1.27M|      else {
 5463|       |         // Quick check: if no viable mapping separator in the current span,
 5464|       |         // avoid expensive speculative parse.
 5465|  1.27M|         const bool could_be_mapping = [&] {
 5466|  1.27M|            if constexpr (yaml::check_flow_context(Opts)) {
 5467|  1.27M|               return line_could_be_flow_mapping(it, end);
 5468|  1.27M|            }
 5469|  1.27M|            else {
 5470|  1.27M|               return yaml::line_could_be_block_mapping(it, end);
 5471|  1.27M|            }
 5472|  1.27M|         }();
 5473|  1.27M|         if (!could_be_mapping) {
  ------------------
  |  Branch (5473:14): [True: 716k, False: 557k]
  ------------------
 5474|   716k|            return false;
 5475|   716k|         }
 5476|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5477|   557k|         auto temp_ctx = ctx.make_speculative();
 5478|   557k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5479|   557k|                                                                                               end);
 5480|   557k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5481|   557k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5482|   557k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5482:14): [True: 551k, False: 5.90k]
  ------------------
 5483|   551k|            ctx.anchors = std::move(temp_ctx.anchors);
 5484|   551k|            return true;
 5485|   551k|         }
 5486|       |         // The line matched "key: value" pattern but parsing failed.
 5487|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5488|       |         // so propagate the error rather than silently falling back to string.
 5489|  5.90k|         ctx.error = temp_ctx.error;
 5490|  5.90k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5491|  5.90k|         return false;
 5492|   557k|      }
 5493|  1.27M|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5465|  1.27M|         const bool could_be_mapping = [&] {
 5466|  1.27M|            if constexpr (yaml::check_flow_context(Opts)) {
 5467|  1.27M|               return line_could_be_flow_mapping(it, end);
 5468|       |            }
 5469|       |            else {
 5470|       |               return yaml::line_could_be_block_mapping(it, end);
 5471|       |            }
 5472|  1.27M|         }();
_ZN3glz4yaml15materialize_keyILb0ENS0_12yaml_contextEEEbRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERT0_:
   38|  1.12M|   {
   39|       |      if constexpr (empty_on_null) {
   40|       |         if (key_node.is_null()) {
   41|       |            key.clear();
   42|       |            return true;
   43|       |         }
   44|       |      }
   45|  1.12M|      if (auto* s = key_node.template get_if<std::string>()) {
  ------------------
  |  Branch (45:17): [True: 31.6k, False: 1.09M]
  ------------------
   46|  31.6k|         key = *s;
   47|  31.6k|         return true;
   48|  31.6k|      }
   49|  1.09M|      key.clear();
   50|  1.09M|      (void)glz::write_json(key_node, key);
   51|  1.09M|      if constexpr (requires { ctx.charge_key_expansion(size_t{}); }) {
   52|  1.09M|         if (!ctx.charge_key_expansion(key.size())) [[unlikely]] {
  ------------------
  |  Branch (52:14): [True: 72, False: 1.09M]
  ------------------
   53|     72|            ctx.error = error_code::exceeded_max_expansion;
   54|     72|            ctx.custom_error_message = "complex key expansion";
   55|     72|            return false;
   56|     72|         }
   57|  1.09M|      }
   58|  1.09M|      return true;
   59|  1.12M|   }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  2.06M|      {
  275|  2.06M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  2.06M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  2.06M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  2.06M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_:
 5725|  2.61M|      {
 5726|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5727|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5728|  2.61M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5729|  2.61M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5730|  2.61M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5731|  2.61M|                       "the internally tagged shape, so it is rejected here instead.");
 5732|  2.61M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5732:14): [True: 0, False: 2.61M]
  ------------------
 5733|      0|            return;
 5734|       |
 5735|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5736|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5737|       |         // indent stack does not cover.
 5738|  2.61M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5739|  2.61M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5739:14): [True: 2.56k, False: 2.61M]
  ------------------
 5740|  2.56k|            return;
 5741|       |
 5742|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5743|       |         // For nested values, only skip inline whitespace to preserve block structure
 5744|  2.61M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5744:14): [True: 1.37M, False: 1.24M]
  ------------------
 5745|  1.37M|            yaml::skip_ws_newlines_comments(it, end);
 5746|  1.37M|         }
 5747|  1.24M|         else {
 5748|  1.24M|            yaml::skip_inline_ws(it, end);
 5749|  1.24M|         }
 5750|       |
 5751|  2.61M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5751:14): [True: 56, False: 2.61M]
  ------------------
 5752|     56|            ctx.error = error_code::unexpected_end;
 5753|     56|            return;
 5754|     56|         }
 5755|       |
 5756|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5757|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5758|       |         // same variant definitions round-trip across both formats.
 5759|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5760|       |            using V = std::remove_cvref_t<T>;
 5761|       |            const bool value_is_mapping =
 5762|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5763|       |            if (value_is_mapping) {
 5764|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5765|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5766|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5767|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5768|       |               auto tag_ctx = ctx.make_speculative();
 5769|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5770|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5771|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5772|       |               if (index < ids_v<V>.size()) {
 5773|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5774|       |                  emplace_runtime_variant(value, index);
 5775|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5776|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5777|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5778|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5779|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5780|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5781|       |                     return;
 5782|       |                  }
 5783|       |                  std::visit(
 5784|       |                     [&](auto&& alt) {
 5785|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5786|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5787|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5788|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5789|       |                        }
 5790|       |                        else if constexpr (custom_read<Alt>) {
 5791|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5792|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5793|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5794|       |                           // entry, then hand the remaining mapping to the custom handler.
 5795|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5796|       |                              ctx.error = error_code::feature_not_supported;
 5797|       |                              ctx.custom_error_message =
 5798|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5799|       |                           }
 5800|       |                           else {
 5801|       |                              ctx.scratch.clear();
 5802|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5803|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5804|       |                                    ctx.error = error_code::feature_not_supported;
 5805|       |                                    ctx.custom_error_message =
 5806|       |                                       "the tag must be the first key for a custom variant alternative";
 5807|       |                                 }
 5808|       |                                 else {
 5809|       |                                    yaml::skip_inline_ws(it, end);
 5810|       |                                    if (it == end || *it != ':') {
 5811|       |                                       ctx.error = error_code::syntax_error;
 5812|       |                                    }
 5813|       |                                    else {
 5814|       |                                       ++it;
 5815|       |                                       yaml::skip_inline_ws(it, end);
 5816|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5817|       |                                       if (!bool(ctx.error)) {
 5818|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5819|       |                                          // was the whole mapping: leave the alternative default.
 5820|       |                                          auto probe = it;
 5821|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5822|       |                                          if (probe == end) {
 5823|       |                                             it = probe;
 5824|       |                                          }
 5825|       |                                          else {
 5826|       |                                             // Publish the mapping's column so the custom handler's block
 5827|       |                                             // mapping (which would otherwise discover its own indent) reads
 5828|       |                                             // the remaining entries at the variant's indent and dedents
 5829|       |                                             // correctly in every context (root, sequence, nested).
 5830|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5831|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5832|       |                                             ctx.forced_block_mapping_indent = -1;
 5833|       |                                          }
 5834|       |                                       }
 5835|       |                                    }
 5836|       |                                 }
 5837|       |                              }
 5838|       |                           }
 5839|       |                        }
 5840|       |                        else {
 5841|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5842|       |                           // the value, but the mapping must still be consumed.
 5843|       |                           walk_tagged_mapping<Opts>(
 5844|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5845|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5846|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5847|       |                              });
 5848|       |                        }
 5849|       |                     },
 5850|       |                     value);
 5851|       |                  ctx.pop_indent();
 5852|       |                  return;
 5853|       |               }
 5854|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5855|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5856|       |               // otherwise the deduction path reports no_matching_variant_type.
 5857|       |            }
 5858|       |         }
 5859|       |
 5860|  2.61M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5861|  2.61M|            using V = std::remove_cvref_t<T>;
 5862|  2.61M|            using counts = yaml_variant_type_count<V>;
 5863|  2.61M|            const char c = *it;
 5864|  2.61M|            auto is_plain_scalar_boundary = [](const char ch) {
 5865|  2.61M|               switch (ch) {
 5866|  2.61M|               case ' ':
 5867|  2.61M|               case '\t':
 5868|  2.61M|               case '\n':
 5869|  2.61M|               case '\r':
 5870|  2.61M|               case ',':
 5871|  2.61M|               case ']':
 5872|  2.61M|               case '}':
 5873|  2.61M|                  return true;
 5874|  2.61M|               default:
 5875|  2.61M|                  return false;
 5876|  2.61M|               }
 5877|  2.61M|            };
 5878|       |
 5879|  2.61M|            auto has_indented_block_continuation = [&](auto word_end) {
 5880|  2.61M|               if constexpr (yaml::check_flow_context(Opts)) {
 5881|  2.61M|                  return false;
 5882|  2.61M|               }
 5883|  2.61M|               if (ctx.current_indent() < 0) {
 5884|  2.61M|                  return false;
 5885|  2.61M|               }
 5886|  2.61M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5887|  2.61M|                  return false;
 5888|  2.61M|               }
 5889|       |
 5890|  2.61M|               auto look = word_end;
 5891|  2.61M|               yaml::skip_newline(look, end);
 5892|  2.61M|               while (look != end) {
 5893|  2.61M|                  int32_t line_indent = 0;
 5894|  2.61M|                  while (look != end && *look == ' ') {
 5895|  2.61M|                     ++line_indent;
 5896|  2.61M|                     ++look;
 5897|  2.61M|                  }
 5898|  2.61M|                  if (look != end && *look == '\t') {
 5899|  2.61M|                     return false;
 5900|  2.61M|                  }
 5901|  2.61M|                  if (look == end || *look == '\n' || *look == '\r') {
 5902|  2.61M|                     if (look != end) {
 5903|  2.61M|                        yaml::skip_newline(look, end);
 5904|  2.61M|                        continue;
 5905|  2.61M|                     }
 5906|  2.61M|                     return false;
 5907|  2.61M|                  }
 5908|  2.61M|                  if (*look == '#') {
 5909|  2.61M|                     yaml::skip_comment(look, end);
 5910|  2.61M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5911|  2.61M|                        yaml::skip_newline(look, end);
 5912|  2.61M|                        continue;
 5913|  2.61M|                     }
 5914|  2.61M|                     return false;
 5915|  2.61M|                  }
 5916|       |
 5917|       |                  // If the next non-empty line is an implicit mapping entry,
 5918|       |                  // don't treat it as scalar continuation for auto-deduced
 5919|       |                  // booleans/nulls.
 5920|  2.61M|                  {
 5921|  2.61M|                     auto scan = look;
 5922|  2.61M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5923|  2.61M|                        if (*scan == ':') {
 5924|  2.61M|                           auto after_colon = scan + 1;
 5925|  2.61M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5926|  2.61M|                               *after_colon == '\n' || *after_colon == '\r') {
 5927|  2.61M|                              return false;
 5928|  2.61M|                           }
 5929|  2.61M|                        }
 5930|  2.61M|                        ++scan;
 5931|  2.61M|                     }
 5932|  2.61M|                  }
 5933|       |
 5934|  2.61M|                  return line_indent > ctx.current_indent();
 5935|  2.61M|               }
 5936|  2.61M|               return false;
 5937|  2.61M|            };
 5938|  2.61M|            auto is_word_boundary = [&](const auto ptr) {
 5939|  2.61M|               if (ptr == end) {
 5940|  2.61M|                  return true;
 5941|  2.61M|               }
 5942|  2.61M|               if (*ptr == ':') {
 5943|  2.61M|                  auto next = ptr + 1;
 5944|  2.61M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5945|  2.61M|               }
 5946|  2.61M|               return is_plain_scalar_boundary(*ptr);
 5947|  2.61M|            };
 5948|       |
 5949|  2.61M|            switch (c) {
 5950|   685k|            case '&': {
  ------------------
  |  Branch (5950:13): [True: 685k, False: 1.92M]
  ------------------
 5951|       |               // Anchor before value: parse name, then re-dispatch
 5952|   685k|               ++it;
 5953|   685k|               auto aname = yaml::parse_anchor_name(it, end);
 5954|   685k|               if (aname.empty()) {
  ------------------
  |  Branch (5954:20): [True: 30, False: 685k]
  ------------------
 5955|     30|                  ctx.error = error_code::syntax_error;
 5956|     30|                  return;
 5957|     30|               }
 5958|   685k|               yaml::skip_inline_ws(it, end);
 5959|   685k|               bool anchor_on_same_line = true;
 5960|   685k|               bool value_is_indentless_sequence = false;
 5961|   685k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5961:20): [True: 30.8k, False: 654k]
  |  Branch (5961:33): [True: 63.7k, False: 590k]
  |  Branch (5961:48): [True: 126k, False: 463k]
  |  Branch (5961:63): [True: 24.1k, False: 439k]
  ------------------
 5962|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5963|       |                  // next line (indented past current context) or if this is an empty node.
 5964|   245k|                  bool value_on_next_line = false;
 5965|   245k|                  if (it != end) {
  ------------------
  |  Branch (5965:23): [True: 214k, False: 30.8k]
  ------------------
 5966|   214k|                     auto peek = it;
 5967|       |                     // Skip comment if present
 5968|   214k|                     if (*peek == '#') {
  ------------------
  |  Branch (5968:26): [True: 24.1k, False: 190k]
  ------------------
 5969|   282k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5969:32): [True: 281k, False: 790]
  |  Branch (5969:47): [True: 268k, False: 13.2k]
  |  Branch (5969:64): [True: 258k, False: 10.0k]
  ------------------
 5970|  24.1k|                     }
 5971|       |                     // Skip newline
 5972|   214k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5972:26): [True: 213k, False: 790]
  |  Branch (5972:42): [True: 77.0k, False: 136k]
  |  Branch (5972:59): [True: 136k, False: 0]
  ------------------
 5973|   213k|                        yaml::skip_newline(peek, end);
 5974|       |                        // Skip blank lines
 5975|   354k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5975:32): [True: 341k, False: 13.5k]
  |  Branch (5975:48): [True: 58.2k, False: 283k]
  |  Branch (5975:65): [True: 83.0k, False: 200k]
  ------------------
 5976|   141k|                           yaml::skip_newline(peek, end);
 5977|   141k|                        }
 5978|       |                        // Measure indent of next content line
 5979|   213k|                        int32_t next_indent = 0;
 5980|   398k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5980:32): [True: 382k, False: 15.5k]
  |  Branch (5980:47): [True: 184k, False: 198k]
  ------------------
 5981|   184k|                           ++next_indent;
 5982|   184k|                           ++peek;
 5983|   184k|                        }
 5984|   213k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5984:29): [True: 198k, False: 15.5k]
  |  Branch (5984:44): [True: 197k, False: 808]
  |  Branch (5984:61): [True: 195k, False: 1.91k]
  ------------------
 5985|   195k|                           const bool indentless_sequence =
 5986|   195k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5986:31): [True: 193k, False: 2.10k]
  |  Branch (5986:69): [True: 64.6k, False: 128k]
  ------------------
 5987|  64.6k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5987:32): [True: 558, False: 64.1k]
  ------------------
 5988|  64.1k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5988:32): [True: 60.5k, False: 3.53k]
  ------------------
 5989|  61.1k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5989:32): [True: 2.71k, False: 58.4k]
  ------------------
 5990|  58.4k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5990:33): [True: 34.3k, False: 24.0k]
  |  Branch (5990:61): [True: 33.3k, False: 1.00k]
  ------------------
 5991|   195k|                           value_is_indentless_sequence = indentless_sequence;
 5992|   195k|                           const bool same_indent_property_node =
 5993|   195k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5993:31): [True: 15.3k, False: 179k]
  ------------------
 5994|  15.3k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5994:32): [True: 312, False: 15.0k]
  |  Branch (5994:48): [True: 2.06k, False: 13.0k]
  |  Branch (5994:64): [True: 766, False: 12.2k]
  |  Branch (5994:80): [True: 620, False: 11.6k]
  |  Branch (5994:96): [True: 944, False: 10.6k]
  ------------------
 5995|  10.6k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5995:32): [True: 2.27k, False: 8.41k]
  |  Branch (5995:48): [True: 206, False: 8.21k]
  |  Branch (5995:65): [True: 578, False: 7.63k]
  |  Branch (5995:81): [True: 2.55k, False: 5.07k]
  ------------------
 5996|   195k|                           value_on_next_line =
 5997|   195k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5997:31): [True: 129k, False: 66.1k]
  |  Branch (5997:71): [True: 36.0k, False: 30.0k]
  |  Branch (5997:94): [True: 10.3k, False: 19.7k]
  ------------------
 5998|   195k|                        }
 5999|   213k|                     }
 6000|   214k|                  }
 6001|   245k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6001:23): [True: 69.7k, False: 175k]
  ------------------
 6002|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6003|  69.7k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6004|  69.7k|                     return;
 6005|  69.7k|                  }
 6006|       |                  // Value is on next line — advance past newline/blank lines to the content
 6007|   175k|                  if (*it == '#') {
  ------------------
  |  Branch (6007:23): [True: 16.2k, False: 159k]
  ------------------
 6008|   115k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6008:29): [True: 115k, False: 0]
  |  Branch (6008:42): [True: 104k, False: 10.8k]
  |  Branch (6008:57): [True: 99.1k, False: 5.34k]
  ------------------
 6009|  16.2k|                  }
 6010|   175k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6010:23): [True: 175k, False: 0]
  ------------------
 6011|   273k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6011:26): [True: 273k, False: 0]
  |  Branch (6011:40): [True: 33.7k, False: 240k]
  |  Branch (6011:55): [True: 64.6k, False: 175k]
  ------------------
 6012|  98.3k|                     yaml::skip_newline(it, end);
 6013|  98.3k|                  }
 6014|   175k|                  yaml::skip_inline_ws(it, end);
 6015|   175k|                  anchor_on_same_line = false;
 6016|   175k|               }
 6017|       |
 6018|   615k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6019|   615k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (6019:23): [True: 439k, False: 175k]
  |  Branch (6019:46): [True: 11.8k, False: 427k]
  ------------------
 6020|  11.8k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (6020:24): [True: 6, False: 11.8k]
  |  Branch (6020:43): [True: 6, False: 11.8k]
  ------------------
 6021|       |                     // "&anchor - item" is malformed in block context.
 6022|     12|                     ctx.error = error_code::syntax_error;
 6023|     12|                     return;
 6024|     12|                  }
 6025|   615k|               }
 6026|       |
 6027|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6028|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6029|   615k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6029:20): [True: 615k, False: 28]
  |  Branch (6029:33): [True: 5.18k, False: 610k]
  |  Branch (6029:47): [True: 24, False: 5.15k]
  ------------------
 6030|     24|                  ctx.error = error_code::syntax_error;
 6031|     24|                  return;
 6032|     24|               }
 6033|       |
 6034|   615k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6035|   615k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (6035:23): [True: 175k, False: 439k]
  |  Branch (6035:47): [True: 175k, False: 16]
  |  Branch (6035:60): [True: 10.6k, False: 164k]
  ------------------
 6036|  10.6k|                     auto probe = it + 1;
 6037|  10.6k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6038|  10.6k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (6038:26): [True: 16, False: 10.6k]
  ------------------
 6039|     16|                        ctx.error = error_code::syntax_error;
 6040|     16|                        return;
 6041|     16|                     }
 6042|  10.6k|                     yaml::skip_inline_ws(probe, end);
 6043|       |                     // Allow nested anchor usage only when it clearly starts a
 6044|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 6045|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 6046|  10.6k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (6046:26): [True: 80, False: 10.5k]
  ------------------
 6047|     80|                        ctx.error = error_code::syntax_error;
 6048|     80|                        return;
 6049|     80|                     }
 6050|  10.6k|                  }
 6051|   615k|               }
 6052|       |
 6053|   615k|               const char* anchor_start = &*it;
 6054|   615k|               const int32_t anchor_indent = ctx.current_indent();
 6055|       |
 6056|   615k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6057|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 6058|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 6059|       |                  // next line, the anchor applies to the entire next-line content.
 6060|   615k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6060:23): [True: 439k, False: 175k]
  |  Branch (6060:46): [True: 113k, False: 325k]
  ------------------
 6061|   113k|                     auto key_start = it;
 6062|   113k|                     if (*key_start == '!') {
  ------------------
  |  Branch (6062:26): [True: 3.30k, False: 110k]
  ------------------
 6063|  3.30k|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6064|  3.30k|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (6064:29): [True: 6, False: 3.29k]
  |  Branch (6064:67): [True: 6, False: 3.29k]
  ------------------
 6065|     12|                           ctx.error = error_code::syntax_error;
 6066|     12|                           return;
 6067|     12|                        }
 6068|  3.29k|                        yaml::skip_inline_ws(key_start, end);
 6069|  3.29k|                        if (key_start == end) {
  ------------------
  |  Branch (6069:29): [True: 6, False: 3.28k]
  ------------------
 6070|      6|                           ctx.error = error_code::unexpected_end;
 6071|      6|                           return;
 6072|      6|                        }
 6073|  3.28k|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (6073:29): [True: 6, False: 3.28k]
  |  Branch (6073:51): [True: 6, False: 3.27k]
  ------------------
 6074|     12|                           ctx.error = error_code::syntax_error;
 6075|     12|                           return;
 6076|     12|                        }
 6077|       |
 6078|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 6079|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 6080|       |                        // key-span registration below while the untagged spelling was rejected;
 6081|       |                        // an alias node carries no other properties either way.
 6082|  3.27k|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (6082:29): [True: 706, False: 2.56k]
  |  Branch (6082:50): [True: 6, False: 700]
  ------------------
 6083|      6|                           ctx.error = error_code::syntax_error;
 6084|      6|                           return;
 6085|      6|                        }
 6086|  3.27k|                     }
 6087|       |
 6088|       |                     // Find the key span by scanning to the key-value separator
 6089|   113k|                     auto key_scan = key_start;
 6090|   113k|                     auto key_end = key_start;
 6091|   113k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6091:26): [True: 622, False: 113k]
  |  Branch (6091:46): [True: 604, False: 112k]
  ------------------
 6092|       |                        // Quoted key: skip to closing quote
 6093|  1.22k|                        const char quote = *key_scan;
 6094|  1.22k|                        ++key_scan;
 6095|  5.19k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6095:32): [True: 5.19k, False: 0]
  |  Branch (6095:51): [True: 3.96k, False: 1.22k]
  ------------------
 6096|  3.96k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6096:32): [True: 486, False: 3.47k]
  |  Branch (6096:53): [True: 222, False: 264]
  ------------------
 6097|    222|                              ++key_scan;
 6098|    222|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6098:35): [True: 222, False: 0]
  ------------------
 6099|    222|                           }
 6100|  3.74k|                           else {
 6101|  3.74k|                              ++key_scan;
 6102|  3.74k|                           }
 6103|  3.96k|                        }
 6104|  1.22k|                        if (key_scan == end) {
  ------------------
  |  Branch (6104:29): [True: 0, False: 1.22k]
  ------------------
 6105|      0|                           ctx.error = error_code::syntax_error;
 6106|      0|                           return;
 6107|      0|                        }
 6108|  1.22k|                        ++key_scan; // past closing quote
 6109|  1.22k|                        key_end = key_scan;
 6110|  1.22k|                        yaml::skip_inline_ws(key_scan, end);
 6111|  1.22k|                     }
 6112|   112k|                     else {
 6113|       |                        // Plain key: scan to ':'
 6114|  1.27M|                        while (key_scan != end) {
  ------------------
  |  Branch (6114:32): [True: 1.27M, False: 6]
  ------------------
 6115|  1.27M|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6115:32): [True: 142k, False: 1.12M]
  ------------------
 6116|   142k|                              auto next = key_scan + 1;
 6117|   142k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6117:35): [True: 20.6k, False: 121k]
  |  Branch (6117:50): [True: 53.5k, False: 68.1k]
  |  Branch (6117:66): [True: 22.4k, False: 45.6k]
  |  Branch (6117:83): [True: 11.3k, False: 34.3k]
  |  Branch (6117:100): [True: 4.50k, False: 29.8k]
  ------------------
 6118|   112k|                                 break;
 6119|   112k|                              }
 6120|   142k|                           }
 6121|  1.15M|                           ++key_scan;
 6122|  1.15M|                        }
 6123|   112k|                        key_end = key_scan;
 6124|   125k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6124:32): [True: 113k, False: 12.4k]
  |  Branch (6124:57): [True: 12.4k, False: 100k]
  |  Branch (6124:82): [True: 722, False: 100k]
  ------------------
 6125|  13.1k|                           --key_end;
 6126|  13.1k|                        }
 6127|   112k|                     }
 6128|   113k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6128:26): [True: 12, False: 113k]
  |  Branch (6128:45): [True: 48, False: 113k]
  ------------------
 6129|     60|                        ctx.error = error_code::syntax_error;
 6130|     60|                        return;
 6131|     60|                     }
 6132|       |                     // Store anchor with just the key text span
 6133|   113k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6134|   113k|                     it = key_start;
 6135|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6136|   113k|                     if constexpr (counts::n_object > 0) {
 6137|   113k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6138|   113k|                                                                                                        end);
 6139|       |                     }
 6140|       |                     else {
 6141|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6142|       |                     }
 6143|   113k|                     return;
 6144|   113k|                  }
 6145|   615k|               }
 6146|       |
 6147|   501k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6148|   615k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6149|   615k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6150|   615k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6151|   615k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6151:20): [True: 473k, False: 141k]
  ------------------
 6152|   473k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6153|   473k|               }
 6154|   615k|               return;
 6155|   615k|            }
 6156|  37.8k|            case '*': {
  ------------------
  |  Branch (6156:13): [True: 37.8k, False: 2.57M]
  ------------------
 6157|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6158|  37.8k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|  37.8k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6159:23): [True: 11.3k, False: 26.5k]
  ------------------
 6160|  11.3k|                     if constexpr (counts::n_object > 0) {
 6161|  11.3k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|  11.3k|                                                                                                        end);
 6163|  11.3k|                        return;
 6164|       |                     }
 6165|       |                     else {
 6166|       |                        ctx.error = error_code::syntax_error;
 6167|       |                        return;
 6168|       |                     }
 6169|  11.3k|                  }
 6170|  37.8k|               }
 6171|       |
 6172|       |               // Alias value: look up anchor and replay
 6173|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6174|  37.8k|               return;
 6175|   615k|            }
 6176|   225k|            case '!': {
  ------------------
  |  Branch (6176:13): [True: 225k, False: 2.38M]
  ------------------
 6177|       |               // Tag - parse it and dispatch based on tag type
 6178|   225k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6179|   225k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6179:20): [True: 14, False: 225k]
  ------------------
 6180|     14|                  ctx.error = error_code::syntax_error;
 6181|     14|                  return;
 6182|     14|               }
 6183|   225k|               yaml::skip_inline_ws(it, end);
 6184|   225k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6184:20): [True: 220k, False: 5.08k]
  |  Branch (6184:33): [True: 40.6k, False: 179k]
  ------------------
 6185|  40.6k|                  yaml::skip_comment(it, end);
 6186|  40.6k|               }
 6187|   225k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6187:20): [True: 219k, False: 6.20k]
  |  Branch (6187:34): [True: 35.3k, False: 183k]
  |  Branch (6187:49): [True: 71.2k, False: 112k]
  ------------------
 6188|   106k|                  auto content = it;
 6189|   106k|                  yaml::skip_newline(content, end);
 6190|   106k|                  yaml::skip_to_content(content, end);
 6191|       |
 6192|   106k|                  bool consume_following_content = false;
 6193|   106k|                  auto content_token = content;
 6194|   106k|                  if (content != end) {
  ------------------
  |  Branch (6194:23): [True: 80.7k, False: 25.8k]
  ------------------
 6195|  80.7k|                     auto indent_probe = content;
 6196|  80.7k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6197|  80.7k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6197:26): [True: 10, False: 80.7k]
  ------------------
 6198|     10|                        return;
 6199|  80.7k|                     content_token = indent_probe;
 6200|       |
 6201|       |                     // A tag at the end of a sequence/map entry has an empty value
 6202|       |                     // unless the next non-empty content is nested under the current node.
 6203|  80.7k|                     bool tagged_indentless_sequence = false;
 6204|  80.7k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6204:26): [True: 17.6k, False: 63.0k]
  |  Branch (6204:56): [True: 17.6k, False: 0]
  |  Branch (6204:79): [True: 16.5k, False: 1.19k]
  ------------------
 6205|  16.5k|                        const auto after_dash = indent_probe + 1;
 6206|  16.5k|                        if (after_dash == end ||
  ------------------
  |  Branch (6206:29): [True: 2.15k, False: 14.3k]
  ------------------
 6207|  16.0k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6207:29): [True: 13.9k, False: 430]
  ------------------
 6208|  16.0k|                           tagged_indentless_sequence =
 6209|  16.0k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6209:31): [True: 2.14k, False: 13.9k]
  ------------------
 6210|  13.9k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6210:32): [True: 10.3k, False: 3.54k]
  |  Branch (6210:60): [True: 1.35k, False: 9.03k]
  ------------------
 6211|  16.0k|                        }
 6212|  16.5k|                     }
 6213|       |
 6214|  80.7k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6214:50): [True: 25.1k, False: 55.5k]
  ------------------
 6215|  55.5k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6215:50): [True: 21.8k, False: 33.7k]
  |  Branch (6215:93): [True: 3.49k, False: 30.2k]
  ------------------
 6216|  80.7k|                  }
 6217|       |
 6218|   106k|                  if (consume_following_content) {
  ------------------
  |  Branch (6218:23): [True: 50.5k, False: 56.0k]
  ------------------
 6219|  50.5k|                     it = content_token;
 6220|  50.5k|                  }
 6221|  56.0k|                  else {
 6222|  56.0k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6222:26): [True: 3.73k, False: 52.3k]
  ------------------
 6223|  3.73k|                        if constexpr (counts::n_str > 0) {
 6224|  3.73k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6225|  3.73k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6226|  3.73k|                           value = StrType{};
 6227|  3.73k|                           return;
 6228|  3.73k|                        }
 6229|  3.73k|                     }
 6230|  56.0k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6230:26): [True: 594, False: 55.4k]
  ------------------
 6231|    594|                        if constexpr (counts::n_null > 0) {
 6232|    594|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6233|    594|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6234|    594|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6234:32): [True: 0, False: 594]
  ------------------
 6235|    594|                           return;
 6236|    594|                        }
 6237|    594|                     }
 6238|  56.0k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6238:26): [True: 51.1k, False: 4.91k]
  ------------------
 6239|  51.1k|                        if constexpr (counts::n_null > 0) {
 6240|  51.1k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6241|  51.1k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6242|  51.1k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6242:32): [True: 0, False: 51.1k]
  ------------------
 6243|  51.1k|                           return;
 6244|  51.1k|                        }
 6245|  51.1k|                     }
 6246|  56.0k|                  }
 6247|   106k|               }
 6248|   225k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6249|       |                  // In block context, a comma immediately after a tag token is malformed
 6250|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6251|   225k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6251:23): [True: 163k, False: 61.6k]
  |  Branch (6251:36): [True: 6, False: 163k]
  ------------------
 6252|      6|                     ctx.error = error_code::syntax_error;
 6253|      6|                     return;
 6254|      6|                  }
 6255|   225k|                  if constexpr (counts::n_object > 0) {
 6256|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6257|   225k|                     const bool starts_block_sequence_entry =
 6258|   225k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6258:26): [True: 163k, False: 61.6k]
  |  Branch (6258:39): [True: 28.4k, False: 135k]
  ------------------
 6259|  28.4k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6259:26): [True: 2.36k, False: 26.0k]
  |  Branch (6259:45): [True: 24.5k, False: 1.53k]
  ------------------
 6260|   225k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6260:26): [True: 142k, False: 82.3k]
  |  Branch (6260:58): [True: 12.6k, False: 130k]
  ------------------
 6261|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6262|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6263|  12.6k|                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6264|  12.6k|                        return;
 6265|  12.6k|                     }
 6266|   225k|                  }
 6267|   225k|               }
 6268|   225k|               if (it == end) {
  ------------------
  |  Branch (6268:20): [True: 6.20k, False: 219k]
  ------------------
 6269|  6.20k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6269:23): [True: 2.33k, False: 3.87k]
  ------------------
 6270|  2.33k|                     if constexpr (counts::n_str > 0) {
 6271|  2.33k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6272|  2.33k|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6273|  2.33k|                        value = StrType{};
 6274|  2.33k|                        return;
 6275|  2.33k|                     }
 6276|  2.33k|                  }
 6277|  6.20k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6277:23): [True: 3.86k, False: 2.34k]
  ------------------
 6278|  3.86k|                     if constexpr (counts::n_null > 0) {
 6279|  3.86k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6280|  3.86k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6281|  3.86k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6281:29): [True: 0, False: 3.86k]
  ------------------
 6282|  3.86k|                        return;
 6283|  3.86k|                     }
 6284|  3.86k|                  }
 6285|      0|                  ctx.error = error_code::unexpected_end;
 6286|  6.20k|                  return;
 6287|  6.20k|               }
 6288|   219k|               switch (tag) {
 6289|  1.96k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6289:16): [True: 1.96k, False: 217k]
  ------------------
 6290|  1.96k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6291|  1.96k|                  return;
 6292|  8.27k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6292:16): [True: 8.27k, False: 210k]
  ------------------
 6293|  8.47k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6293:16): [True: 202, False: 218k]
  ------------------
 6294|  8.47k|                  if constexpr (counts::n_num > 0) {
 6295|  8.47k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6296|  8.47k|                     return;
 6297|       |                  }
 6298|       |                  else { // else used to fix MSVC unreachable code warning
 6299|       |                     ctx.error = error_code::syntax_error;
 6300|       |                     return;
 6301|       |                  }
 6302|  42.4k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6302:16): [True: 34.0k, False: 185k]
  ------------------
 6303|  42.4k|                  if constexpr (counts::n_bool > 0) {
 6304|  42.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6305|  42.4k|                     return;
 6306|       |                  }
 6307|       |                  else { // else used to fix MSVC unreachable code warning
 6308|       |                     ctx.error = error_code::syntax_error;
 6309|       |                     return;
 6310|       |                  }
 6311|  43.3k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6311:16): [True: 886, False: 218k]
  ------------------
 6312|  43.3k|                  if constexpr (counts::n_null > 0) {
 6313|  43.3k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6314|  43.3k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6315|  43.3k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6315:26): [True: 0, False: 43.3k]
  ------------------
 6316|  43.3k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6317|  43.3k|                     return;
 6318|       |                  }
 6319|       |                  else { // else used to fix MSVC unreachable code warning
 6320|       |                     ctx.error = error_code::syntax_error;
 6321|       |                     return;
 6322|       |                  }
 6323|  53.3k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6323:16): [True: 10.0k, False: 209k]
  ------------------
 6324|  53.3k|                  if constexpr (counts::n_object > 0) {
 6325|  53.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6326|  53.3k|                                                                                                     end);
 6327|  53.3k|                     return;
 6328|       |                  }
 6329|       |                  else { // else used to fix MSVC unreachable code warning
 6330|       |                     ctx.error = error_code::syntax_error;
 6331|       |                     return;
 6332|       |                  }
 6333|  82.0k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6333:16): [True: 28.6k, False: 190k]
  ------------------
 6334|  82.0k|                  if constexpr (counts::n_array > 0) {
 6335|  82.0k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6336|  82.0k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6337|  82.0k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6337:29): [True: 28.6k, False: 53.3k]
  |  Branch (6337:42): [True: 16.1k, False: 12.4k]
  ------------------
 6338|  16.1k|                           ctx.allow_indentless_sequence = true;
 6339|  16.1k|                        }
 6340|  82.0k|                     }
 6341|  82.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6342|  82.0k|                                                                                                    end);
 6343|  82.0k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6344|  82.0k|                     return;
 6345|       |                  }
 6346|       |                  else { // else used to fix MSVC unreachable code warning
 6347|       |                     ctx.error = error_code::syntax_error;
 6348|       |                     return;
 6349|       |                  }
 6350|   149k|               default: {
  ------------------
  |  Branch (6350:16): [True: 67.0k, False: 152k]
  ------------------
 6351|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6352|       |                  // Preserve collection kinds, otherwise treat as string content.
 6353|   149k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6353:23): [True: 67.0k, False: 82.0k]
  |  Branch (6353:36): [True: 9.87k, False: 57.1k]
  ------------------
 6354|  9.87k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6355|  9.87k|                     return;
 6356|  9.87k|                  }
 6357|       |
 6358|   139k|                  if constexpr (counts::n_array > 0) {
 6359|   139k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6359:26): [True: 57.1k, False: 82.0k]
  |  Branch (6359:39): [True: 1.79k, False: 55.3k]
  ------------------
 6360|  1.79k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6361|  1.79k|                                                                                                       end);
 6362|  1.79k|                        return;
 6363|  1.79k|                     }
 6364|   139k|                  }
 6365|   139k|                  if constexpr (counts::n_object > 0) {
 6366|   139k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6366:26): [True: 55.3k, False: 83.8k]
  |  Branch (6366:39): [True: 3.46k, False: 51.8k]
  ------------------
 6367|  3.46k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6368|  3.46k|                                                                                                        end);
 6369|  3.46k|                        return;
 6370|  3.46k|                     }
 6371|   139k|                  }
 6372|       |
 6373|   139k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6374|   139k|                     if constexpr (counts::n_array > 0) {
 6375|   139k|                        const bool starts_block_sequence_entry =
 6376|   139k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6376:29): [True: 51.8k, False: 87.3k]
  |  Branch (6376:42): [True: 10.4k, False: 41.4k]
  ------------------
 6377|  10.4k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6377:29): [True: 212, False: 10.2k]
  |  Branch (6377:48): [True: 9.69k, False: 536]
  ------------------
 6378|   139k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6378:29): [True: 9.90k, False: 129k]
  ------------------
 6379|  9.90k|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6380|  9.90k|                                                                                                          it, end);
 6381|  9.90k|                           return;
 6382|  9.90k|                        }
 6383|   139k|                     }
 6384|   139k|                     if constexpr (counts::n_object > 0) {
 6385|   139k|                        const bool starts_explicit_mapping_indicator =
 6386|   139k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6386:29): [True: 41.9k, False: 97.2k]
  |  Branch (6386:43): [True: 1.64k, False: 40.3k]
  |  Branch (6386:57): [True: 686, False: 39.6k]
  ------------------
 6387|  2.33k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6387:29): [True: 216, False: 2.11k]
  |  Branch (6387:48): [True: 1.08k, False: 1.03k]
  ------------------
 6388|   139k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6388:29): [True: 1.30k, False: 137k]
  ------------------
 6389|  1.30k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6390|  1.30k|                                                                                                           it, end);
 6391|  1.30k|                           return;
 6392|  1.30k|                        }
 6393|   137k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6393:29): [True: 0, False: 137k]
  ------------------
 6394|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6395|      0|                                                                                                           it, end);
 6396|      0|                           return;
 6397|      0|                        }
 6398|   137k|                     }
 6399|   139k|                  }
 6400|       |
 6401|   139k|                  if constexpr (counts::n_str > 0) {
 6402|   139k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6403|   139k|                     return;
 6404|   139k|                  }
 6405|       |
 6406|       |                  // Fall back if no string alternative exists.
 6407|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6408|   139k|                  return;
 6409|   149k|               }
 6410|   219k|               }
 6411|      0|               return;
 6412|   219k|            }
 6413|   138k|            case '{':
  ------------------
  |  Branch (6413:13): [True: 138k, False: 2.47M]
  ------------------
 6414|   138k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6415|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6416|   138k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6416:23): [True: 99.2k, False: 38.7k]
  |  Branch (6416:51): [True: 13.0k, False: 86.2k]
  ------------------
 6417|  13.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6418|  13.0k|                                                                                                     end);
 6419|  13.0k|                     return;
 6420|  13.0k|                  }
 6421|   138k|               }
 6422|       |               // Flow mapping - object type
 6423|   124k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6424|   138k|               return;
 6425|  64.3k|            case '[':
  ------------------
  |  Branch (6425:13): [True: 64.3k, False: 2.54M]
  ------------------
 6426|  64.3k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6427|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6428|  64.3k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6428:23): [True: 28.6k, False: 35.6k]
  |  Branch (6428:51): [True: 246, False: 28.4k]
  ------------------
 6429|    246|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6430|    246|                                                                                                     end);
 6431|    246|                     return;
 6432|    246|                  }
 6433|  64.3k|               }
 6434|       |               // Flow sequence - array type
 6435|  64.0k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6436|  64.3k|               return;
 6437|   492k|            case '?':
  ------------------
  |  Branch (6437:13): [True: 492k, False: 2.11M]
  ------------------
 6438|       |               // Explicit mapping key indicator ("? key")
 6439|   492k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6439:20): [True: 491k, False: 932]
  |  Branch (6439:39): [True: 14, False: 491k]
  ------------------
 6440|     14|                  ctx.error = error_code::syntax_error;
 6441|     14|                  return;
 6442|     14|               }
 6443|   492k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6443:20): [True: 491k, False: 932]
  |  Branch (6443:40): [True: 151k, False: 340k]
  |  Branch (6443:56): [True: 273k, False: 67.1k]
  |  Branch (6443:73): [True: 49.5k, False: 17.5k]
  ------------------
 6444|   473k|                  if constexpr (counts::n_object > 0) {
 6445|   473k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6446|   473k|                                                                                                     end);
 6447|   473k|                     return;
 6448|   473k|                  }
 6449|   473k|               }
 6450|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6451|   492k|               return;
 6452|      6|            case '%':
  ------------------
  |  Branch (6452:13): [True: 6, False: 2.61M]
  ------------------
 6453|       |               // Reserved directive indicator is not a plain scalar start.
 6454|      6|               ctx.error = error_code::syntax_error;
 6455|      6|               return;
 6456|  18.9k|            case '"':
  ------------------
  |  Branch (6456:13): [True: 18.9k, False: 2.59M]
  ------------------
 6457|  20.5k|            case '\'':
  ------------------
  |  Branch (6457:13): [True: 1.57k, False: 2.61M]
  ------------------
 6458|       |               // Could be a quoted string OR a quoted key in a block mapping
 6459|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6460|  20.5k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6461|  20.5k|               return;
 6462|  41.7k|            case 't':
  ------------------
  |  Branch (6462:13): [True: 41.7k, False: 2.56M]
  ------------------
 6463|  89.0k|            case 'T':
  ------------------
  |  Branch (6463:13): [True: 47.3k, False: 2.56M]
  ------------------
 6464|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6465|  89.0k|               if constexpr (counts::n_bool > 0) {
 6466|  89.0k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6466:23): [True: 87.1k, False: 1.89k]
  |  Branch (6466:44): [True: 45.1k, False: 42.0k]
  |  Branch (6466:60): [True: 38.9k, False: 6.22k]
  |  Branch (6466:76): [True: 34.0k, False: 4.84k]
  ------------------
 6467|  53.0k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6467:44): [True: 7.95k, False: 45.1k]
  |  Branch (6467:60): [True: 4.86k, False: 3.08k]
  |  Branch (6467:76): [True: 3.01k, False: 1.85k]
  ------------------
 6468|       |                     // Check what follows the word "true"
 6469|  37.0k|                     const auto after_true = it + 4;
 6470|  37.0k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6471|       |
 6472|  37.0k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6472:26): [True: 35.6k, False: 1.42k]
  ------------------
 6473|  35.6k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6473:29): [True: 384, False: 35.2k]
  ------------------
 6474|    384|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|    384|                           return;
 6476|    384|                        }
 6477|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6478|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6479|  35.2k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6479:29): [True: 33.8k, False: 1.40k]
  |  Branch (6479:47): [True: 18.7k, False: 15.1k]
  ------------------
 6480|  18.7k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6480:30): [True: 15.3k, False: 3.36k]
  |  Branch (6480:47): [True: 478, False: 2.89k]
  |  Branch (6480:63): [True: 1.18k, False: 1.70k]
  |  Branch (6480:80): [True: 1.21k, False: 490]
  |  Branch (6480:97): [True: 490, False: 0]
  ------------------
 6481|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6482|  18.7k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6483|  18.7k|                           return;
 6484|  18.7k|                        }
 6485|  16.5k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6486|  16.5k|                                                                                                      end);
 6487|  16.5k|                        return;
 6488|  35.2k|                     }
 6489|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6490|  37.0k|                  }
 6491|  89.0k|               }
 6492|  53.3k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6493|  89.0k|               return;
 6494|  69.8k|            case 'f':
  ------------------
  |  Branch (6494:13): [True: 69.8k, False: 2.54M]
  ------------------
 6495|  74.4k|            case 'F':
  ------------------
  |  Branch (6495:13): [True: 4.58k, False: 2.60M]
  ------------------
 6496|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6497|  74.4k|               if constexpr (counts::n_bool > 0) {
 6498|  74.4k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6498:23): [True: 71.8k, False: 2.63k]
  |  Branch (6498:44): [True: 62.3k, False: 9.45k]
  |  Branch (6498:60): [True: 52.8k, False: 9.54k]
  |  Branch (6498:76): [True: 47.9k, False: 4.89k]
  |  Branch (6498:92): [True: 43.1k, False: 4.84k]
  ------------------
 6499|  43.5k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6499:44): [True: 3.04k, False: 25.6k]
  |  Branch (6499:60): [True: 1.62k, False: 1.42k]
  |  Branch (6499:76): [True: 674, False: 946]
  |  Branch (6499:92): [True: 476, False: 198]
  ------------------
 6500|       |                     // Check what follows the word "false"
 6501|  43.5k|                     const auto after_false = it + 5;
 6502|  43.5k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6503|       |
 6504|  43.5k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6504:26): [True: 37.2k, False: 6.34k]
  ------------------
 6505|  37.2k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6505:29): [True: 286, False: 36.9k]
  ------------------
 6506|    286|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|    286|                           return;
 6508|    286|                        }
 6509|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6510|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6511|  36.9k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6511:29): [True: 34.7k, False: 2.21k]
  |  Branch (6511:47): [True: 30.5k, False: 4.20k]
  ------------------
 6512|  30.5k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6512:30): [True: 7.12k, False: 23.4k]
  |  Branch (6512:47): [True: 3.65k, False: 19.7k]
  |  Branch (6512:63): [True: 1.31k, False: 18.4k]
  |  Branch (6512:80): [True: 16.4k, False: 2.03k]
  |  Branch (6512:97): [True: 2.03k, False: 0]
  ------------------
 6513|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6514|  30.5k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6515|  30.5k|                           return;
 6516|  30.5k|                        }
 6517|  6.42k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6518|  6.42k|                                                                                                      end);
 6519|  6.42k|                        return;
 6520|  36.9k|                     }
 6521|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6522|  43.5k|                  }
 6523|  74.4k|               }
 6524|  37.2k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6525|  74.4k|               return;
 6526|  24.0k|            case 'n':
  ------------------
  |  Branch (6526:13): [True: 24.0k, False: 2.58M]
  ------------------
 6527|  41.7k|            case 'N':
  ------------------
  |  Branch (6527:13): [True: 17.6k, False: 2.59M]
  ------------------
 6528|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6529|  41.7k|               if constexpr (counts::n_null > 0) {
 6530|  41.7k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6530:23): [True: 40.4k, False: 1.25k]
  |  Branch (6530:44): [True: 27.5k, False: 12.9k]
  |  Branch (6530:60): [True: 26.1k, False: 1.36k]
  |  Branch (6530:76): [True: 25.4k, False: 698]
  ------------------
 6531|  31.8k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6531:44): [True: 9.65k, False: 5.34k]
  |  Branch (6531:60): [True: 9.12k, False: 532]
  |  Branch (6531:76): [True: 6.39k, False: 2.73k]
  ------------------
 6532|       |                     // Check what follows the word "null"
 6533|  31.8k|                     const auto after_null = it + 4;
 6534|  31.8k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6535|       |
 6536|  31.8k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6536:26): [True: 28.2k, False: 3.58k]
  ------------------
 6537|  28.2k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6537:29): [True: 12.1k, False: 16.1k]
  ------------------
 6538|  12.1k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|  12.1k|                           return;
 6540|  12.1k|                        }
 6541|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6542|       |                        // "null: value" should parse as {null: value}, not as the null type
 6543|  16.1k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6543:29): [True: 13.9k, False: 2.13k]
  |  Branch (6543:47): [True: 3.15k, False: 10.8k]
  ------------------
 6544|  3.15k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6544:30): [True: 304, False: 2.85k]
  |  Branch (6544:47): [True: 444, False: 2.41k]
  |  Branch (6544:63): [True: 238, False: 2.17k]
  |  Branch (6544:80): [True: 874, False: 1.29k]
  |  Branch (6544:97): [True: 1.29k, False: 0]
  ------------------
 6545|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6546|  3.15k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6547|  3.15k|                           return;
 6548|  3.15k|                        }
 6549|  12.9k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6550|  12.9k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6551|  12.9k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6551:29): [True: 0, False: 12.9k]
  ------------------
 6552|  12.9k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6553|  12.9k|                        return;
 6554|  16.1k|                     }
 6555|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6556|  31.8k|                  }
 6557|  41.7k|               }
 6558|  13.4k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6559|  41.7k|               return;
 6560|  9.63k|            case '~':
  ------------------
  |  Branch (6560:13): [True: 9.63k, False: 2.60M]
  ------------------
 6561|       |               // Null indicator
 6562|  9.63k|               if constexpr (counts::n_null > 0) {
 6563|  9.63k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6564|  9.63k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6565|  9.63k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6565:23): [True: 0, False: 9.63k]
  ------------------
 6566|  9.63k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6567|  9.63k|                  return;
 6568|  9.63k|               }
 6569|      0|               break; // Fall through to try other types
 6570|   272k|            case '-':
  ------------------
  |  Branch (6570:13): [True: 272k, False: 2.33M]
  ------------------
 6571|       |               // Could be negative number or block sequence indicator
 6572|   272k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6572:20): [True: 15.9k, False: 256k]
  |  Branch (6572:41): [True: 211k, False: 44.7k]
  ------------------
 6573|       |                  // Block sequence indicator "- "
 6574|   227k|                  if constexpr (counts::n_array > 0) {
 6575|   227k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6576|   227k|                                                                                                    end);
 6577|   227k|                     return;
 6578|   227k|                  }
 6579|   227k|               }
 6580|   272k|               if constexpr (counts::n_num > 0) {
 6581|   272k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6581:23): [True: 44.7k, False: 227k]
  |  Branch (6581:43): [True: 3.32k, False: 41.4k]
  |  Branch (6581:94): [True: 6.06k, False: 35.3k]
  ------------------
 6582|  9.38k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6583|  9.38k|                     return;
 6584|  9.38k|                  }
 6585|   272k|               }
 6586|   262k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6587|   272k|               return;
 6588|  25.5k|            case '+':
  ------------------
  |  Branch (6588:13): [True: 25.5k, False: 2.58M]
  ------------------
 6589|  66.9k|            case '.':
  ------------------
  |  Branch (6589:13): [True: 41.3k, False: 2.57M]
  ------------------
 6590|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6591|       |               // Try parsing as number speculatively, fall back to string on failure
 6592|  66.9k|               if constexpr (counts::n_num > 0) {
 6593|  66.9k|                  auto start_it = it;
 6594|  66.9k|                  auto temp_ctx = ctx.make_speculative();
 6595|  66.9k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6596|  66.9k|                                                                                               end);
 6597|  66.9k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6598|  66.9k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6599|  66.9k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6599:23): [True: 10.3k, False: 56.6k]
  ------------------
 6600|  10.3k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6601|  10.3k|                     return; // Successfully parsed as number
 6602|  10.3k|                  }
 6603|  56.6k|                  it = start_it; // Restore and fall through to string
 6604|  56.6k|               }
 6605|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6606|  66.9k|               return;
 6607|   394k|            default:
  ------------------
  |  Branch (6607:13): [True: 394k, False: 2.21M]
  ------------------
 6608|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6609|   394k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6609:20): [True: 264k, False: 129k]
  |  Branch (6609:32): [True: 63.3k, False: 201k]
  ------------------
 6610|       |                  // Try block mapping first (e.g., "123key: value")
 6611|  63.3k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6611:23): [True: 11.7k, False: 51.5k]
  ------------------
 6612|  11.7k|                     return;
 6613|  11.7k|                  }
 6614|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6615|  51.5k|                  if constexpr (counts::n_num > 0) {
 6616|  51.5k|                     auto start_it = it;
 6617|  51.5k|                     auto temp_ctx = ctx.make_speculative();
 6618|  51.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6619|  51.5k|                                                                                                  end);
 6620|  51.5k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6621|  51.5k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6622|  51.5k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6622:26): [True: 13.2k, False: 38.2k]
  ------------------
 6623|  13.2k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6624|  13.2k|                        return; // Successfully parsed as number
 6625|  13.2k|                     }
 6626|  38.2k|                     it = start_it; // Restore and fall through to string
 6627|  38.2k|                  }
 6628|       |                  // Fall through to string
 6629|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6630|  51.5k|                  return;
 6631|  63.3k|               }
 6632|       |               // Plain scalar - try block mapping, then string
 6633|   331k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6634|   331k|               return;
 6635|  2.61M|            }
 6636|  2.61M|         }
 6637|       |
 6638|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6639|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6640|       |
 6641|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6642|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6643|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6644|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6645|  2.61M|         error_code expansion_error{};
 6646|  2.61M|         std::string_view expansion_message{};
 6647|       |
 6648|  2.61M|         auto try_parse = [&]<size_t I>() -> bool {
 6649|  2.61M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6650|  2.61M|            auto start = it;
 6651|       |
 6652|  2.61M|            V v{};
 6653|  2.61M|            auto temp_ctx = ctx.make_speculative();
 6654|  2.61M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6655|  2.61M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6656|  2.61M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6657|       |
 6658|  2.61M|            if (!bool(temp_ctx.error)) {
 6659|  2.61M|               value = std::move(v);
 6660|  2.61M|               ctx.anchors = std::move(temp_ctx.anchors);
 6661|  2.61M|               return true;
 6662|  2.61M|            }
 6663|       |
 6664|  2.61M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6665|  2.61M|               expansion_error = temp_ctx.error;
 6666|  2.61M|               expansion_message = temp_ctx.custom_error_message;
 6667|  2.61M|            }
 6668|  2.61M|            it = start;
 6669|  2.61M|            return false;
 6670|  2.61M|         };
 6671|       |
 6672|  2.61M|         bool parsed = false;
 6673|  2.61M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6674|  2.61M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6675|  2.61M|         }(std::make_index_sequence<N>{});
 6676|       |
 6677|  2.61M|         if (!parsed) {
  ------------------
  |  Branch (6677:14): [True: 0, False: 2.61M]
  ------------------
 6678|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6678:17): [True: 0, False: 0]
  ------------------
 6679|      0|               ctx.error = expansion_error;
 6680|      0|               ctx.custom_error_message = expansion_message;
 6681|      0|            }
 6682|      0|            else {
 6683|      0|               ctx.error = error_code::no_matching_variant_type;
 6684|      0|            }
 6685|      0|         }
 6686|  2.61M|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|  1.06M|      {
 5284|  1.06M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|  1.06M|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|  1.06M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|  1.06M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|  1.06M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 1.06M, False: 0]
  ------------------
 5294|  1.06M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|  1.06M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4593|  1.06M|      {
 4594|  1.06M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4594:14): [True: 0, False: 1.06M]
  ------------------
 4595|      0|            return;
 4596|       |
 4597|  1.06M|         yaml::node_preamble_state preamble{};
 4598|  1.06M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4598:14): [True: 3.20k, False: 1.05M]
  ------------------
 4599|  1.06M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4600|  3.20k|            return;
 4601|       |
 4602|  1.05M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4603|  1.05M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4604|       |
 4605|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4606|       |         // value of a key that existed before the read and adds new keys, while
 4607|       |         // pre-existing keys the document does not mention are preserved (like a
 4608|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4609|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4610|       |         // mappings disallow duplicate keys and the conformance suite expects
 4611|       |         // first-wins, which falls out of emplace into an empty map. Any
 4612|       |         // pre-existing entry the document leaves untouched is restored on scope
 4613|       |         // exit (including error paths). When the target starts empty (the common
 4614|       |         // case) this is a no-op with negligible cost.
 4615|  1.05M|         std::remove_cvref_t<T> preexisting_entries;
 4616|  1.05M|         if (!value.empty()) {
  ------------------
  |  Branch (4616:14): [True: 0, False: 1.05M]
  ------------------
 4617|      0|            preexisting_entries = std::move(value);
 4618|      0|            value.clear();
 4619|      0|         }
 4620|  1.05M|         struct merge_restore_guard
 4621|  1.05M|         {
 4622|  1.05M|            std::remove_cvref_t<T>& target;
 4623|  1.05M|            std::remove_cvref_t<T>& saved;
 4624|  1.05M|            ~merge_restore_guard()
 4625|  1.05M|            {
 4626|       |               // emplace is a no-op for keys the document already wrote, so only
 4627|       |               // untouched pre-existing entries are put back.
 4628|  1.05M|               for (auto& entry : saved) {
 4629|  1.05M|                  target.emplace(entry.first, std::move(entry.second));
 4630|  1.05M|               }
 4631|  1.05M|            }
 4632|  1.05M|         } merge_restore{value, preexisting_entries};
 4633|       |
 4634|  1.05M|         const bool treat_as_block_mapping =
 4635|  1.05M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4635:13): [True: 1.05M, Folded]
  |  Branch (4635:48): [True: 152k, False: 906k]
  |  Branch (4635:62): [True: 3.46k, False: 149k]
  ------------------
 4636|       |
 4637|  1.05M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4637:14): [True: 152k, False: 906k]
  |  Branch (4637:28): [True: 149k, False: 3.46k]
  ------------------
 4638|       |            // Flow mapping
 4639|   149k|            ++it;
 4640|       |            // Skip whitespace and newlines after opening brace
 4641|   149k|            yaml::skip_ws_and_newlines(it, end);
 4642|       |
 4643|   149k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4643:17): [True: 148k, False: 904]
  |  Branch (4643:30): [True: 8.43k, False: 139k]
  ------------------
 4644|  8.43k|               ++it;
 4645|  8.43k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4646|  8.43k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4646:20): [True: 6, False: 8.43k]
  ------------------
 4647|      6|                  return;
 4648|  8.43k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4649|  8.43k|               return;
 4650|  8.43k|            }
 4651|       |
 4652|   357k|            while (it != end) {
  ------------------
  |  Branch (4652:20): [True: 349k, False: 8.27k]
  ------------------
 4653|       |               // Skip whitespace and newlines at start of each iteration
 4654|   349k|               yaml::skip_ws_and_newlines(it, end);
 4655|       |
 4656|   349k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4656:20): [True: 349k, False: 0]
  |  Branch (4656:33): [True: 23.2k, False: 325k]
  ------------------
 4657|  23.2k|                  ++it;
 4658|  23.2k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4659|  23.2k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4659:23): [True: 6, False: 23.2k]
  ------------------
 4660|      6|                     return;
 4661|  23.2k|                  break;
 4662|  23.2k|               }
 4663|       |
 4664|   325k|               bool explicit_flow_key = false;
 4665|   325k|               auto explicit_probe = it;
 4666|   325k|               yaml::skip_inline_ws(explicit_probe, end);
 4667|   325k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4667:20): [True: 325k, False: 0]
  |  Branch (4667:45): [True: 10.6k, False: 315k]
  ------------------
 4668|  10.6k|                  const auto after_q = explicit_probe + 1;
 4669|  10.6k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4669:23): [True: 12, False: 10.6k]
  |  Branch (4669:41): [True: 5.76k, False: 4.85k]
  ------------------
 4670|  6.91k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4670:23): [True: 750, False: 4.10k]
  |  Branch (4670:42): [True: 390, False: 3.71k]
  ------------------
 4671|  6.91k|                     explicit_flow_key = true;
 4672|  6.91k|                     it = explicit_probe + 1;
 4673|  6.91k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4674|  6.91k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4674:26): [True: 6, False: 6.90k]
  ------------------
 4675|      6|                        return;
 4676|  6.91k|                  }
 4677|  10.6k|               }
 4678|       |               // Parse key
 4679|   325k|               key_t key{};
 4680|   325k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4681|   325k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4681:23): [True: 6.90k, False: 319k]
  |  Branch (4681:44): [True: 6.89k, False: 14]
  |  Branch (4681:58): [True: 1.01k, False: 5.87k]
  |  Branch (4681:72): [True: 1.52k, False: 4.35k]
  |  Branch (4681:86): [True: 726, False: 3.62k]
  ------------------
 4682|  3.26k|                     key.clear();
 4683|  3.26k|                  }
 4684|   322k|                  else {
 4685|   322k|                     auto key_probe = it;
 4686|   322k|                     yaml::skip_inline_ws(key_probe, end);
 4687|       |
 4688|       |                     // Use full node parsing only for structurally complex flow keys.
 4689|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4690|   322k|                     bool parse_complex_flow_key = false;
 4691|   322k|                     if (key_probe != end) {
  ------------------
  |  Branch (4691:26): [True: 322k, False: 14]
  ------------------
 4692|   322k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4692:29): [True: 1.19k, False: 321k]
  |  Branch (4692:50): [True: 5.97k, False: 315k]
  ------------------
 4693|  7.16k|                           parse_complex_flow_key = true;
 4694|  7.16k|                        }
 4695|   315k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4695:34): [True: 75.3k, False: 240k]
  ------------------
 4696|  75.3k|                           ++key_probe;
 4697|  75.3k|                           yaml::parse_anchor_name(key_probe, end);
 4698|  75.3k|                           yaml::skip_inline_ws(key_probe, end);
 4699|  75.3k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4699:32): [True: 75.2k, False: 44]
  |  Branch (4699:53): [True: 262, False: 75.0k]
  |  Branch (4699:74): [True: 35.8k, False: 39.1k]
  ------------------
 4700|  36.1k|                              parse_complex_flow_key = true;
 4701|  36.1k|                           }
 4702|  75.3k|                        }
 4703|   322k|                     }
 4704|       |
 4705|   322k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4705:26): [True: 43.3k, False: 279k]
  ------------------
 4706|  43.3k|                        glz::generic key_node{};
 4707|  43.3k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4708|  43.3k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4708:29): [True: 2.15k, False: 41.1k]
  ------------------
 4709|  2.15k|                           return;
 4710|  41.1k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4710:29): [True: 6, False: 41.1k]
  ------------------
 4711|      6|                           return;
 4712|  41.1k|                     }
 4713|   279k|                     else {
 4714|   279k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4714:29): [True: 19.9k, False: 259k]
  ------------------
 4715|  19.9k|                           return;
 4716|  19.9k|                        }
 4717|   279k|                     }
 4718|   322k|                  }
 4719|       |               }
 4720|       |               else {
 4721|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4722|       |                     ctx.error = error_code::syntax_error;
 4723|       |                     return;
 4724|       |                  }
 4725|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4726|       |                  if (bool(ctx.error)) [[unlikely]]
 4727|       |                     return;
 4728|       |               }
 4729|       |
 4730|       |               // Separation between flow key and ':' may include comments/newlines.
 4731|       |               // In flow context, newlines are allowed between key and ':'.
 4732|   303k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4733|   325k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4733:20): [True: 6, False: 325k]
  ------------------
 4734|      6|                  return;
 4735|       |
 4736|   325k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4737|   325k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4738|   325k|                     val = {};
 4739|   325k|                     return true;
 4740|   325k|                  }
 4741|   325k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4742|   325k|                     val = glz::generic{};
 4743|   325k|                     return true;
 4744|   325k|                  }
 4745|   325k|                  else {
 4746|   325k|                     static constexpr std::string_view null_value{"null"};
 4747|   325k|                     auto null_it = null_value.data();
 4748|   325k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4749|   325k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4750|   325k|                     return !bool(ctx.error);
 4751|   325k|                  }
 4752|   325k|               };
 4753|       |
 4754|   325k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4754:20): [True: 303k, False: 22.2k]
  |  Branch (4754:34): [True: 127k, False: 176k]
  |  Branch (4754:48): [True: 39.5k, False: 136k]
  ------------------
 4755|   167k|                  val_t val{};
 4756|   167k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4756:23): [True: 0, False: 167k]
  ------------------
 4757|      0|                     return;
 4758|       |
 4759|   167k|                  value.emplace(std::move(key), std::move(val));
 4760|       |
 4761|   167k|                  if (*it == '}') {
  ------------------
  |  Branch (4761:23): [True: 39.5k, False: 127k]
  ------------------
 4762|  39.5k|                     ++it;
 4763|  39.5k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4764|  39.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4764:26): [True: 6, False: 39.5k]
  ------------------
 4765|      6|                        return;
 4766|  39.5k|                     break;
 4767|  39.5k|                  }
 4768|       |
 4769|   127k|                  ++it; // skip comma
 4770|   127k|                  yaml::skip_ws_and_newlines(it, end);
 4771|   127k|                  continue;
 4772|   167k|               }
 4773|       |
 4774|   158k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4774:20): [True: 22.2k, False: 136k]
  |  Branch (4774:33): [True: 68, False: 136k]
  ------------------
 4775|    172|                  ctx.error = error_code::syntax_error;
 4776|    172|                  return;
 4777|    172|               }
 4778|   158k|               ++it;
 4779|       |
 4780|   158k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4781|   158k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4781:20): [True: 6, False: 158k]
  ------------------
 4782|      6|                  return;
 4783|       |
 4784|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4785|   158k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4785:20): [True: 136k, False: 22.1k]
  |  Branch (4785:34): [True: 12.3k, False: 124k]
  |  Branch (4785:48): [True: 9.82k, False: 114k]
  ------------------
 4786|  22.2k|                  val_t val{};
 4787|  22.2k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4787:23): [True: 0, False: 22.2k]
  ------------------
 4788|      0|                     return;
 4789|       |
 4790|  22.2k|                  value.emplace(std::move(key), std::move(val));
 4791|       |
 4792|  22.2k|                  if (*it == '}') {
  ------------------
  |  Branch (4792:23): [True: 9.82k, False: 12.3k]
  ------------------
 4793|  9.82k|                     ++it;
 4794|  9.82k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4795|  9.82k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4795:26): [True: 6, False: 9.81k]
  ------------------
 4796|      6|                        return;
 4797|  9.81k|                     break;
 4798|  9.82k|                  }
 4799|       |
 4800|  12.3k|                  ++it; // skip comma
 4801|  12.3k|                  yaml::skip_ws_and_newlines(it, end);
 4802|  12.3k|                  continue;
 4803|  22.2k|               }
 4804|       |
 4805|       |               // Parse value
 4806|   136k|               val_t val{};
 4807|   136k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4808|   136k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 1.45k, False: 134k]
  ------------------
 4809|  1.45k|                  return;
 4810|       |
 4811|   134k|               value.emplace(std::move(key), std::move(val));
 4812|       |
 4813|   134k|               yaml::skip_inline_ws(it, end);
 4814|       |
 4815|   134k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4815:20): [True: 112k, False: 22.1k]
  |  Branch (4815:33): [True: 34.0k, False: 78.7k]
  ------------------
 4816|  34.0k|                  ++it;
 4817|  34.0k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4818|  34.0k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4818:23): [True: 8, False: 34.0k]
  ------------------
 4819|      8|                     return;
 4820|  34.0k|                  break;
 4821|  34.0k|               }
 4822|   100k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4822:25): [True: 78.7k, False: 22.1k]
  |  Branch (4822:38): [True: 67.0k, False: 11.7k]
  ------------------
 4823|  67.0k|                  ++it;
 4824|       |                  // Skip whitespace and newlines after comma
 4825|  67.0k|                  yaml::skip_ws_and_newlines(it, end);
 4826|  67.0k|               }
 4827|  33.8k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4827:25): [True: 11.7k, False: 22.1k]
  |  Branch (4827:39): [True: 3.62k, False: 8.09k]
  |  Branch (4827:54): [True: 8.05k, False: 38]
  ------------------
 4828|       |                  // Newlines may precede either the closing brace or the
 4829|       |                  // separator comma for the next entry.
 4830|  11.6k|                  yaml::skip_ws_and_newlines(it, end);
 4831|  11.6k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4831:23): [True: 11.6k, False: 12]
  |  Branch (4831:36): [True: 1.84k, False: 9.81k]
  ------------------
 4832|  1.84k|                     ++it;
 4833|  1.84k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4834|  1.84k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4834:26): [True: 6, False: 1.84k]
  ------------------
 4835|      6|                        return;
 4836|  1.84k|                     break;
 4837|  1.84k|                  }
 4838|  9.83k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4838:23): [True: 9.81k, False: 12]
  |  Branch (4838:36): [True: 9.80k, False: 12]
  ------------------
 4839|  9.80k|                     ++it;
 4840|  9.80k|                     yaml::skip_ws_and_newlines(it, end);
 4841|  9.80k|                     continue;
 4842|  9.80k|                  }
 4843|     24|                  ctx.error = error_code::syntax_error;
 4844|     24|                  return;
 4845|  9.83k|               }
 4846|  22.1k|               else {
 4847|  22.1k|                  ctx.error = error_code::syntax_error;
 4848|  22.1k|                  return;
 4849|  22.1k|               }
 4850|   134k|            }
 4851|   140k|         }
 4852|   910k|         else {
 4853|       |            // Block mapping - use shared loop with map-specific callback
 4854|   910k|            yaml::parse_block_mapping_loop<Opts>(
 4855|   910k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4856|   910k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|   910k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4858|   910k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   910k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   910k|                           if (ctx.stream_begin) {
 4866|   910k|                              auto is_line_content_start = [&](auto pos) {
 4867|   910k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   910k|                              };
 4869|       |
 4870|   910k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   910k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   910k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   910k|                                 return line != end && *line == ':';
 4874|   910k|                              };
 4875|       |
 4876|   910k|                              if (!is_line_content_start(it) &&
 4877|   910k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4878|   910k|                                  !line_has_explicit_value_indicator(it)) {
 4879|   910k|                                 ctx.error = error_code::syntax_error;
 4880|   910k|                                 return false;
 4881|   910k|                              }
 4882|   910k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   910k|                           }
 4884|   910k|                        }
 4885|       |
 4886|   910k|                        if (*it == '-' &&
 4887|   910k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4888|   910k|                            !line_starts_with_explicit_value_indicator) {
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|   910k|                           ctx.error = error_code::syntax_error;
 4891|   910k|                           return false;
 4892|   910k|                        }
 4893|       |
 4894|   910k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4895|   910k|                           return false;
 4896|   910k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   910k|                        ctx.pop_indent();
 4898|   910k|                     }
 4899|   910k|                     else {
 4900|   910k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|   910k|                        if (nested_indent >= 0) {
 4902|   910k|                           yaml::skip_to_content(it, end);
 4903|   910k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4904|   910k|                              ctx.error = error_code::syntax_error;
 4905|   910k|                              return false;
 4906|   910k|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|   910k|                           const int32_t value_indent =
 4910|   910k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4911|   910k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4912|   910k|                              return false;
 4913|   910k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|   910k|                           ctx.pop_indent();
 4915|   910k|                        }
 4916|   910k|                     }
 4917|   910k|                     return !bool(ctx.error);
 4918|   910k|                  };
 4919|       |
 4920|       |                  // Explicit key entry form:
 4921|       |                  // ? key
 4922|       |                  // : value
 4923|   910k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4924|   910k|                     ctx.error = error_code::syntax_error;
 4925|   910k|                     return false;
 4926|   910k|                  }
 4927|   910k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4928|   910k|                     ++it; // skip '?'
 4929|   910k|                     yaml::skip_inline_ws(it, end);
 4930|       |
 4931|   910k|                     const int32_t explicit_value_indicator_indent =
 4932|   910k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4933|       |
 4934|   910k|                     key_t key{};
 4935|   910k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4936|   910k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   910k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   910k|                        };
 4939|       |
 4940|   910k|                        auto key_it = it;
 4941|   910k|                        yaml::skip_inline_ws(key_it, end);
 4942|       |
 4943|   910k|                        auto content = key_it;
 4944|   910k|                        yaml::skip_to_content(content, end);
 4945|   910k|                        bool handled_anchor_only_empty_key = false;
 4946|       |
 4947|       |                        // Anchor on an empty explicit key node:
 4948|       |                        //   ? &a
 4949|       |                        //   : value
 4950|   910k|                        if (content != end && *content == '&') {
 4951|   910k|                           auto anchor_probe = content + 1;
 4952|   910k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4953|   910k|                           if (!anchor_name.empty()) {
 4954|   910k|                              auto after_anchor = anchor_probe;
 4955|   910k|                              yaml::skip_inline_ws(after_anchor, end);
 4956|       |
 4957|   910k|                              auto value_indicator = after_anchor;
 4958|   910k|                              if (value_indicator != end && *value_indicator == ':') {
 4959|   910k|                                 key.clear();
 4960|   910k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4961|   910k|                                 it = value_indicator;
 4962|   910k|                                 handled_anchor_only_empty_key = true;
 4963|   910k|                              }
 4964|   910k|                              else {
 4965|   910k|                                 if (value_indicator != end && *value_indicator == '#') {
 4966|   910k|                                    yaml::skip_comment(value_indicator, end);
 4967|   910k|                                 }
 4968|   910k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4969|   910k|                                    yaml::skip_newline(value_indicator, end);
 4970|   910k|                                    auto value_line = value_indicator;
 4971|   910k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4972|   910k|                                    if (bool(ctx.error)) [[unlikely]]
 4973|   910k|                                       return false;
 4974|   910k|                                    if (value_line != end && *value_line == ':' &&
 4975|   910k|                                        value_indent == explicit_value_indicator_indent) {
 4976|   910k|                                       key.clear();
 4977|   910k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4978|   910k|                                       it = value_line;
 4979|   910k|                                       handled_anchor_only_empty_key = true;
 4980|   910k|                                    }
 4981|   910k|                                    else if (value_line != end && *value_line == ':') {
 4982|       |                                       // In explicit-key form ("? &a"), a following ':'
 4983|       |                                       // starts the outer value indicator only at the same
 4984|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4985|   910k|                                       ctx.error = error_code::syntax_error;
 4986|   910k|                                       return false;
 4987|   910k|                                    }
 4988|   910k|                                 }
 4989|   910k|                              }
 4990|   910k|                           }
 4991|   910k|                        }
 4992|       |
 4993|   910k|                        const bool key_content_spans_lines = [&] {
 4994|   910k|                           auto scan = key_it;
 4995|   910k|                           while (scan != content && scan != end) {
 4996|   910k|                              if (*scan == '\n' || *scan == '\r') return true;
 4997|   910k|                              ++scan;
 4998|   910k|                           }
 4999|   910k|                           return false;
 5000|   910k|                        }();
 5001|       |
 5002|   910k|                        if (handled_anchor_only_empty_key) {
 5003|       |                           // 'it' already points to the explicit value indicator ':'
 5004|   910k|                        }
 5005|   910k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5006|   910k|                           key.clear();
 5007|   910k|                           it = content;
 5008|   910k|                        }
 5009|   910k|                        else {
 5010|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5011|       |                           // Parse the key node structurally (not via plain-key scanning)
 5012|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5013|       |                           // as complex keys, not split into implicit key/value pairs.
 5014|   910k|                           auto key_node_it = content;
 5015|   910k|                           auto key_node_end = end;
 5016|   910k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5017|       |                              // In explicit-key form, a following standalone ':'
 5018|       |                              // line (same or lower indentation) belongs to the
 5019|       |                              // outer mapping value, not the key node itself.
 5020|   910k|                              auto scan = content;
 5021|   910k|                              while (scan != end) {
 5022|   910k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5023|   910k|                                    ++scan;
 5024|   910k|                                 }
 5025|   910k|                                 if (scan == end) {
 5026|   910k|                                    break;
 5027|   910k|                                 }
 5028|       |
 5029|   910k|                                 yaml::skip_newline(scan, end);
 5030|   910k|                                 auto line_start = scan;
 5031|       |
 5032|   910k|                                 int32_t indicator_indent = 0;
 5033|   910k|                                 while (scan != end && *scan == ' ') {
 5034|   910k|                                    ++indicator_indent;
 5035|   910k|                                    ++scan;
 5036|   910k|                                 }
 5037|       |
 5038|   910k|                                 if (scan != end && *scan == ':') {
 5039|   910k|                                    const auto after_colon = scan + 1;
 5040|   910k|                                    if ((after_colon == end ||
 5041|   910k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5042|   910k|                                        indicator_indent <= line_indent) {
 5043|   910k|                                       key_node_end = line_start;
 5044|   910k|                                       break;
 5045|   910k|                                    }
 5046|   910k|                                 }
 5047|   910k|                              }
 5048|   910k|                           }
 5049|       |
 5050|   910k|                           glz::generic key_node{};
 5051|   910k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5052|   910k|                           ctx.explicit_mapping_key_context = true;
 5053|   910k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5054|   910k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5055|   910k|                           if (bool(ctx.error)) [[unlikely]]
 5056|   910k|                              return false;
 5057|   910k|                           it = key_node_it;
 5058|   910k|                           if (!to_string_key(key_node)) [[unlikely]]
 5059|   910k|                              return false;
 5060|   910k|                        }
 5061|   910k|                     }
 5062|   910k|                     else {
 5063|   910k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5064|   910k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5065|   910k|                           if (bool(ctx.error)) [[unlikely]]
 5066|   910k|                              return false;
 5067|   910k|                        }
 5068|   910k|                     }
 5069|       |
 5070|   910k|                     yaml::skip_inline_ws(it, end);
 5071|   910k|                     yaml::skip_comment(it, end);
 5072|       |
 5073|       |                     // Value indicator may appear on the next line at the same indent.
 5074|   910k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5075|   910k|                        auto probe = it;
 5076|   910k|                        bool found_value_indicator = false;
 5077|       |
 5078|   910k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5079|   910k|                           yaml::skip_newline(probe, end);
 5080|       |
 5081|   910k|                           auto value_line = probe;
 5082|   910k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5083|   910k|                           if (bool(ctx.error)) [[unlikely]]
 5084|   910k|                              return false;
 5085|       |
 5086|   910k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5087|   910k|                              probe = value_line;
 5088|   910k|                              continue; // blank line
 5089|   910k|                           }
 5090|   910k|                           if (*value_line == '#') {
 5091|   910k|                              yaml::skip_comment(value_line, end);
 5092|   910k|                              probe = value_line;
 5093|   910k|                              continue; // comment-only line
 5094|   910k|                           }
 5095|   910k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5096|   910k|                              it = value_line;
 5097|   910k|                              found_value_indicator = true;
 5098|   910k|                           }
 5099|   910k|                           break;
 5100|   910k|                        }
 5101|       |
 5102|   910k|                        if (found_value_indicator) {
 5103|   910k|                           yaml::skip_inline_ws(it, end);
 5104|   910k|                        }
 5105|   910k|                     }
 5106|       |
 5107|   910k|                     val_t val{};
 5108|   910k|                     if (it != end && *it == ':') {
 5109|   910k|                        ++it;
 5110|   910k|                        if (it != end && *it == '\t') {
 5111|   910k|                           ctx.error = error_code::syntax_error;
 5112|   910k|                           return false;
 5113|   910k|                        }
 5114|   910k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5115|   910k|                           auto probe = it;
 5116|   910k|                           yaml::skip_newline(probe, end);
 5117|   910k|                           while (probe != end && *probe == ' ') ++probe;
 5118|   910k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5119|   910k|                              ctx.error = error_code::syntax_error;
 5120|   910k|                              return false;
 5121|   910k|                           }
 5122|   910k|                        }
 5123|   910k|                        yaml::skip_inline_ws(it, end);
 5124|   910k|                        if (!parse_map_value(val)) [[unlikely]]
 5125|   910k|                           return false;
 5126|   910k|                     }
 5127|       |
 5128|   910k|                     value.emplace(std::move(key), std::move(val));
 5129|   910k|                     return true;
 5130|   910k|                  }
 5131|       |
 5132|   910k|                  key_t key{};
 5133|   910k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5134|   910k|                     auto key_probe = it;
 5135|   910k|                     yaml::skip_inline_ws(key_probe, end);
 5136|   910k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5137|   910k|                     if (complex_flow_key) {
 5138|   910k|                        glz::generic key_node{};
 5139|   910k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5140|   910k|                        if (bool(ctx.error)) [[unlikely]]
 5141|   910k|                           return false;
 5142|   910k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5143|   910k|                           return false;
 5144|   910k|                     }
 5145|   910k|                     else {
 5146|   910k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5147|   910k|                           return false;
 5148|   910k|                        }
 5149|   910k|                     }
 5150|   910k|                  }
 5151|   910k|                  else {
 5152|   910k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5153|   910k|                     if (bool(ctx.error)) [[unlikely]]
 5154|   910k|                        return false;
 5155|   910k|                  }
 5156|       |
 5157|   910k|                  yaml::skip_inline_ws(it, end);
 5158|       |
 5159|   910k|                  if (it == end || *it != ':') {
 5160|   910k|                     ctx.error = error_code::syntax_error;
 5161|   910k|                     return false;
 5162|   910k|                  }
 5163|   910k|                  ++it;
 5164|   910k|                  yaml::skip_inline_ws(it, end);
 5165|       |
 5166|   910k|                  val_t val{};
 5167|   910k|                  if (!parse_map_value(val)) [[unlikely]]
 5168|   910k|                     return false;
 5169|       |
 5170|   910k|                  value.emplace(std::move(key), std::move(val));
 5171|   910k|                  return true;
 5172|   910k|               });
 5173|   910k|         }
 5174|       |
 5175|  1.02M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5176|  1.02M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  1.06M|      {
  466|  1.06M|         skip_inline_ws(it, end);
  467|       |
  468|  1.06M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 1.06M]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|  1.06M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.06M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 1.06M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  1.06M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 1.06M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  1.06M|         skip_inline_ws(it, end);
  486|       |
  487|  1.06M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 1.06M]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  1.06M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.18k, False: 1.05M]
  ------------------
  495|  3.18k|            return true;
  496|  3.18k|         }
  497|       |
  498|  1.05M|         return false;
  499|  1.06M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4599|  1.06M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  1.06M|      {
  409|  1.06M|         state.has_anchor = false;
  410|  1.06M|         state.anchor_name.clear();
  411|  1.06M|         state.anchor_start = nullptr;
  412|  1.06M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.06M|         if constexpr (Policy.allow_alias) {
  415|  1.06M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  1.06M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 1.04M, False: 14.4k]
  ------------------
  417|  1.04M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 3.15k, False: 1.04M]
  ------------------
  418|  1.04M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  1.06M|         }
  424|       |
  425|  1.06M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.05M, False: 3.15k]
  |  Branch (425:27): [True: 27.3k, False: 1.03M]
  ------------------
  426|  27.3k|            ++it;
  427|  27.3k|            auto name = parse_anchor_name(it, end);
  428|  27.3k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 20, False: 27.3k]
  ------------------
  429|     20|               ctx.error = error_code::syntax_error;
  430|     20|               return true;
  431|     20|            }
  432|  27.3k|            skip_inline_ws(it, end);
  433|  27.3k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 14, False: 27.3k]
  ------------------
  434|     14|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     14|                  ctx.error = error_code::unexpected_end;
  436|     14|               }
  437|     14|               return true;
  438|     14|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  27.3k|            state.has_anchor = true;
  446|  27.3k|            state.anchor_name = std::string(name);
  447|  27.3k|            state.anchor_start = &*it;
  448|  27.3k|         }
  449|       |
  450|  1.06M|         return false;
  451|  1.06M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  1.04M|      {
  301|  1.04M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.04M]
  |  Branch (301:27): [True: 1.04M, False: 3.15k]
  ------------------
  302|       |
  303|  3.15k|         ++it; // skip '*'
  304|  3.15k|         auto name = parse_anchor_name(it, end);
  305|  3.15k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 18, False: 3.13k]
  ------------------
  306|     18|            ctx.error = error_code::syntax_error;
  307|     18|            return true;
  308|     18|         }
  309|       |
  310|  3.13k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.13k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 52, False: 3.08k]
  ------------------
  312|     52|            ctx.error = error_code::syntax_error; // undefined alias
  313|     52|            return true;
  314|     52|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  3.08k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.08k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 254, False: 2.82k]
  ------------------
  322|    254|            return true;
  323|    254|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  2.82k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 60, False: 2.76k]
  ------------------
  329|     60|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     60|            return true;
  331|     60|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  2.76k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.76k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 14, False: 2.75k]
  ------------------
  339|     14|            return true;
  340|       |
  341|  2.75k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.75k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  2.75k|         auto replay_it = span.begin;
  348|  2.75k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.75k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.75k|         ctx.indent_stack.clear();
  353|  2.75k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 952, False: 1.80k]
  ------------------
  354|    952|            ctx.push_indent(span.base_indent - 1);
  355|    952|         }
  356|       |
  357|  2.75k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.75k|         using V = std::remove_cvref_t<T>;
  360|  2.75k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.75k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.75k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.75k|         return true;
  367|  2.75k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4736|   189k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4737|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4738|       |                     val = {};
 4739|       |                     return true;
 4740|       |                  }
 4741|   189k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4742|   189k|                     val = glz::generic{};
 4743|   189k|                     return true;
 4744|       |                  }
 4745|       |                  else {
 4746|       |                     static constexpr std::string_view null_value{"null"};
 4747|       |                     auto null_it = null_value.data();
 4748|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4749|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4750|       |                     return !bool(ctx.error);
 4751|       |                  }
 4752|   189k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|   910k|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|   910k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 910k]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|   910k|         const int32_t parent_indent = ctx.current_indent();
 3722|   910k|         const bool discover_indent = (mapping_indent < 0);
 3723|   910k|         bool first_key = !discover_indent;
 3724|   910k|         bool discovered_first_key_mid_line = false;
 3725|   910k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|  2.09M|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 1.51M, False: 577k]
  ------------------
 3728|  1.51M|            auto line_start = it;
 3729|  1.51M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 1.51M]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|  2.04M|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 1.99M, False: 43.9k]
  ------------------
 3733|  1.99M|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 84.3k, False: 1.91M]
  ------------------
 3734|  84.3k|                  skip_comment(it, end);
 3735|  84.3k|                  skip_newline(it, end);
 3736|  84.3k|                  first_key = false;
 3737|  84.3k|                  line_indent = 0;
 3738|  84.3k|               }
 3739|  1.91M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 275k, False: 1.63M]
  |  Branch (3739:40): [True: 93.1k, False: 1.54M]
  ------------------
 3740|   368k|                  skip_newline(it, end);
 3741|   368k|                  first_key = false;
 3742|   368k|                  line_indent = 0;
 3743|   368k|               }
 3744|  1.54M|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 160k, False: 1.38M]
  ------------------
 3745|   160k|                  line_start = it;
 3746|   160k|                  line_indent = 0;
 3747|   542k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 530k, False: 12.3k]
  |  Branch (3747:39): [True: 382k, False: 147k]
  ------------------
 3748|   382k|                     ++line_indent;
 3749|   382k|                     ++it;
 3750|   382k|                  }
 3751|       |
 3752|   160k|                  bool saw_tab = false;
 3753|   174k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 159k, False: 14.9k]
  |  Branch (3753:40): [True: 2.84k, False: 156k]
  |  Branch (3753:54): [True: 11.1k, False: 145k]
  ------------------
 3754|  14.0k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 7.27k, False: 6.72k]
  |  Branch (3754:43): [True: 6.72k, False: 0]
  ------------------
 3755|  14.0k|                     ++it;
 3756|  14.0k|                  }
 3757|       |
 3758|   160k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 14.9k, False: 145k]
  |  Branch (3758:36): [True: 7.49k, False: 137k]
  |  Branch (3758:51): [True: 7.10k, False: 130k]
  |  Branch (3758:66): [True: 26.5k, False: 103k]
  ------------------
 3759|  56.1k|                     first_key = false;
 3760|  56.1k|                     line_indent = 0;
 3761|  56.1k|                     continue; // Blank or comment line
 3762|  56.1k|                  }
 3763|       |
 3764|   103k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 12, False: 103k]
  ------------------
 3765|     12|                     ctx.error = error_code::syntax_error;
 3766|     12|                     return;
 3767|     12|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   103k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 98.3k, False: 5.61k]
  |  Branch (3770:46): [True: 870, False: 97.4k]
  ------------------
 3771|    870|                     it = line_start;
 3772|    870|                     return;
 3773|    870|                  }
 3774|       |
 3775|   103k|                  first_key = false;
 3776|   103k|                  break; // Found content
 3777|   103k|               }
 3778|  1.38M|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 12.7k, False: 1.37M]
  ------------------
 3779|  12.7k|                  line_start = it;
 3780|  37.8k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 35.8k, False: 1.96k]
  |  Branch (3780:40): [True: 4.33k, False: 31.5k]
  |  Branch (3780:54): [True: 20.7k, False: 10.7k]
  ------------------
 3781|  12.7k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 1.96k, False: 10.7k]
  |  Branch (3781:36): [True: 6.75k, False: 3.97k]
  |  Branch (3781:51): [True: 1.73k, False: 2.24k]
  |  Branch (3781:66): [True: 2.23k, False: 12]
  ------------------
 3782|  12.6k|                     first_key = false;
 3783|  12.6k|                     line_indent = 0;
 3784|  12.6k|                     continue; // Blank or comment-only line with tab indentation
 3785|  12.6k|                  }
 3786|     12|                  ctx.error = error_code::syntax_error;
 3787|     12|                  return;
 3788|  12.7k|               }
 3789|  1.37M|               else {
 3790|  1.37M|                  line_start = it;
 3791|  1.37M|                  break; // Content at column 0
 3792|  1.37M|               }
 3793|  1.99M|            }
 3794|       |
 3795|  1.51M|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 43.9k, False: 1.47M]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|  1.47M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 14.4k, False: 1.46M]
  |  Branch (3799:45): [True: 1.52k, False: 1.45M]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|  1.45M|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 1.45M, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|  1.45M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 1.45M, False: 0]
  |  Branch (3806:39): [True: 550k, False: 908k]
  |  Branch (3806:62): [True: 152k, False: 398k]
  |  Branch (3806:84): [True: 120k, False: 31.9k]
  ------------------
 3807|   120k|                  it = line_start;
 3808|   120k|                  return;
 3809|   120k|               }
 3810|  1.33M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 430k, False: 908k]
  |  Branch (3810:43): [True: 564, False: 429k]
  ------------------
 3811|    564|                  it = line_start;
 3812|    564|                  return;
 3813|    564|               }
 3814|  1.33M|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|  1.33M|            bool established_mapping_indent_this_line = false;
 3818|  1.33M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 908k, False: 429k]
  ------------------
 3819|   908k|               mapping_indent = line_indent;
 3820|   908k|               established_mapping_indent_this_line = true;
 3821|   908k|               discovered_first_key_visual_indent = line_indent;
 3822|   908k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   908k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 908k, False: 0]
  |  Branch (3823:43): [True: 908k, False: 0]
  ------------------
 3824|   908k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   908k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 72, False: 908k]
  ------------------
 3826|     72|                        ctx.error = error_code::syntax_error;
 3827|     72|                        return;
 3828|     72|                     }
 3829|       |
 3830|   908k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   908k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 902k, False: 5.61k]
  |  Branch (3831:49): [True: 693k, False: 209k]
  ------------------
 3832|   693k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   693k|                     }
 3834|   908k|                  }
 3835|   908k|               }
 3836|   908k|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|  1.33M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 1.33M, False: 72]
  |  Branch (3840:36): [True: 1.33M, False: 0]
  |  Branch (3840:59): [True: 429k, False: 908k]
  ------------------
 3841|   429k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 159k, False: 269k]
  ------------------
 3842|   159k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 159k, False: 350]
  |  Branch (3842:43): [True: 18.0k, False: 141k]
  ------------------
 3843|  18.0k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 28, False: 18.0k]
  ------------------
 3844|     28|                     ctx.error = error_code::syntax_error;
 3845|     28|                     return;
 3846|     28|                  }
 3847|  18.0k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 7.69k, False: 10.3k]
  ------------------
 3848|  7.69k|                     it = line_start;
 3849|  7.69k|                     return;
 3850|  7.69k|                  }
 3851|  18.0k|               }
 3852|   141k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 1.25k, False: 140k]
  ------------------
 3853|  1.25k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 46, False: 1.20k]
  |  Branch (3853:47): [True: 6, False: 1.20k]
  ------------------
 3854|  1.20k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 1.20k, False: 0]
  |  Branch (3854:49): [True: 1.20k, False: 0]
  |  Branch (3854:72): [True: 18, False: 1.18k]
  ------------------
 3855|     70|                  ctx.error = error_code::syntax_error;
 3856|     70|                  return;
 3857|     70|               }
 3858|   159k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|  1.33M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 1.33M]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|  1.33M|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 1.33M]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|  1.33M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 72, False: 1.33M]
  |  Branch (3876:32): [True: 0, False: 1.33M]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|  1.33M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 375k, False: 954k]
  |  Branch (3885:53): [True: 71.6k, False: 304k]
  |  Branch (3885:94): [True: 13.5k, False: 58.1k]
  ------------------
 3886|  13.5k|               const auto after_colon = it + 1;
 3887|  13.5k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 8.70k, False: 4.79k]
  ------------------
 3888|  13.5k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 5.38k, False: 8.12k]
  |  Branch (3888:43): [True: 6.43k, False: 1.68k]
  ------------------
 3889|  11.8k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 4.81k, False: 7.00k]
  ------------------
 3890|  4.81k|                  it = line_start;
 3891|  4.81k|                  return;
 3892|  4.81k|               }
 3893|  13.5k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|  1.32M|            int32_t effective_line_indent = line_indent;
 3897|  1.32M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 1.32M, False: 72]
  |  Branch (3897:36): [True: 908k, False: 417k]
  ------------------
 3898|   908k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 693k, False: 215k]
  ------------------
 3899|   693k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 609k, False: 83.4k]
  |  Branch (3899:52): [True: 344k, False: 264k]
  ------------------
 3900|       |               // The first discovered key has no indentation of its own left to measure: it may
 3901|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3902|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3903|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3904|       |               // key with an empty value takes the following sibling line for nested content
 3905|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3906|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3907|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3908|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3909|       |               // 7FWL and HMQ5 pin that case.
 3910|   348k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   348k|            }
 3912|       |
 3913|  1.32M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 137k, False: 1.18M]
  ------------------
 3914|   137k|               return;
 3915|   137k|            }
 3916|  1.18M|            first_key = false;
 3917|       |
 3918|  1.18M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 1.18M]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|       |               auto flow_end = it;
 3925|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|       |               if (bool(ctx.error)) [[unlikely]]
 3927|       |                  return;
 3928|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3929|       |                  it = flow_end;
 3930|       |                  return;
 3931|       |               }
 3932|       |            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|  1.18M|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 705k, False: 481k]
  ------------------
 3938|   705k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 88.6k, False: 617k]
  |  Branch (3938:34): [True: 9.82k, False: 607k]
  ------------------
 3939|  98.4k|                  auto peek = it;
 3940|  98.4k|                  skip_inline_ws(peek, end);
 3941|  98.4k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 70.9k, False: 27.4k]
  |  Branch (3941:38): [True: 57.4k, False: 13.5k]
  |  Branch (3941:55): [True: 54.0k, False: 3.37k]
  |  Branch (3941:72): [True: 51.1k, False: 2.97k]
  ------------------
 3942|  51.1k|                     continue; // At leading indent of new line
 3943|  51.1k|                  }
 3944|  98.4k|               }
 3945|   654k|               skip_inline_ws(it, end);
 3946|   654k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 627k, False: 27.4k]
  |  Branch (3946:33): [True: 26.2k, False: 600k]
  ------------------
 3947|  26.2k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  26.2k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 26.2k, False: 0]
  ------------------
 3949|  26.2k|                        const char prev = *(it - 1);
 3950|  26.2k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 11.6k, False: 14.5k]
  |  Branch (3950:44): [True: 5.71k, False: 5.96k]
  |  Branch (3950:60): [True: 3.33k, False: 2.38k]
  |  Branch (3950:76): [True: 6, False: 3.33k]
  ------------------
 3951|      6|                           ctx.error = error_code::syntax_error;
 3952|      6|                           return;
 3953|      6|                        }
 3954|  26.2k|                     }
 3955|  26.2k|                  }
 3956|  26.2k|               }
 3957|  26.2k|               skip_comment(it, end);
 3958|   654k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 626k, False: 27.9k]
  |  Branch (3958:34): [True: 210k, False: 416k]
  |  Branch (3958:49): [True: 186k, False: 229k]
  ------------------
 3959|   396k|                  skip_newline(it, end);
 3960|   396k|               }
 3961|   257k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 229k, False: 27.9k]
  ------------------
 3962|       |                  // The entry stopped part way along its line with something other than
 3963|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3964|       |                  // separator, say. The next pass measures indent as though this were the start
 3965|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3966|   229k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   229k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 40, False: 229k]
  ------------------
 3968|     40|                        ctx.error = error_code::syntax_error;
 3969|     40|                        return;
 3970|     40|                     }
 3971|   229k|                  }
 3972|   229k|               }
 3973|   654k|            }
 3974|  1.18M|         }
 3975|   910k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_i:
 4855|  1.32M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4856|  1.32M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|  1.32M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4858|  1.32M|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|  1.32M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|  1.32M|                           if (ctx.stream_begin) {
 4866|  1.32M|                              auto is_line_content_start = [&](auto pos) {
 4867|  1.32M|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|  1.32M|                              };
 4869|       |
 4870|  1.32M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|  1.32M|                                 const char* line = ctx.line_begin_of(pos);
 4872|  1.32M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|  1.32M|                                 return line != end && *line == ':';
 4874|  1.32M|                              };
 4875|       |
 4876|  1.32M|                              if (!is_line_content_start(it) &&
 4877|  1.32M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4878|  1.32M|                                  !line_has_explicit_value_indicator(it)) {
 4879|  1.32M|                                 ctx.error = error_code::syntax_error;
 4880|  1.32M|                                 return false;
 4881|  1.32M|                              }
 4882|  1.32M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|  1.32M|                           }
 4884|  1.32M|                        }
 4885|       |
 4886|  1.32M|                        if (*it == '-' &&
 4887|  1.32M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4888|  1.32M|                            !line_starts_with_explicit_value_indicator) {
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|  1.32M|                           ctx.error = error_code::syntax_error;
 4891|  1.32M|                           return false;
 4892|  1.32M|                        }
 4893|       |
 4894|  1.32M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4895|  1.32M|                           return false;
 4896|  1.32M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|  1.32M|                        ctx.pop_indent();
 4898|  1.32M|                     }
 4899|  1.32M|                     else {
 4900|  1.32M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|  1.32M|                        if (nested_indent >= 0) {
 4902|  1.32M|                           yaml::skip_to_content(it, end);
 4903|  1.32M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4904|  1.32M|                              ctx.error = error_code::syntax_error;
 4905|  1.32M|                              return false;
 4906|  1.32M|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|  1.32M|                           const int32_t value_indent =
 4910|  1.32M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4911|  1.32M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4912|  1.32M|                              return false;
 4913|  1.32M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|  1.32M|                           ctx.pop_indent();
 4915|  1.32M|                        }
 4916|  1.32M|                     }
 4917|  1.32M|                     return !bool(ctx.error);
 4918|  1.32M|                  };
 4919|       |
 4920|       |                  // Explicit key entry form:
 4921|       |                  // ? key
 4922|       |                  // : value
 4923|  1.32M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4923:23): [True: 585k, False: 740k]
  |  Branch (4923:37): [True: 583k, False: 1.13k]
  |  Branch (4923:58): [True: 6, False: 583k]
  ------------------
 4924|      6|                     ctx.error = error_code::syntax_error;
 4925|      6|                     return false;
 4926|      6|                  }
 4927|  1.32M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4927:23): [True: 585k, False: 740k]
  |  Branch (4927:38): [True: 1.13k, False: 583k]
  |  Branch (4927:57): [True: 199k, False: 384k]
  |  Branch (4927:77): [True: 298k, False: 85.4k]
  |  Branch (4927:98): [True: 76.3k, False: 9.08k]
  ------------------
 4928|   575k|                     ++it; // skip '?'
 4929|   575k|                     yaml::skip_inline_ws(it, end);
 4930|       |
 4931|   575k|                     const int32_t explicit_value_indicator_indent =
 4932|   575k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4932:25): [True: 391k, False: 184k]
  ------------------
 4933|       |
 4934|   575k|                     key_t key{};
 4935|   575k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4936|   575k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   575k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   575k|                        };
 4939|       |
 4940|   575k|                        auto key_it = it;
 4941|   575k|                        yaml::skip_inline_ws(key_it, end);
 4942|       |
 4943|   575k|                        auto content = key_it;
 4944|   575k|                        yaml::skip_to_content(content, end);
 4945|   575k|                        bool handled_anchor_only_empty_key = false;
 4946|       |
 4947|       |                        // Anchor on an empty explicit key node:
 4948|       |                        //   ? &a
 4949|       |                        //   : value
 4950|   575k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4950:29): [True: 567k, False: 7.97k]
  |  Branch (4950:47): [True: 174k, False: 393k]
  ------------------
 4951|   174k|                           auto anchor_probe = content + 1;
 4952|   174k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4953|   174k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4953:32): [True: 174k, False: 18]
  ------------------
 4954|   174k|                              auto after_anchor = anchor_probe;
 4955|   174k|                              yaml::skip_inline_ws(after_anchor, end);
 4956|       |
 4957|   174k|                              auto value_indicator = after_anchor;
 4958|   174k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4958:35): [True: 168k, False: 6.19k]
  |  Branch (4958:61): [True: 6.54k, False: 161k]
  ------------------
 4959|  6.54k|                                 key.clear();
 4960|  6.54k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4961|  6.54k|                                 it = value_indicator;
 4962|  6.54k|                                 handled_anchor_only_empty_key = true;
 4963|  6.54k|                              }
 4964|   167k|                              else {
 4965|   167k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4965:38): [True: 161k, False: 6.19k]
  |  Branch (4965:64): [True: 11.2k, False: 150k]
  ------------------
 4966|  11.2k|                                    yaml::skip_comment(value_indicator, end);
 4967|  11.2k|                                 }
 4968|   167k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4968:38): [True: 161k, False: 6.51k]
  |  Branch (4968:65): [True: 23.4k, False: 137k]
  |  Branch (4968:93): [True: 56.5k, False: 81.2k]
  ------------------
 4969|  79.9k|                                    yaml::skip_newline(value_indicator, end);
 4970|  79.9k|                                    auto value_line = value_indicator;
 4971|  79.9k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4972|  79.9k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4972:41): [True: 6, False: 79.9k]
  ------------------
 4973|      6|                                       return false;
 4974|  79.9k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4974:41): [True: 74.6k, False: 5.32k]
  |  Branch (4974:62): [True: 8.52k, False: 66.0k]
  ------------------
 4975|  8.52k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4975:41): [True: 8.51k, False: 10]
  ------------------
 4976|  8.51k|                                       key.clear();
 4977|  8.51k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4978|  8.51k|                                       it = value_line;
 4979|  8.51k|                                       handled_anchor_only_empty_key = true;
 4980|  8.51k|                                    }
 4981|  71.4k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4981:46): [True: 66.1k, False: 5.32k]
  |  Branch (4981:67): [True: 10, False: 66.0k]
  ------------------
 4982|       |                                       // In explicit-key form ("? &a"), a following ':'
 4983|       |                                       // starts the outer value indicator only at the same
 4984|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4985|     10|                                       ctx.error = error_code::syntax_error;
 4986|     10|                                       return false;
 4987|     10|                                    }
 4988|  79.9k|                                 }
 4989|   167k|                              }
 4990|   174k|                           }
 4991|   174k|                        }
 4992|       |
 4993|   575k|                        const bool key_content_spans_lines = [&] {
 4994|   575k|                           auto scan = key_it;
 4995|   575k|                           while (scan != content && scan != end) {
 4996|   575k|                              if (*scan == '\n' || *scan == '\r') return true;
 4997|   575k|                              ++scan;
 4998|   575k|                           }
 4999|   575k|                           return false;
 5000|   575k|                        }();
 5001|       |
 5002|   575k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5002:29): [True: 15.0k, False: 560k]
  ------------------
 5003|       |                           // 'it' already points to the explicit value indicator ':'
 5004|  15.0k|                        }
 5005|   560k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5005:34): [True: 7.97k, False: 552k]
  |  Branch (5005:53): [True: 10.3k, False: 542k]
  |  Branch (5005:72): [True: 6.75k, False: 3.64k]
  ------------------
 5006|  14.7k|                           key.clear();
 5007|  14.7k|                           it = content;
 5008|  14.7k|                        }
 5009|   546k|                        else {
 5010|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5011|       |                           // Parse the key node structurally (not via plain-key scanning)
 5012|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5013|       |                           // as complex keys, not split into implicit key/value pairs.
 5014|   546k|                           auto key_node_it = content;
 5015|   546k|                           auto key_node_end = end;
 5016|   546k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5017|       |                              // In explicit-key form, a following standalone ':'
 5018|       |                              // line (same or lower indentation) belongs to the
 5019|       |                              // outer mapping value, not the key node itself.
 5020|   546k|                              auto scan = content;
 5021|  2.83M|                              while (scan != end) {
  ------------------
  |  Branch (5021:38): [True: 2.66M, False: 164k]
  ------------------
 5022|   654M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5022:41): [True: 654M, False: 310k]
  |  Branch (5022:56): [True: 653M, False: 1.20M]
  |  Branch (5022:73): [True: 651M, False: 1.15M]
  ------------------
 5023|   651M|                                    ++scan;
 5024|   651M|                                 }
 5025|  2.66M|                                 if (scan == end) {
  ------------------
  |  Branch (5025:38): [True: 310k, False: 2.35M]
  ------------------
 5026|   310k|                                    break;
 5027|   310k|                                 }
 5028|       |
 5029|  2.35M|                                 yaml::skip_newline(scan, end);
 5030|  2.35M|                                 auto line_start = scan;
 5031|       |
 5032|  2.35M|                                 int32_t indicator_indent = 0;
 5033|  3.93M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5033:41): [True: 3.77M, False: 164k]
  |  Branch (5033:56): [True: 1.57M, False: 2.19M]
  ------------------
 5034|  1.57M|                                    ++indicator_indent;
 5035|  1.57M|                                    ++scan;
 5036|  1.57M|                                 }
 5037|       |
 5038|  2.35M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5038:38): [True: 2.19M, False: 164k]
  |  Branch (5038:53): [True: 136k, False: 2.05M]
  ------------------
 5039|   136k|                                    const auto after_colon = scan + 1;
 5040|   136k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5040:42): [True: 8.14k, False: 128k]
  ------------------
 5041|   128k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5041:42): [True: 97.2k, False: 30.9k]
  ------------------
 5042|   105k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5042:41): [True: 71.6k, False: 33.7k]
  ------------------
 5043|  71.6k|                                       key_node_end = line_start;
 5044|  71.6k|                                       break;
 5045|  71.6k|                                    }
 5046|   136k|                                 }
 5047|  2.35M|                              }
 5048|   546k|                           }
 5049|       |
 5050|   546k|                           glz::generic key_node{};
 5051|   546k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5052|   546k|                           ctx.explicit_mapping_key_context = true;
 5053|   546k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5054|   546k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5055|   546k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5055:32): [True: 18.9k, False: 527k]
  ------------------
 5056|  18.9k|                              return false;
 5057|   527k|                           it = key_node_it;
 5058|   527k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5058:32): [True: 12, False: 527k]
  ------------------
 5059|     12|                              return false;
 5060|   527k|                        }
 5061|       |                     }
 5062|       |                     else {
 5063|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5064|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5065|       |                           if (bool(ctx.error)) [[unlikely]]
 5066|       |                              return false;
 5067|       |                        }
 5068|       |                     }
 5069|       |
 5070|   556k|                     yaml::skip_inline_ws(it, end);
 5071|   575k|                     yaml::skip_comment(it, end);
 5072|       |
 5073|       |                     // Value indicator may appear on the next line at the same indent.
 5074|   575k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5074:26): [True: 375k, False: 200k]
  |  Branch (5074:40): [True: 116k, False: 259k]
  |  Branch (5074:55): [True: 111k, False: 147k]
  ------------------
 5075|   227k|                        auto probe = it;
 5076|   227k|                        bool found_value_indicator = false;
 5077|       |
 5078|   364k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5078:32): [True: 312k, False: 51.5k]
  |  Branch (5078:49): [True: 147k, False: 164k]
  |  Branch (5078:67): [True: 164k, False: 0]
  ------------------
 5079|   312k|                           yaml::skip_newline(probe, end);
 5080|       |
 5081|   312k|                           auto value_line = probe;
 5082|   312k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5083|   312k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5083:32): [True: 8, False: 312k]
  ------------------
 5084|      8|                              return false;
 5085|       |
 5086|   312k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5086:32): [True: 49.3k, False: 263k]
  |  Branch (5086:53): [True: 11.9k, False: 251k]
  |  Branch (5086:76): [True: 37.8k, False: 213k]
  ------------------
 5087|  99.1k|                              probe = value_line;
 5088|  99.1k|                              continue; // blank line
 5089|  99.1k|                           }
 5090|   213k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5090:32): [True: 36.8k, False: 176k]
  ------------------
 5091|  36.8k|                              yaml::skip_comment(value_line, end);
 5092|  36.8k|                              probe = value_line;
 5093|  36.8k|                              continue; // comment-only line
 5094|  36.8k|                           }
 5095|   176k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5095:32): [True: 26.0k, False: 150k]
  |  Branch (5095:54): [True: 14.6k, False: 11.4k]
  ------------------
 5096|  14.6k|                              it = value_line;
 5097|  14.6k|                              found_value_indicator = true;
 5098|  14.6k|                           }
 5099|   176k|                           break;
 5100|   213k|                        }
 5101|       |
 5102|   227k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5102:29): [True: 14.6k, False: 213k]
  ------------------
 5103|  14.6k|                           yaml::skip_inline_ws(it, end);
 5104|  14.6k|                        }
 5105|   227k|                     }
 5106|       |
 5107|   575k|                     val_t val{};
 5108|   575k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5108:26): [True: 375k, False: 200k]
  |  Branch (5108:39): [True: 105k, False: 269k]
  ------------------
 5109|   105k|                        ++it;
 5110|   105k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5110:29): [True: 104k, False: 1.85k]
  |  Branch (5110:42): [True: 12, False: 104k]
  ------------------
 5111|     12|                           ctx.error = error_code::syntax_error;
 5112|     12|                           return false;
 5113|     12|                        }
 5114|   105k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5114:29): [True: 104k, False: 1.85k]
  |  Branch (5114:43): [True: 7.83k, False: 96.2k]
  |  Branch (5114:58): [True: 35.8k, False: 60.3k]
  ------------------
 5115|  43.7k|                           auto probe = it;
 5116|  43.7k|                           yaml::skip_newline(probe, end);
 5117|   201k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5117:35): [True: 192k, False: 9.41k]
  |  Branch (5117:51): [True: 158k, False: 34.3k]
  ------------------
 5118|  43.7k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5118:32): [True: 34.3k, False: 9.41k]
  |  Branch (5118:48): [True: 11.8k, False: 22.4k]
  |  Branch (5118:65): [True: 8.74k, False: 3.10k]
  |  Branch (5118:89): [True: 6, False: 8.73k]
  ------------------
 5119|      6|                              ctx.error = error_code::syntax_error;
 5120|      6|                              return false;
 5121|      6|                           }
 5122|  43.7k|                        }
 5123|   105k|                        yaml::skip_inline_ws(it, end);
 5124|   105k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5124:29): [True: 2.20k, False: 103k]
  ------------------
 5125|  2.20k|                           return false;
 5126|   105k|                     }
 5127|       |
 5128|   573k|                     value.emplace(std::move(key), std::move(val));
 5129|   573k|                     return true;
 5130|   575k|                  }
 5131|       |
 5132|   749k|                  key_t key{};
 5133|   749k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5134|   749k|                     auto key_probe = it;
 5135|   749k|                     yaml::skip_inline_ws(key_probe, end);
 5136|   749k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5136:53): [True: 749k, False: 0]
  |  Branch (5136:74): [True: 2.68k, False: 746k]
  |  Branch (5136:95): [True: 11.3k, False: 735k]
  ------------------
 5137|   749k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5137:26): [True: 14.0k, False: 735k]
  ------------------
 5138|  14.0k|                        glz::generic key_node{};
 5139|  14.0k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5140|  14.0k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5140:29): [True: 800, False: 13.2k]
  ------------------
 5141|    800|                           return false;
 5142|  13.2k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5142:29): [True: 4, False: 13.2k]
  ------------------
 5143|      4|                           return false;
 5144|  13.2k|                     }
 5145|   735k|                     else {
 5146|   735k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5146:29): [True: 105k, False: 629k]
  ------------------
 5147|   105k|                           return false;
 5148|   105k|                        }
 5149|   735k|                     }
 5150|       |                  }
 5151|       |                  else {
 5152|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5153|       |                     if (bool(ctx.error)) [[unlikely]]
 5154|       |                        return false;
 5155|       |                  }
 5156|       |
 5157|   643k|                  yaml::skip_inline_ws(it, end);
 5158|       |
 5159|   749k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5159:23): [True: 106k, False: 643k]
  |  Branch (5159:36): [True: 60, False: 642k]
  ------------------
 5160|    138|                     ctx.error = error_code::syntax_error;
 5161|    138|                     return false;
 5162|    138|                  }
 5163|   749k|                  ++it;
 5164|   749k|                  yaml::skip_inline_ws(it, end);
 5165|       |
 5166|   749k|                  val_t val{};
 5167|   749k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5167:23): [True: 10.4k, False: 738k]
  ------------------
 5168|  10.4k|                     return false;
 5169|       |
 5170|   738k|                  value.emplace(std::move(key), std::move(val));
 5171|   738k|                  return true;
 5172|   749k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlvE_clEv:
 4993|   575k|                        const bool key_content_spans_lines = [&] {
 4994|   575k|                           auto scan = key_it;
 4995|   652k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4995:35): [True: 467k, False: 184k]
  |  Branch (4995:54): [True: 467k, False: 0]
  ------------------
 4996|   467k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4996:35): [True: 303k, False: 164k]
  |  Branch (4996:52): [True: 88.0k, False: 76.8k]
  ------------------
 4997|  76.8k|                              ++scan;
 4998|  76.8k|                           }
 4999|   184k|                           return false;
 5000|   575k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4936|   527k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   527k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   527k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4856|   748k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|   748k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4857:26): [True: 688k, False: 60.4k]
  |  Branch (4857:39): [True: 441k, False: 246k]
  ------------------
 4858|   441k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   441k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   441k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4865:32): [True: 441k, False: 0]
  ------------------
 4866|   441k|                              auto is_line_content_start = [&](auto pos) {
 4867|   441k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   441k|                              };
 4869|       |
 4870|   441k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   441k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   441k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   441k|                                 return line != end && *line == ':';
 4874|   441k|                              };
 4875|       |
 4876|   441k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4876:35): [True: 441k, False: 0]
  ------------------
 4877|   441k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4877:35): [True: 18.2k, False: 423k]
  ------------------
 4878|  18.2k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4878:35): [True: 18, False: 18.1k]
  ------------------
 4879|     18|                                 ctx.error = error_code::syntax_error;
 4880|     18|                                 return false;
 4881|     18|                              }
 4882|   441k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   441k|                           }
 4884|   441k|                        }
 4885|       |
 4886|   441k|                        if (*it == '-' &&
  ------------------
  |  Branch (4886:29): [True: 10.2k, False: 431k]
  ------------------
 4887|  10.2k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4887:30): [True: 672, False: 9.54k]
  |  Branch (4887:49): [True: 4.92k, False: 4.61k]
  ------------------
 4888|  5.60k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4888:29): [True: 12, False: 5.58k]
  ------------------
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|     12|                           ctx.error = error_code::syntax_error;
 4891|     12|                           return false;
 4892|     12|                        }
 4893|       |
 4894|   441k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4894:29): [True: 0, False: 441k]
  ------------------
 4895|      0|                           return false;
 4896|   441k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   441k|                        ctx.pop_indent();
 4898|   441k|                     }
 4899|   307k|                     else {
 4900|   307k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|   307k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4901:29): [True: 59.2k, False: 247k]
  ------------------
 4902|  59.2k|                           yaml::skip_to_content(it, end);
 4903|  59.2k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4903:32): [True: 59.2k, False: 0]
  |  Branch (4903:45): [True: 0, False: 59.2k]
  |  Branch (4903:59): [True: 0, False: 0]
  |  Branch (4903:78): [True: 0, False: 0]
  ------------------
 4904|      0|                              ctx.error = error_code::syntax_error;
 4905|      0|                              return false;
 4906|      0|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|  59.2k|                           const int32_t value_indent =
 4910|  59.2k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4910:31): [Folded, False: 59.2k]
  ------------------
 4911|  59.2k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4911:32): [True: 0, False: 59.2k]
  ------------------
 4912|      0|                              return false;
 4913|  59.2k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|  59.2k|                           ctx.pop_indent();
 4915|  59.2k|                        }
 4916|   307k|                     }
 4917|   748k|                     return !bool(ctx.error);
 4918|   748k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISA_EEDaSN_:
 4866|   441k|                              auto is_line_content_start = [&](auto pos) {
 4867|   441k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   441k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISA_EEDaSN_:
 4870|   459k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   459k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   870k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4872:41): [True: 870k, False: 0]
  |  Branch (4872:57): [True: 410k, False: 460k]
  |  Branch (4872:73): [True: 718, False: 459k]
  ------------------
 4873|   459k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4873:41): [True: 459k, False: 0]
  |  Branch (4873:56): [True: 182k, False: 277k]
  ------------------
 4874|   459k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4625|  1.05M|            {
 4626|       |               // emplace is a no-op for keys the document already wrote, so only
 4627|       |               // untouched pre-existing entries are put back.
 4628|  1.05M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4628:33): [True: 0, False: 1.05M]
  ------------------
 4629|      0|                  target.emplace(entry.first, std::move(entry.second));
 4630|      0|               }
 4631|  1.05M|            }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|  36.4k|      {
  301|  36.4k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 36.4k]
  |  Branch (301:27): [True: 0, False: 36.4k]
  ------------------
  302|       |
  303|  36.4k|         ++it; // skip '*'
  304|  36.4k|         auto name = parse_anchor_name(it, end);
  305|  36.4k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 38, False: 36.4k]
  ------------------
  306|     38|            ctx.error = error_code::syntax_error;
  307|     38|            return true;
  308|     38|         }
  309|       |
  310|  36.4k|         auto anchor_it = ctx.anchors.find(name);
  311|  36.4k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 64, False: 36.3k]
  ------------------
  312|     64|            ctx.error = error_code::syntax_error; // undefined alias
  313|     64|            return true;
  314|     64|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  36.3k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  36.3k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.67k, False: 34.6k]
  ------------------
  322|  1.67k|            return true;
  323|  1.67k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  34.6k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 838, False: 33.8k]
  ------------------
  329|    838|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    838|            return true;
  331|    838|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  33.8k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  33.8k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 33.8k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  33.8k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 16, False: 33.8k]
  ------------------
  342|     16|            ctx.error = error_code::exceeded_max_expansion;
  343|     16|            ctx.custom_error_message = "alias expansion";
  344|     16|            return true;
  345|     16|         }
  346|       |
  347|  33.8k|         auto replay_it = span.begin;
  348|  33.8k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  33.8k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  33.8k|         ctx.indent_stack.clear();
  353|  33.8k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 19.9k, False: 13.8k]
  ------------------
  354|  19.9k|            ctx.push_indent(span.base_indent - 1);
  355|  19.9k|         }
  356|       |
  357|  33.8k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  33.8k|         using V = std::remove_cvref_t<T>;
  360|  33.8k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  33.8k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  33.8k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  33.8k|         return true;
  367|  33.8k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   432k|      {
 5284|   432k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   432k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   432k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   432k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   432k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 432k, False: 0]
  ------------------
 5294|   432k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   432k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1960|   440k|      {
 1961|   440k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 14.2k, False: 426k]
  ------------------
 1962|  14.2k|            return;
 1963|       |
 1964|   426k|         yaml::node_preamble_state preamble{};
 1965|   426k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 8.94k, False: 417k]
  ------------------
 1966|   426k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  8.94k|            return;
 1968|       |
 1969|   417k|         std::string str;
 1970|   417k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   417k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 417k, False: 0]
  ------------------
 1973|  18.1k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 18.1k, False: 399k]
  ------------------
 1974|  18.1k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  18.1k|            break;
 1976|  1.03k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 1.03k, False: 416k]
  ------------------
 1977|  1.03k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  1.03k|            break;
 1979|  3.69k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 3.69k, False: 414k]
  ------------------
 1980|  18.4k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 14.7k, False: 403k]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  18.4k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  18.4k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 4.15k, False: 14.2k]
  ------------------
 1986|  18.4k|            break;
 1987|   380k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 380k, False: 37.6k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|   380k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|   380k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1991:20): [True: 217k, False: 163k]
  ------------------
 1992|   217k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|   217k|               }
 1994|   163k|               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|   163k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|   163k|               }
 1998|       |            }
 1999|       |            else {
 2000|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|       |            }
 2002|   380k|            break;
 2003|   417k|         }
 2004|       |
 2005|   417k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 417k, False: 166]
  ------------------
 2006|   417k|            value = std::move(str);
 2007|   417k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   417k|         }
 2009|   417k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   426k|      {
  466|   426k|         skip_inline_ws(it, end);
  467|       |
  468|   426k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 26, False: 426k]
  ------------------
  469|     26|            if constexpr (!AllowEmptyInput) {
  470|     26|               ctx.error = error_code::unexpected_end;
  471|     26|            }
  472|     26|            return true;
  473|     26|         }
  474|       |
  475|   426k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   426k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 426k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   426k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 8, False: 426k]
  ------------------
  481|      8|            ctx.error = error_code::syntax_error;
  482|      8|            return true;
  483|      8|         }
  484|       |
  485|   426k|         skip_inline_ws(it, end);
  486|       |
  487|   426k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 426k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   426k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 8.90k, False: 417k]
  ------------------
  495|  8.90k|            return true;
  496|  8.90k|         }
  497|       |
  498|   417k|         return false;
  499|   426k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1966|   426k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   426k|      {
  409|   426k|         state.has_anchor = false;
  410|   426k|         state.anchor_name.clear();
  411|   426k|         state.anchor_start = nullptr;
  412|   426k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   426k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   426k|            else {
  421|   426k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 8.84k, False: 417k]
  ------------------
  422|   426k|            }
  423|   426k|         }
  424|       |
  425|   426k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 417k, False: 8.84k]
  |  Branch (425:27): [True: 14.2k, False: 403k]
  ------------------
  426|  14.2k|            ++it;
  427|  14.2k|            auto name = parse_anchor_name(it, end);
  428|  14.2k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 20, False: 14.2k]
  ------------------
  429|     20|               ctx.error = error_code::syntax_error;
  430|     20|               return true;
  431|     20|            }
  432|  14.2k|            skip_inline_ws(it, end);
  433|  14.2k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 22, False: 14.1k]
  ------------------
  434|     22|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     22|                  ctx.error = error_code::unexpected_end;
  436|     22|               }
  437|     22|               return true;
  438|     22|            }
  439|  14.1k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  14.1k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 10, False: 14.1k]
  ------------------
  441|     10|                  ctx.error = error_code::syntax_error;
  442|     10|                  return true;
  443|     10|               }
  444|  14.1k|            }
  445|  14.1k|            state.has_anchor = true;
  446|  14.1k|            state.anchor_name = std::string(name);
  447|  14.1k|            state.anchor_start = &*it;
  448|  14.1k|         }
  449|       |
  450|   426k|         return false;
  451|   426k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   426k|      {
  301|   426k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 426k]
  |  Branch (301:27): [True: 417k, False: 8.84k]
  ------------------
  302|       |
  303|  8.84k|         ++it; // skip '*'
  304|  8.84k|         auto name = parse_anchor_name(it, end);
  305|  8.84k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 10, False: 8.83k]
  ------------------
  306|     10|            ctx.error = error_code::syntax_error;
  307|     10|            return true;
  308|     10|         }
  309|       |
  310|  8.83k|         auto anchor_it = ctx.anchors.find(name);
  311|  8.83k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 56, False: 8.78k]
  ------------------
  312|     56|            ctx.error = error_code::syntax_error; // undefined alias
  313|     56|            return true;
  314|     56|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  8.78k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  8.78k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 290, False: 8.49k]
  ------------------
  322|    290|            return true;
  323|    290|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  8.49k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 14, False: 8.47k]
  ------------------
  329|     14|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     14|            return true;
  331|     14|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  8.47k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  8.47k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 8.47k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  8.47k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 4, False: 8.46k]
  ------------------
  342|      4|            ctx.error = error_code::exceeded_max_expansion;
  343|      4|            ctx.custom_error_message = "alias expansion";
  344|      4|            return true;
  345|      4|         }
  346|       |
  347|  8.46k|         auto replay_it = span.begin;
  348|  8.46k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  8.46k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  8.46k|         ctx.indent_stack.clear();
  353|  8.46k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.10k, False: 7.36k]
  ------------------
  354|  1.10k|            ctx.push_indent(span.base_indent - 1);
  355|  1.10k|         }
  356|       |
  357|  8.46k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  8.46k|         using V = std::remove_cvref_t<T>;
  360|  8.46k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  8.46k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  8.46k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  8.46k|         return true;
  367|  8.47k|      }
_ZN3glz4yaml28parse_plain_scalar_multilineINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_i:
 1178|   752k|      {
 1179|   752k|         value.clear();
 1180|       |
 1181|  6.12M|         while (it != end) {
  ------------------
  |  Branch (1181:17): [True: 6.11M, False: 13.4k]
  ------------------
 1182|  6.11M|            {
 1183|  6.11M|               const auto run_start = it;
 1184|  83.2M|               while (it != end && !plain_scalar_block_dispatch_table[uint8_t(*it)]) {
  ------------------
  |  Branch (1184:23): [True: 83.1M, False: 112k]
  |  Branch (1184:36): [True: 77.1M, False: 6.00M]
  ------------------
 1185|  77.1M|                  ++it;
 1186|  77.1M|               }
 1187|  6.11M|               if (it != run_start) {
  ------------------
  |  Branch (1187:20): [True: 5.65M, False: 459k]
  ------------------
 1188|  5.65M|                  value.append(run_start, it);
 1189|  5.65M|               }
 1190|  6.11M|               if (it == end) break;
  ------------------
  |  Branch (1190:20): [True: 112k, False: 6.00M]
  ------------------
 1191|  6.11M|            }
 1192|       |
 1193|  6.00M|            const char c = *it;
 1194|       |
 1195|  6.00M|            if (forbidden_control_table[uint8_t(c)]) [[unlikely]] {
  ------------------
  |  Branch (1195:17): [True: 12.2k, False: 5.99M]
  ------------------
 1196|  12.2k|               ctx.error = error_code::invalid_control_character;
 1197|  12.2k|               return;
 1198|  12.2k|            }
 1199|       |
 1200|       |            // Check for newline - potential continuation
 1201|  5.99M|            if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1201:17): [True: 440k, False: 5.55M]
  |  Branch (1201:30): [True: 975k, False: 4.57M]
  ------------------
 1202|       |               // Trim trailing whitespace from current line
 1203|  1.60M|               while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1203:23): [True: 1.48M, False: 121k]
  |  Branch (1203:42): [True: 157k, False: 1.32M]
  |  Branch (1203:65): [True: 29.8k, False: 1.29M]
  ------------------
 1204|   187k|                  value.pop_back();
 1205|   187k|               }
 1206|       |
 1207|       |               // Count consecutive blank lines
 1208|  1.41M|               int blank_lines = 0;
 1209|  1.41M|               auto lookahead = it;
 1210|       |
 1211|  3.09M|               while (lookahead != end) {
  ------------------
  |  Branch (1211:23): [True: 2.99M, False: 102k]
  ------------------
 1212|       |                  // Skip the newline
 1213|  2.99M|                  if (*lookahead == '\r' && (lookahead + 1) != end && *(lookahead + 1) == '\n') {
  ------------------
  |  Branch (1213:23): [True: 1.57M, False: 1.41M]
  |  Branch (1213:45): [True: 1.52M, False: 54.1k]
  |  Branch (1213:71): [True: 47.3k, False: 1.47M]
  ------------------
 1214|  47.3k|                     ++lookahead;
 1215|  47.3k|                  }
 1216|  2.99M|                  if (lookahead != end && (*lookahead == '\n' || *lookahead == '\r')) {
  ------------------
  |  Branch (1216:23): [True: 2.99M, False: 0]
  |  Branch (1216:44): [True: 1.46M, False: 1.52M]
  |  Branch (1216:66): [True: 1.52M, False: 0]
  ------------------
 1217|  2.99M|                     ++lookahead;
 1218|  2.99M|                  }
 1219|      0|                  else {
 1220|      0|                     break;
 1221|      0|                  }
 1222|       |
 1223|       |                  // Check if this is a blank line or comment-only line
 1224|  2.99M|                  int32_t line_indent = 0;
 1225|       |
 1226|  3.85M|                  while (lookahead != end && (*lookahead == ' ' || *lookahead == '\t')) {
  ------------------
  |  Branch (1226:26): [True: 3.74M, False: 102k]
  |  Branch (1226:47): [True: 731k, False: 3.01M]
  |  Branch (1226:68): [True: 125k, False: 2.89M]
  ------------------
 1227|   856k|                     ++line_indent;
 1228|   856k|                     ++lookahead;
 1229|   856k|                  }
 1230|       |
 1231|  2.99M|                  if (lookahead == end || *lookahead == '\n' || *lookahead == '\r') {
  ------------------
  |  Branch (1231:23): [True: 102k, False: 2.89M]
  |  Branch (1231:43): [True: 976k, False: 1.91M]
  |  Branch (1231:65): [True: 601k, False: 1.31M]
  ------------------
 1232|       |                     // Blank line
 1233|  1.68M|                     ++blank_lines;
 1234|  1.68M|                     continue;
 1235|  1.68M|                  }
 1236|       |
 1237|  1.31M|                  if (*lookahead == '#') {
  ------------------
  |  Branch (1237:23): [True: 47.5k, False: 1.26M]
  ------------------
 1238|       |                     // Comments end plain scalars per YAML spec
 1239|  47.5k|                     return;
 1240|  47.5k|                  }
 1241|       |
 1242|       |                  // Found content - check indentation
 1243|       |                  // Continuation lines must not dedent below the parent block.
 1244|  1.26M|                  if (line_indent < base_indent) {
  ------------------
  |  Branch (1244:23): [True: 142k, False: 1.12M]
  ------------------
 1245|       |                     // Dedented - end of scalar
 1246|   142k|                     return;
 1247|   142k|                  }
 1248|       |
 1249|       |                  // Document boundary markers at column 0 start/stop documents and
 1250|       |                  // must terminate a top-level plain scalar continuation.
 1251|  1.12M|                  if (line_indent == 0 && (at_document_start(lookahead, end) || at_document_end(lookahead, end))) {
  ------------------
  |  Branch (1251:23): [True: 915k, False: 208k]
  |  Branch (1251:44): [True: 5.24k, False: 910k]
  |  Branch (1251:81): [True: 3.20k, False: 906k]
  ------------------
 1252|  8.44k|                     return;
 1253|  8.44k|                  }
 1254|       |
 1255|       |                  // Sequence indicator (- followed by space/newline/end).
 1256|       |                  // Terminates the scalar when the dash is at or above the
 1257|       |                  // enclosing sequence's indicator column, meaning it starts
 1258|       |                  // a sibling entry.  A dash deeper than the indicator is
 1259|       |                  // plain content (yaml-test-suite AB8U).
 1260|  1.11M|                  if (*lookahead == '-') {
  ------------------
  |  Branch (1260:23): [True: 135k, False: 979k]
  ------------------
 1261|   135k|                     auto after_dash = lookahead + 1;
 1262|   135k|                     if (after_dash == end || *after_dash == ' ' || *after_dash == '\t' || *after_dash == '\n' ||
  ------------------
  |  Branch (1262:26): [True: 484, False: 134k]
  |  Branch (1262:47): [True: 12.7k, False: 122k]
  |  Branch (1262:69): [True: 3.79k, False: 118k]
  |  Branch (1262:92): [True: 99.9k, False: 18.4k]
  ------------------
 1263|   118k|                         *after_dash == '\r') {
  ------------------
  |  Branch (1263:26): [True: 1.01k, False: 17.4k]
  ------------------
 1264|   118k|                        if (ctx.sequence_dash_indent < 0 || line_indent <= ctx.sequence_dash_indent) {
  ------------------
  |  Branch (1264:29): [True: 3.14k, False: 114k]
  |  Branch (1264:61): [True: 110k, False: 4.21k]
  ------------------
 1265|   113k|                           return;
 1266|   113k|                        }
 1267|   118k|                     }
 1268|   135k|                  }
 1269|       |
 1270|  1.00M|                  if (ctx.explicit_mapping_key_context) {
  ------------------
  |  Branch (1270:23): [True: 759k, False: 241k]
  ------------------
 1271|       |                     // In explicit mapping keys ("? key"), a following explicit
 1272|       |                     // key/value indicator starts a new mapping entry.
 1273|   759k|                     if (*lookahead == '?' || *lookahead == ':') {
  ------------------
  |  Branch (1273:26): [True: 47.4k, False: 712k]
  |  Branch (1273:47): [True: 10.2k, False: 702k]
  ------------------
 1274|  57.6k|                        auto after = lookahead + 1;
 1275|  57.6k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1275:29): [True: 854, False: 56.7k]
  |  Branch (1275:45): [True: 16.4k, False: 40.3k]
  |  Branch (1275:62): [True: 202, False: 40.1k]
  |  Branch (1275:80): [True: 12.5k, False: 27.5k]
  |  Branch (1275:98): [True: 13.8k, False: 13.7k]
  ------------------
 1276|  43.8k|                           return;
 1277|  43.8k|                        }
 1278|  57.6k|                     }
 1279|       |
 1280|       |                     // Node-property indicators at the start of a continuation
 1281|       |                     // line begin a new key node in explicit-key context.
 1282|   715k|                     if (*lookahead == '&' || *lookahead == '*' || *lookahead == '!') {
  ------------------
  |  Branch (1282:26): [True: 514, False: 715k]
  |  Branch (1282:47): [True: 42.5k, False: 672k]
  |  Branch (1282:68): [True: 2.71k, False: 670k]
  ------------------
 1283|  45.8k|                        return;
 1284|  45.8k|                     }
 1285|   715k|                  }
 1286|       |
 1287|       |                  // In a "- item" value context, an anchor/tag/alias at the start
 1288|       |                  // of a continuation candidate starts a new node, not scalar content.
 1289|   911k|                  if (ctx.sequence_item_value_context &&
  ------------------
  |  Branch (1289:23): [True: 51.2k, False: 860k]
  ------------------
 1290|  51.2k|                      (*lookahead == '&' || *lookahead == '*' || *lookahead == '!')) {
  ------------------
  |  Branch (1290:24): [True: 310, False: 50.9k]
  |  Branch (1290:45): [True: 1.47k, False: 49.4k]
  |  Branch (1290:66): [True: 290, False: 49.1k]
  ------------------
 1291|  2.07k|                     return;
 1292|  2.07k|                  }
 1293|       |
 1294|       |                  // Check for mapping key indicator (content followed by : and space)
 1295|       |                  // This is a heuristic - we look for ": " pattern which indicates a mapping key
 1296|   909k|                  {
 1297|   909k|                     auto scan = lookahead;
 1298|  29.7M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (1298:29): [True: 29.7M, False: 32.7k]
  |  Branch (1298:44): [True: 29.5M, False: 212k]
  |  Branch (1298:61): [True: 28.9M, False: 610k]
  ------------------
 1299|  28.9M|                        if (*scan == ':') {
  ------------------
  |  Branch (1299:29): [True: 114k, False: 28.8M]
  ------------------
 1300|   114k|                           auto after_colon = scan + 1;
 1301|   114k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (1301:32): [True: 994, False: 113k]
  |  Branch (1301:54): [True: 37.5k, False: 75.6k]
  |  Branch (1301:77): [True: 950, False: 74.7k]
  ------------------
 1302|  74.7k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (1302:32): [True: 8.24k, False: 66.4k]
  |  Branch (1302:56): [True: 5.45k, False: 61.0k]
  ------------------
 1303|       |                              // This looks like a mapping key - end the scalar
 1304|  53.2k|                              return;
 1305|  53.2k|                           }
 1306|   114k|                        }
 1307|  28.8M|                        ++scan;
 1308|  28.8M|                     }
 1309|   909k|                  }
 1310|       |
 1311|       |                  // This is a continuation line
 1312|       |                  // Add appropriate line breaks for blank lines
 1313|  2.14M|                  for (int i = 0; i < blank_lines; ++i) {
  ------------------
  |  Branch (1313:35): [True: 1.29M, False: 856k]
  ------------------
 1314|  1.29M|                     value.push_back('\n');
 1315|  1.29M|                  }
 1316|       |
 1317|       |                  // Add a space to fold the newline (unless we added literal newlines for blank lines)
 1318|   856k|                  if (blank_lines == 0 && !value.empty()) {
  ------------------
  |  Branch (1318:23): [True: 800k, False: 55.5k]
  |  Branch (1318:43): [True: 774k, False: 25.7k]
  ------------------
 1319|   774k|                     value.push_back(' ');
 1320|   774k|                  }
 1321|       |
 1322|       |                  // Move iterator to the content position
 1323|   856k|                  it = lookahead;
 1324|   856k|                  break;
 1325|   909k|               }
 1326|       |
 1327|       |               // If we exhausted the lookahead, we're done
 1328|   958k|               if (lookahead == end) {
  ------------------
  |  Branch (1328:20): [True: 102k, False: 856k]
  ------------------
 1329|   102k|                  return;
 1330|   102k|               }
 1331|       |
 1332|   856k|               continue; // Process the character at the new position
 1333|   958k|            }
 1334|       |
 1335|       |            // Per YAML spec: # only starts a comment when preceded by whitespace
 1336|  4.57M|            if (c == '#') {
  ------------------
  |  Branch (1336:17): [True: 297k, False: 4.27M]
  ------------------
 1337|   297k|               if (value.empty() || value.back() == ' ' || value.back() == '\t') {
  ------------------
  |  Branch (1337:20): [True: 23.5k, False: 273k]
  |  Branch (1337:37): [True: 20.0k, False: 253k]
  |  Branch (1337:60): [True: 2.41k, False: 251k]
  ------------------
 1338|  46.0k|                  break; // This is a comment
 1339|  46.0k|               }
 1340|   297k|            }
 1341|       |
 1342|       |            // Colon followed by space/newline ends plain scalar (potential nested mapping)
 1343|  4.52M|            if (c == ':') {
  ------------------
  |  Branch (1343:17): [True: 4.27M, False: 251k]
  ------------------
 1344|  4.27M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (1344:20): [True: 3.35k, False: 4.27M]
  |  Branch (1344:39): [True: 2.04k, False: 4.27M]
  |  Branch (1344:59): [True: 212, False: 4.27M]
  |  Branch (1344:80): [True: 1.78k, False: 4.27M]
  |  Branch (1344:101): [True: 362, False: 4.27M]
  ------------------
 1345|  7.76k|                  break;
 1346|  7.76k|               }
 1347|  4.27M|            }
 1348|       |
 1349|  4.52M|            value.push_back(c);
 1350|  4.52M|            ++it;
 1351|  4.52M|         }
 1352|       |
 1353|       |         // Trim trailing whitespace
 1354|   369k|         while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1354:17): [True: 342k, False: 26.7k]
  |  Branch (1354:36): [True: 65.3k, False: 277k]
  |  Branch (1354:59): [True: 124k, False: 153k]
  ------------------
 1355|   189k|            value.pop_back();
 1356|   189k|         }
 1357|   179k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   136k|      {
 5284|   136k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   136k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   136k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   136k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   136k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 136k, False: 0]
  ------------------
 5294|   136k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   136k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2115|   137k|      {
 2116|   137k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 137k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|   137k|         yaml::node_preamble_state preamble{};
 2120|   137k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 9.52k, False: 128k]
  ------------------
 2121|   137k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   137k|                   return yaml::tag_valid_for_float(tag);
 2123|   137k|                }
 2124|   137k|                else {
 2125|   137k|                   return yaml::tag_valid_for_int(tag);
 2126|   137k|                }
 2127|   137k|             }))
 2128|  9.52k|            return;
 2129|       |
 2130|   128k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|   128k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|   128k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|   128k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 48.0k, False: 80.0k]
  ------------------
 2138|  48.0k|               ++it;
 2139|  48.0k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 39.1k, False: 8.95k]
  |  Branch (2139:38): [True: 3.04k, False: 36.0k]
  |  Branch (2139:74): [True: 1.59k, False: 34.4k]
  ------------------
 2140|  34.4k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 286, False: 34.2k]
  ------------------
 2141|  4.92k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  4.92k|                  it += 3;
 2143|  4.92k|                  finalize();
 2144|  4.92k|                  return;
 2145|  4.92k|               }
 2146|  43.1k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 34.2k, False: 8.95k]
  |  Branch (2146:38): [True: 3.92k, False: 30.2k]
  |  Branch (2146:74): [True: 576, False: 29.7k]
  ------------------
 2147|  29.7k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 4.08k, False: 25.6k]
  ------------------
 2148|  8.58k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  8.58k|                  it += 3;
 2150|  8.58k|                  finalize();
 2151|  8.58k|                  return;
 2152|  8.58k|               }
 2153|  34.5k|               it = start;
 2154|  34.5k|            }
 2155|       |
 2156|   114k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 10.0k, False: 104k]
  |  Branch (2156:31): [True: 25.6k, False: 78.8k]
  ------------------
 2157|  35.7k|               const char sign = *it;
 2158|  35.7k|               ++it;
 2159|  35.7k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 25.3k, False: 10.3k]
  |  Branch (2159:33): [True: 11.5k, False: 13.8k]
  ------------------
 2160|  11.5k|                  ++it;
 2161|  11.5k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 9.68k, False: 1.82k]
  |  Branch (2161:41): [True: 4.55k, False: 5.12k]
  |  Branch (2161:77): [True: 1.69k, False: 3.43k]
  ------------------
 2162|  7.64k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 1.39k, False: 2.04k]
  ------------------
 2163|  7.64k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 5.60k, False: 2.03k]
  ------------------
 2164|  5.60k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  5.60k|                     }
 2166|  2.03k|                     else {
 2167|  2.03k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|  2.03k|                     }
 2169|  7.64k|                     it += 3;
 2170|  7.64k|                     finalize();
 2171|  7.64k|                     return;
 2172|  7.64k|                  }
 2173|  11.5k|               }
 2174|  28.0k|               it = start;
 2175|  28.0k|            }
 2176|   114k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|   106k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|   800k|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 761k, False: 39.4k]
  ------------------
 2183|   761k|            const char c = *it;
 2184|   761k|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 31.2k, False: 729k]
  |  Branch (2184:29): [True: 5.05k, False: 724k]
  |  Branch (2184:42): [True: 8.37k, False: 716k]
  |  Branch (2184:55): [True: 20.2k, False: 696k]
  |  Branch (2184:68): [True: 704, False: 695k]
  |  Branch (2184:80): [True: 1.45k, False: 693k]
  |  Branch (2184:92): [True: 1.29k, False: 692k]
  |  Branch (2184:104): [True: 12.6k, False: 680k]
  ------------------
 2185|  81.0k|               break;
 2186|  81.0k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|   680k|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 21.9k, False: 658k]
  ------------------
 2189|  21.9k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 418, False: 21.5k]
  |  Branch (2189:39): [True: 1.87k, False: 19.6k]
  |  Branch (2189:59): [True: 476, False: 19.1k]
  |  Branch (2189:80): [True: 1.75k, False: 17.4k]
  |  Branch (2189:101): [True: 3.13k, False: 14.3k]
  ------------------
 2190|  7.65k|                  break;
 2191|  7.65k|               }
 2192|  21.9k|            }
 2193|   672k|            ++it;
 2194|   672k|         }
 2195|       |
 2196|   128k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|   128k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 3.33k, False: 124k]
  ------------------
 2199|  3.33k|            ctx.error = error_code::parse_number_failure;
 2200|  3.33k|            return;
 2201|  3.33k|         }
 2202|       |
 2203|       |         // Handle hex, octal, binary
 2204|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2205|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2206|       |               int base = 10;
 2207|       |               size_t offset = 0;
 2208|       |
 2209|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2210|       |                  base = 16;
 2211|       |                  offset = 2;
 2212|       |               }
 2213|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2214|       |                  base = 8;
 2215|       |                  offset = 2;
 2216|       |               }
 2217|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2218|       |                  base = 2;
 2219|       |                  offset = 2;
 2220|       |               }
 2221|       |
 2222|       |               if (base != 10) {
 2223|       |                  const auto digits = num_str.substr(offset);
 2224|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2225|       |
 2226|       |                  std::string clean_storage;
 2227|       |                  std::string_view clean_view;
 2228|       |
 2229|       |                  if (has_underscores) {
 2230|       |                     clean_storage.reserve(digits.size());
 2231|       |                     for (char c : digits) {
 2232|       |                        if (c != '_') {
 2233|       |                           clean_storage.push_back(c);
 2234|       |                        }
 2235|       |                     }
 2236|       |                     clean_view = clean_storage;
 2237|       |                  }
 2238|       |                  else {
 2239|       |                     clean_view = digits;
 2240|       |                  }
 2241|       |
 2242|       |                  auto [ptr, ec] =
 2243|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2244|       |                  if (ec != std::errc{}) {
 2245|       |                     ctx.error = error_code::parse_number_failure;
 2246|       |                  }
 2247|       |                  finalize();
 2248|       |                  return;
 2249|       |               }
 2250|       |            }
 2251|       |         }
 2252|   124k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|   124k|            bool negative = false;
 2254|   124k|            std::string_view digits = num_str;
 2255|       |
 2256|   124k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 103k, False: 21.1k]
  |  Branch (2256:37): [True: 23.6k, False: 79.9k]
  |  Branch (2256:62): [True: 4.43k, False: 75.5k]
  ------------------
 2257|  28.0k|               negative = (digits.front() == '-');
 2258|  28.0k|               digits.remove_prefix(1);
 2259|  28.0k|            }
 2260|       |
 2261|   124k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 49.4k, False: 75.3k]
  |  Branch (2261:38): [True: 16.6k, False: 32.8k]
  ------------------
 2262|  16.6k|               int base = 10;
 2263|  16.6k|               size_t offset = 0;
 2264|       |
 2265|  16.6k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 5.95k, False: 10.6k]
  |  Branch (2265:40): [True: 1.00k, False: 9.69k]
  ------------------
 2266|  6.95k|                  base = 16;
 2267|  6.95k|                  offset = 2;
 2268|  6.95k|               }
 2269|  9.69k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 452, False: 9.24k]
  |  Branch (2269:45): [True: 1.94k, False: 7.30k]
  ------------------
 2270|  2.39k|                  base = 8;
 2271|  2.39k|                  offset = 2;
 2272|  2.39k|               }
 2273|  7.30k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 534, False: 6.76k]
  |  Branch (2273:45): [True: 1.39k, False: 5.36k]
  ------------------
 2274|  1.93k|                  base = 2;
 2275|  1.93k|                  offset = 2;
 2276|  1.93k|               }
 2277|       |
 2278|  16.6k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 11.2k, False: 5.36k]
  ------------------
 2279|  11.2k|                  auto raw_digits = digits.substr(offset);
 2280|  11.2k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  11.2k|                  std::string clean_storage;
 2283|  11.2k|                  std::string_view clean_view;
 2284|  11.2k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 2.12k, False: 9.15k]
  ------------------
 2285|  2.12k|                     clean_storage.reserve(raw_digits.size());
 2286|  33.9k|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 33.9k, False: 2.12k]
  ------------------
 2287|  33.9k|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 31.3k, False: 2.57k]
  ------------------
 2288|  31.3k|                           clean_storage.push_back(c);
 2289|  31.3k|                        }
 2290|  33.9k|                     }
 2291|  2.12k|                     clean_view = clean_storage;
 2292|  2.12k|                  }
 2293|  9.15k|                  else {
 2294|  9.15k|                     clean_view = raw_digits;
 2295|  9.15k|                  }
 2296|       |
 2297|  11.2k|                  uint64_t parsed_int{};
 2298|  11.2k|                  auto [ptr, ec] =
 2299|  11.2k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  11.2k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 5.09k, False: 6.18k]
  |  Branch (2300:44): [True: 2.13k, False: 4.05k]
  ------------------
 2301|  7.23k|                     ctx.error = error_code::parse_number_failure;
 2302|  7.23k|                     finalize();
 2303|  7.23k|                     return;
 2304|  7.23k|                  }
 2305|       |
 2306|  4.05k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  4.05k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 1.46k, False: 2.58k]
  ------------------
 2308|  4.05k|                  finalize();
 2309|  4.05k|                  return;
 2310|  11.2k|               }
 2311|  16.6k|            }
 2312|   124k|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|   113k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|   124k|         std::string clean_storage;
 2318|   124k|         std::string_view clean_view;
 2319|       |
 2320|   124k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 4.22k, False: 120k]
  ------------------
 2321|  4.22k|            clean_storage.reserve(num_str.size());
 2322|  74.2k|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 74.2k, False: 4.22k]
  ------------------
 2323|  74.2k|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 65.2k, False: 8.92k]
  ------------------
 2324|  65.2k|                  clean_storage.push_back(c);
 2325|  65.2k|               }
 2326|  74.2k|            }
 2327|  4.22k|            clean_view = clean_storage;
 2328|  4.22k|         }
 2329|   120k|         else {
 2330|   120k|            clean_view = num_str;
 2331|   120k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|   124k|         auto parse_view = clean_view;
 2336|   124k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 92.1k, False: 32.6k]
  |  Branch (2336:37): [True: 23.6k, False: 68.4k]
  ------------------
 2337|  23.6k|            parse_view.remove_prefix(1);
 2338|  23.6k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 11.2k, False: 12.3k]
  ------------------
 2339|  11.2k|               ctx.error = error_code::parse_number_failure;
 2340|  11.2k|               return;
 2341|  11.2k|            }
 2342|  23.6k|         }
 2343|       |
 2344|   113k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|   113k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2346|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2347|   113k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 77.9k, False: 35.5k]
  |  Branch (2347:45): [True: 20.6k, False: 14.9k]
  ------------------
 2348|  66.1k|               ctx.error = error_code::parse_number_failure;
 2349|  66.1k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|   113k|         finalize();
 2360|   113k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1EEELb0ERdNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EdE2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   137k|      {
  466|   137k|         skip_inline_ws(it, end);
  467|       |
  468|   137k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1.73k, False: 135k]
  ------------------
  469|  1.73k|            if constexpr (!AllowEmptyInput) {
  470|  1.73k|               ctx.error = error_code::unexpected_end;
  471|  1.73k|            }
  472|  1.73k|            return true;
  473|  1.73k|         }
  474|       |
  475|   135k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   135k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 546, False: 135k]
  ------------------
  477|    546|            ctx.error = error_code::syntax_error;
  478|    546|            return true;
  479|    546|         }
  480|   135k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 332, False: 135k]
  ------------------
  481|    332|            ctx.error = error_code::syntax_error;
  482|    332|            return true;
  483|    332|         }
  484|       |
  485|   135k|         skip_inline_ws(it, end);
  486|       |
  487|   135k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 576, False: 134k]
  ------------------
  488|    576|            if constexpr (!AllowEmptyInput) {
  489|    576|               ctx.error = error_code::unexpected_end;
  490|    576|            }
  491|    576|            return true;
  492|    576|         }
  493|       |
  494|   134k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 6.34k, False: 128k]
  ------------------
  495|  6.34k|            return true;
  496|  6.34k|         }
  497|       |
  498|   128k|         return false;
  499|   134k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2120|   135k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|   135k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   135k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|   135k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   134k|      {
  409|   134k|         state.has_anchor = false;
  410|   134k|         state.anchor_name.clear();
  411|   134k|         state.anchor_start = nullptr;
  412|   134k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   134k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   134k|            else {
  421|   134k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.13k, False: 129k]
  ------------------
  422|   134k|            }
  423|   134k|         }
  424|       |
  425|   134k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 129k, False: 5.13k]
  |  Branch (425:27): [True: 14.6k, False: 114k]
  ------------------
  426|  14.6k|            ++it;
  427|  14.6k|            auto name = parse_anchor_name(it, end);
  428|  14.6k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 598, False: 14.0k]
  ------------------
  429|    598|               ctx.error = error_code::syntax_error;
  430|    598|               return true;
  431|    598|            }
  432|  14.0k|            skip_inline_ws(it, end);
  433|  14.0k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 608, False: 13.4k]
  ------------------
  434|    608|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    608|                  ctx.error = error_code::unexpected_end;
  436|    608|               }
  437|    608|               return true;
  438|    608|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  13.4k|            state.has_anchor = true;
  446|  13.4k|            state.anchor_name = std::string(name);
  447|  13.4k|            state.anchor_start = &*it;
  448|  13.4k|         }
  449|       |
  450|   133k|         return false;
  451|   134k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   134k|      {
  301|   134k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 134k]
  |  Branch (301:27): [True: 129k, False: 5.13k]
  ------------------
  302|       |
  303|  5.13k|         ++it; // skip '*'
  304|  5.13k|         auto name = parse_anchor_name(it, end);
  305|  5.13k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 1.02k, False: 4.11k]
  ------------------
  306|  1.02k|            ctx.error = error_code::syntax_error;
  307|  1.02k|            return true;
  308|  1.02k|         }
  309|       |
  310|  4.11k|         auto anchor_it = ctx.anchors.find(name);
  311|  4.11k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 1.57k, False: 2.54k]
  ------------------
  312|  1.57k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  1.57k|            return true;
  314|  1.57k|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  2.54k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.54k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.14k, False: 1.40k]
  ------------------
  322|  1.14k|            return true;
  323|  1.14k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  1.40k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 104, False: 1.29k]
  ------------------
  329|    104|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    104|            return true;
  331|    104|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  1.29k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.29k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 10, False: 1.28k]
  ------------------
  339|     10|            return true;
  340|       |
  341|  1.28k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.28k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  1.28k|         auto replay_it = span.begin;
  348|  1.28k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.28k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.28k|         ctx.indent_stack.clear();
  353|  1.28k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 360, False: 928]
  ------------------
  354|    360|            ctx.push_indent(span.base_indent - 1);
  355|    360|         }
  356|       |
  357|  1.28k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.28k|         using V = std::remove_cvref_t<T>;
  360|  1.28k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.28k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.28k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.28k|         return true;
  367|  1.28k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|   113k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|  56.9k|      {
 5284|  56.9k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|  56.9k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|  56.9k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|  56.9k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|  56.9k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 56.9k, False: 0]
  ------------------
 5294|  56.9k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|  56.9k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2080|  63.0k|      {
 2081|  63.0k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 63.0k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  63.0k|         yaml::node_preamble_state preamble{};
 2085|  63.0k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 7.87k, False: 55.2k]
  ------------------
 2086|  63.0k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  7.87k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  55.2k|         std::string str;
 2091|  55.2k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  55.2k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 5.30k, False: 49.9k]
  |  Branch (2093:31): [True: 9.05k, False: 40.8k]
  |  Branch (2093:48): [True: 2.24k, False: 38.5k]
  |  Branch (2093:65): [True: 348, False: 38.2k]
  |  Branch (2093:81): [True: 708, False: 37.5k]
  |  Branch (2093:97): [True: 1.54k, False: 36.0k]
  ------------------
 2094|  36.0k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 1.13k, False: 34.8k]
  |  Branch (2094:29): [True: 332, False: 34.5k]
  |  Branch (2094:44): [True: 884, False: 33.6k]
  ------------------
 2095|  21.5k|            value = true;
 2096|  21.5k|         }
 2097|  33.6k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 5.34k, False: 28.3k]
  |  Branch (2097:37): [True: 854, False: 27.4k]
  |  Branch (2097:55): [True: 408, False: 27.0k]
  |  Branch (2097:73): [True: 1.08k, False: 25.9k]
  |  Branch (2097:88): [True: 22.1k, False: 3.83k]
  |  Branch (2097:103): [True: 598, False: 3.23k]
  ------------------
 2098|  33.5k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 870, False: 2.36k]
  |  Branch (2098:35): [True: 1.49k, False: 872]
  |  Branch (2098:51): [True: 738, False: 134]
  ------------------
 2099|  33.5k|            value = false;
 2100|  33.5k|         }
 2101|    134|         else {
 2102|    134|            ctx.error = error_code::expected_true_or_false;
 2103|    134|         }
 2104|       |
 2105|  55.2k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  55.2k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  63.0k|      {
  466|  63.0k|         skip_inline_ws(it, end);
  467|       |
  468|  63.0k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 16, False: 63.0k]
  ------------------
  469|     16|            if constexpr (!AllowEmptyInput) {
  470|     16|               ctx.error = error_code::unexpected_end;
  471|     16|            }
  472|     16|            return true;
  473|     16|         }
  474|       |
  475|  63.0k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  63.0k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 8, False: 63.0k]
  ------------------
  477|      8|            ctx.error = error_code::syntax_error;
  478|      8|            return true;
  479|      8|         }
  480|  63.0k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 63.0k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  63.0k|         skip_inline_ws(it, end);
  486|       |
  487|  63.0k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 63.0k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  63.0k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 7.83k, False: 55.2k]
  ------------------
  495|  7.83k|            return true;
  496|  7.83k|         }
  497|       |
  498|  55.2k|         return false;
  499|  63.0k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2086|  63.0k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1EEERbNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  63.0k|      {
  409|  63.0k|         state.has_anchor = false;
  410|  63.0k|         state.anchor_name.clear();
  411|  63.0k|         state.anchor_start = nullptr;
  412|  63.0k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  63.0k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  63.0k|            else {
  421|  63.0k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 7.80k, False: 55.2k]
  ------------------
  422|  63.0k|            }
  423|  63.0k|         }
  424|       |
  425|  63.0k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 55.2k, False: 7.80k]
  |  Branch (425:27): [True: 1.94k, False: 53.2k]
  ------------------
  426|  1.94k|            ++it;
  427|  1.94k|            auto name = parse_anchor_name(it, end);
  428|  1.94k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 10, False: 1.93k]
  ------------------
  429|     10|               ctx.error = error_code::syntax_error;
  430|     10|               return true;
  431|     10|            }
  432|  1.93k|            skip_inline_ws(it, end);
  433|  1.93k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 22, False: 1.91k]
  ------------------
  434|     22|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     22|                  ctx.error = error_code::unexpected_end;
  436|     22|               }
  437|     22|               return true;
  438|     22|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  1.91k|            state.has_anchor = true;
  446|  1.91k|            state.anchor_name = std::string(name);
  447|  1.91k|            state.anchor_start = &*it;
  448|  1.91k|         }
  449|       |
  450|  63.0k|         return false;
  451|  63.0k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  63.0k|      {
  301|  63.0k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 63.0k]
  |  Branch (301:27): [True: 55.2k, False: 7.80k]
  ------------------
  302|       |
  303|  7.80k|         ++it; // skip '*'
  304|  7.80k|         auto name = parse_anchor_name(it, end);
  305|  7.80k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 18, False: 7.78k]
  ------------------
  306|     18|            ctx.error = error_code::syntax_error;
  307|     18|            return true;
  308|     18|         }
  309|       |
  310|  7.78k|         auto anchor_it = ctx.anchors.find(name);
  311|  7.78k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 44, False: 7.74k]
  ------------------
  312|     44|            ctx.error = error_code::syntax_error; // undefined alias
  313|     44|            return true;
  314|     44|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  7.74k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  7.74k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.61k, False: 6.12k]
  ------------------
  322|  1.61k|            return true;
  323|  1.61k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  6.12k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 22, False: 6.10k]
  ------------------
  329|     22|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     22|            return true;
  331|     22|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  6.10k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  6.10k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 6.10k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  6.10k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 6.10k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  6.10k|         auto replay_it = span.begin;
  348|  6.10k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  6.10k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  6.10k|         ctx.indent_stack.clear();
  353|  6.10k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 5.89k, False: 202]
  ------------------
  354|  5.89k|            ctx.push_indent(span.base_indent - 1);
  355|  5.89k|         }
  356|       |
  357|  6.10k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  6.10k|         using V = std::remove_cvref_t<T>;
  360|  6.10k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  6.10k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  6.10k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  6.10k|         return true;
  367|  6.10k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2466|  23.4k|      {
 2467|  23.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 23.4k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  23.4k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  23.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 6, False: 23.4k]
  ------------------
 2473|      6|            ctx.error = error_code::unexpected_end;
 2474|      6|            return;
 2475|      6|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  23.4k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 9.63k, False: 13.8k]
  ------------------
 2479|  9.63k|            ++it;
 2480|  9.63k|            return;
 2481|  9.63k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  13.8k|         auto start = it;
 2485|  65.9k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 63.7k, False: 2.15k]
  |  Branch (2485:30): [True: 52.0k, False: 11.6k]
  ------------------
 2486|  52.0k|            ++it;
 2487|  52.0k|         }
 2488|       |
 2489|  13.8k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  13.8k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 46, False: 13.7k]
  ------------------
 2491|     46|            ctx.error = error_code::syntax_error;
 2492|     46|         }
 2493|  13.8k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   331k|      {
 5284|   331k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   331k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   331k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   331k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   331k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 331k, False: 0]
  ------------------
 5294|   331k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   331k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4176|   333k|      {
 4177|   333k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4177:14): [True: 0, False: 333k]
  ------------------
 4178|      0|            return;
 4179|       |
 4180|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4181|   333k|         auto peek = it;
 4182|   333k|         yaml::node_preamble_state preamble{};
 4183|   333k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4183:14): [True: 3.67k, False: 329k]
  ------------------
 4184|   333k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4185|  3.67k|            it = peek;
 4186|  3.67k|            return;
 4187|  3.67k|         }
 4188|       |
 4189|   329k|         if (*peek == '[') {
  ------------------
  |  Branch (4189:14): [True: 66.3k, False: 263k]
  ------------------
 4190|       |            // Flow sequence - consume whitespace and parse
 4191|  66.3k|            it = peek;
 4192|  66.3k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4193|  66.3k|         }
 4194|   263k|         else if (*peek == '-') {
  ------------------
  |  Branch (4194:19): [True: 263k, False: 110]
  ------------------
 4195|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4196|       |            // But if there was a tag, we need to advance past it
 4197|   263k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4197:17): [True: 2.45k, False: 260k]
  |  Branch (4197:57): [True: 5.19k, False: 255k]
  ------------------
 4198|  7.65k|               it = peek;
 4199|  7.65k|            }
 4200|   263k|            int32_t seq_indent = ctx.current_indent();
 4201|   263k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4201:17): [True: 261k, False: 1.25k]
  |  Branch (4201:31): [True: 117k, False: 144k]
  ------------------
 4202|   117k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4202:29): [True: 59.2k, False: 58.2k]
  |  Branch (4202:62): [True: 53.5k, False: 5.72k]
  ------------------
 4203|   117k|                                                          : (ctx.current_indent() + 1);
 4204|   117k|            }
 4205|   263k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4206|   263k|         }
 4207|    110|         else {
 4208|    110|            ctx.error = error_code::syntax_error;
 4209|    110|         }
 4210|       |
 4211|   329k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4212|   329k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1EEELb0ERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_ZNS_4fromILj450ESC_E2opITnDaXtlS2_Lj10ELb1ELb0ELb0ELb1EEERSG_SD_TkNS_10is_contextERSE_SG_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSP_RSS_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   333k|      {
  466|   333k|         skip_inline_ws(it, end);
  467|       |
  468|   333k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 18, False: 333k]
  ------------------
  469|     18|            if constexpr (!AllowEmptyInput) {
  470|     18|               ctx.error = error_code::unexpected_end;
  471|     18|            }
  472|     18|            return true;
  473|     18|         }
  474|       |
  475|   333k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   333k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 333k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   333k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 333k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   333k|         skip_inline_ws(it, end);
  486|       |
  487|   333k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 333k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   333k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.64k, False: 329k]
  ------------------
  495|  3.64k|            return true;
  496|  3.64k|         }
  497|       |
  498|   329k|         return false;
  499|   333k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_ENKUlNSH_8yaml_tagEE_clESR_:
 4184|   333k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   333k|      {
  409|   333k|         state.has_anchor = false;
  410|   333k|         state.anchor_name.clear();
  411|   333k|         state.anchor_start = nullptr;
  412|   333k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   333k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   333k|            else {
  421|   333k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.61k, False: 329k]
  ------------------
  422|   333k|            }
  423|   333k|         }
  424|       |
  425|   333k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 329k, False: 3.61k]
  |  Branch (425:27): [True: 5.80k, False: 323k]
  ------------------
  426|  5.80k|            ++it;
  427|  5.80k|            auto name = parse_anchor_name(it, end);
  428|  5.80k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 10, False: 5.79k]
  ------------------
  429|     10|               ctx.error = error_code::syntax_error;
  430|     10|               return true;
  431|     10|            }
  432|  5.79k|            skip_inline_ws(it, end);
  433|  5.79k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 16, False: 5.77k]
  ------------------
  434|     16|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     16|                  ctx.error = error_code::unexpected_end;
  436|     16|               }
  437|     16|               return true;
  438|     16|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  5.77k|            state.has_anchor = true;
  446|  5.77k|            state.anchor_name = std::string(name);
  447|  5.77k|            state.anchor_start = &*it;
  448|  5.77k|         }
  449|       |
  450|   333k|         return false;
  451|   333k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   333k|      {
  301|   333k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 333k]
  |  Branch (301:27): [True: 329k, False: 3.61k]
  ------------------
  302|       |
  303|  3.61k|         ++it; // skip '*'
  304|  3.61k|         auto name = parse_anchor_name(it, end);
  305|  3.61k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 24, False: 3.59k]
  ------------------
  306|     24|            ctx.error = error_code::syntax_error;
  307|     24|            return true;
  308|     24|         }
  309|       |
  310|  3.59k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.59k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 38, False: 3.55k]
  ------------------
  312|     38|            ctx.error = error_code::syntax_error; // undefined alias
  313|     38|            return true;
  314|     38|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  3.55k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.55k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.83k, False: 1.72k]
  ------------------
  322|  1.83k|            return true;
  323|  1.83k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  1.72k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 44, False: 1.68k]
  ------------------
  329|     44|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     44|            return true;
  331|     44|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  1.68k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.68k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 8, False: 1.67k]
  ------------------
  339|      8|            return true;
  340|       |
  341|  1.67k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.67k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  1.67k|         auto replay_it = span.begin;
  348|  1.67k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.67k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.67k|         ctx.indent_stack.clear();
  353|  1.67k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 622, False: 1.05k]
  ------------------
  354|    622|            ctx.push_indent(span.base_indent - 1);
  355|    622|         }
  356|       |
  357|  1.67k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.67k|         using V = std::remove_cvref_t<T>;
  360|  1.67k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.67k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.67k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.67k|         return true;
  367|  1.67k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  66.3k|      {
 2665|  66.3k|         using V = std::remove_cvref_t<T>;
 2666|  66.3k|         using value_type = typename V::value_type;
 2667|       |
 2668|  66.3k|         struct sequence_container_adapter
 2669|  66.3k|         {
 2670|  66.3k|            size_t index = 0;
 2671|       |
 2672|  66.3k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  66.3k|            {
 2674|  66.3k|               if constexpr (!resizable<V>) {
 2675|  66.3k|                  return index >= container.size();
 2676|  66.3k|               }
 2677|  66.3k|               else {
 2678|  66.3k|                  (void)container;
 2679|  66.3k|                  return false;
 2680|  66.3k|               }
 2681|  66.3k|            }
 2682|       |
 2683|  66.3k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  66.3k|            inline void append(V& container, value_type&& element) noexcept
 2686|  66.3k|            {
 2687|  66.3k|               if constexpr (emplace_backable<V>) {
 2688|  66.3k|                  container.emplace_back(std::move(element));
 2689|  66.3k|               }
 2690|  66.3k|               else if constexpr (emplaceable<V>) {
 2691|  66.3k|                  container.emplace(std::move(element));
 2692|  66.3k|               }
 2693|  66.3k|            }
 2694|  66.3k|         };
 2695|       |
 2696|  66.3k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 66.3k]
  |  Branch (2696:27): [True: 0, False: 66.3k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|  66.3k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  66.3k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  66.3k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  66.3k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 6, False: 66.3k]
  ------------------
 2709|      6|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  66.3k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 65.1k, False: 1.22k]
  |  Branch (2712:27): [True: 10.6k, False: 54.4k]
  ------------------
 2713|  10.6k|            ++it;
 2714|  10.6k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  10.6k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 6, False: 10.6k]
  ------------------
 2716|      6|               return;
 2717|  10.6k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|  10.6k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2718:20): [True: 1.88k, False: 8.75k]
  ------------------
 2719|  1.88k|                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|  1.88k|               }
 2721|  10.6k|            }
 2722|  10.6k|            return;
 2723|  10.6k|         }
 2724|       |
 2725|  55.7k|         bool just_saw_comma = false;
 2726|  55.7k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  55.7k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|  85.8k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 82.1k, False: 3.70k]
  ------------------
 2731|  82.1k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|  82.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 82.1k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|  82.1k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 82.1k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|  82.1k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 15.6k, False: 66.4k]
  ------------------
 2741|  15.6k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 15.6k, False: 0]
  ------------------
 2742|  15.6k|                     ++it;
 2743|  15.6k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  15.6k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 6, False: 15.6k]
  ------------------
 2745|      6|                        return;
 2746|  15.6k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|  15.6k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2747:29): [True: 4.02k, False: 11.5k]
  ------------------
 2748|  4.02k|                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|  4.02k|                        }
 2750|  15.6k|                     }
 2751|  15.6k|                     return;
 2752|  15.6k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  15.6k|               }
 2756|       |
 2757|  66.4k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 6, False: 66.4k]
  |  Branch (2757:34): [True: 14, False: 66.4k]
  ------------------
 2758|     20|                  ctx.error = error_code::syntax_error;
 2759|     20|                  return;
 2760|     20|               }
 2761|  66.4k|               just_saw_comma = false;
 2762|       |
 2763|  66.4k|               value_type element{};
 2764|  66.4k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|  66.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 12.8k, False: 53.6k]
  ------------------
 2767|  12.8k|                  return;
 2768|       |
 2769|  53.6k|               bool saw_line_break_before_separator = false;
 2770|  53.6k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|  53.6k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 52, False: 53.5k]
  ------------------
 2772|     52|                  return;
 2773|       |
 2774|  53.5k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 51.8k, False: 1.69k]
  |  Branch (2774:33): [True: 7.58k, False: 44.2k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  7.58k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 6, False: 7.57k]
  ------------------
 2777|      6|                     ctx.error = error_code::syntax_error;
 2778|      6|                     return;
 2779|      6|                  }
 2780|  7.57k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  7.57k|                     glz::generic key_node = std::move(element);
 2782|  7.57k|                     ++it;
 2783|  7.57k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  7.57k|                     glz::generic mapped{};
 2786|  7.57k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  7.57k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 188, False: 7.38k]
  ------------------
 2788|    188|                        return;
 2789|       |
 2790|  7.38k|                     std::string key;
 2791|  7.38k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 0, False: 7.38k]
  ------------------
 2792|      0|                        return;
 2793|       |
 2794|  7.38k|                     glz::generic pair{};
 2795|  7.38k|                     pair[key] = std::move(mapped);
 2796|  7.38k|                     element = std::move(pair);
 2797|       |
 2798|  7.38k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  7.38k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 4, False: 7.38k]
  ------------------
 2800|      4|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  7.57k|               }
 2807|       |
 2808|  53.5k|               adapter.append(value, std::move(element));
 2809|       |
 2810|  53.5k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 1.73k, False: 51.8k]
  ------------------
 2811|  1.73k|                  ctx.error = error_code::unexpected_end;
 2812|  1.73k|                  return;
 2813|  1.73k|               }
 2814|       |
 2815|  51.8k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 21.1k, False: 30.6k]
  ------------------
 2816|  21.1k|                  ++it;
 2817|  21.1k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  21.1k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 6, False: 21.1k]
  ------------------
 2819|      6|                     return;
 2820|  21.1k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|  21.1k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2821:26): [True: 7.02k, False: 14.1k]
  ------------------
 2822|  7.02k|                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|  7.02k|                     }
 2824|  21.1k|                  }
 2825|  21.1k|                  return;
 2826|  21.1k|               }
 2827|  30.6k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 30.0k, False: 574]
  ------------------
 2828|  30.0k|                  ++it;
 2829|  30.0k|                  just_saw_comma = true;
 2830|  30.0k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  30.0k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 6, False: 30.0k]
  ------------------
 2832|      6|                     return;
 2833|  30.0k|               }
 2834|    574|               else {
 2835|    574|                  ctx.error = error_code::syntax_error;
 2836|    574|                  return;
 2837|    574|               }
 2838|  51.8k|            }
 2839|       |         }
 2840|       |         else if constexpr (!resizable<V>) {
 2841|       |            // Fixed-size containers (std::array)
 2842|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2843|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2844|       |               if (bool(ctx.error)) [[unlikely]]
 2845|       |                  return;
 2846|       |
 2847|       |               if (it == end) [[unlikely]] {
 2848|       |                  ctx.error = error_code::unexpected_end;
 2849|       |                  return;
 2850|       |               }
 2851|       |
 2852|       |               if (*it == ']') {
 2853|       |                  if (just_saw_comma) {
 2854|       |                     ++it;
 2855|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2856|       |                     if (bool(ctx.error)) [[unlikely]]
 2857|       |                        return;
 2858|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2859|       |                        if (ctx.current_indent() < 0) {
 2860|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2861|       |                        }
 2862|       |                     }
 2863|       |                     return;
 2864|       |                  }
 2865|       |                  ctx.error = error_code::syntax_error;
 2866|       |                  return;
 2867|       |               }
 2868|       |
 2869|       |               if (*it == ',' || *it == '#') {
 2870|       |                  ctx.error = error_code::syntax_error;
 2871|       |                  return;
 2872|       |               }
 2873|       |               just_saw_comma = false;
 2874|       |
 2875|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2876|       |
 2877|       |               if (bool(ctx.error)) [[unlikely]]
 2878|       |                  return;
 2879|       |
 2880|       |               adapter.commit_fixed_slot();
 2881|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2882|       |               if (bool(ctx.error)) [[unlikely]]
 2883|       |                  return;
 2884|       |
 2885|       |               if (it == end) [[unlikely]] {
 2886|       |                  ctx.error = error_code::unexpected_end;
 2887|       |                  return;
 2888|       |               }
 2889|       |
 2890|       |               if (*it == ']') {
 2891|       |                  ++it;
 2892|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2893|       |                  if (bool(ctx.error)) [[unlikely]]
 2894|       |                     return;
 2895|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2896|       |                     if (ctx.current_indent() < 0) {
 2897|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2898|       |                     }
 2899|       |                  }
 2900|       |                  return;
 2901|       |               }
 2902|       |               else if (*it == ',') {
 2903|       |                  ++it;
 2904|       |                  just_saw_comma = true;
 2905|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2906|       |                  if (bool(ctx.error)) [[unlikely]]
 2907|       |                     return;
 2908|       |               }
 2909|       |               else {
 2910|       |                  ctx.error = error_code::syntax_error;
 2911|       |                  return;
 2912|       |               }
 2913|       |            }
 2914|       |
 2915|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2916|       |            // skip to the closing bracket to consume overflow elements.
 2917|       |            int bracket_depth = 1;
 2918|       |            while (it != end && bracket_depth > 0) {
 2919|       |               if (*it == '[') {
 2920|       |                  ++bracket_depth;
 2921|       |               }
 2922|       |               else if (*it == ']') {
 2923|       |                  --bracket_depth;
 2924|       |               }
 2925|       |               ++it;
 2926|       |            }
 2927|       |         }
 2928|       |         else {
 2929|       |            ctx.error = error_code::syntax_error;
 2930|       |            return;
 2931|       |         }
 2932|  55.7k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   329k|      {
 2649|   329k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   329k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   329k|               value.clear();
 2653|   329k|            }
 2654|       |         }
 2655|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2656|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2657|       |            value.clear();
 2658|       |         }
 2659|   329k|      }
_ZN3glz4yaml35validate_root_flow_tail_after_closeINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_:
  965|  19.1k|      {
  966|  19.1k|         auto is_document_start = [&](auto pos) {
  967|  19.1k|            if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  968|  19.1k|               auto after = pos + 3;
  969|  19.1k|               return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  970|  19.1k|                      *after == '#';
  971|  19.1k|            }
  972|  19.1k|            return false;
  973|  19.1k|         };
  974|       |
  975|  19.1k|         bool at_line_start = false;
  976|  19.1k|         auto tail = it;
  977|  40.9k|         while (tail != end) {
  ------------------
  |  Branch (977:17): [True: 25.8k, False: 15.0k]
  ------------------
  978|  25.8k|            auto line = tail;
  979|  25.8k|            skip_inline_ws(line, end);
  980|       |
  981|  25.8k|            if (line == end) {
  ------------------
  |  Branch (981:17): [True: 1.30k, False: 24.5k]
  ------------------
  982|  1.30k|               return;
  983|  1.30k|            }
  984|       |
  985|  24.5k|            if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (985:17): [True: 3.16k, False: 21.3k]
  |  Branch (985:34): [True: 10.3k, False: 11.0k]
  ------------------
  986|  13.4k|               tail = line;
  987|  13.4k|               skip_newline(tail, end);
  988|  13.4k|               at_line_start = true;
  989|  13.4k|               continue;
  990|  13.4k|            }
  991|       |
  992|  11.0k|            if (*line == '#') {
  ------------------
  |  Branch (992:17): [True: 8.54k, False: 2.52k]
  ------------------
  993|  8.54k|               if (!at_line_start && line == it) {
  ------------------
  |  Branch (993:20): [True: 2.18k, False: 6.36k]
  |  Branch (993:38): [True: 24, False: 2.15k]
  ------------------
  994|     24|                  ctx.error = error_code::syntax_error;
  995|     24|                  return;
  996|     24|               }
  997|  8.52k|               tail = line;
  998|  8.52k|               skip_comment(tail, end);
  999|  8.52k|               if (tail != end && (*tail == '\n' || *tail == '\r')) {
  ------------------
  |  Branch (999:20): [True: 8.30k, False: 216]
  |  Branch (999:36): [True: 6.75k, False: 1.55k]
  |  Branch (999:53): [True: 1.52k, False: 32]
  ------------------
 1000|  8.27k|                  skip_newline(tail, end);
 1001|  8.27k|                  at_line_start = true;
 1002|  8.27k|                  continue;
 1003|  8.27k|               }
 1004|    248|               return;
 1005|  8.52k|            }
 1006|       |
 1007|  2.52k|            if (at_line_start && (at_document_end(line, end) || is_document_start(line))) {
  ------------------
  |  Branch (1007:17): [True: 2.01k, False: 502]
  |  Branch (1007:35): [True: 1.36k, False: 652]
  |  Branch (1007:65): [True: 404, False: 248]
  ------------------
 1008|  1.77k|               return;
 1009|  1.77k|            }
 1010|       |
 1011|    750|            ctx.error = error_code::syntax_error;
 1012|    750|            return;
 1013|  2.52k|         }
 1014|  19.1k|      }
_ZZN3glz4yaml35validate_root_flow_tail_after_closeINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_ENKUlS5_E_clIS4_EEDaS5_:
  966|    652|         auto is_document_start = [&](auto pos) {
  967|    652|            if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (967:17): [True: 536, False: 116]
  |  Branch (967:35): [True: 440, False: 96]
  |  Branch (967:52): [True: 416, False: 24]
  |  Branch (967:69): [True: 410, False: 6]
  ------------------
  968|    410|               auto after = pos + 3;
  969|    410|               return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (969:23): [True: 68, False: 342]
  |  Branch (969:39): [True: 70, False: 272]
  |  Branch (969:56): [True: 76, False: 196]
  |  Branch (969:74): [True: 68, False: 128]
  |  Branch (969:92): [True: 66, False: 62]
  ------------------
  970|     62|                      *after == '#';
  ------------------
  |  Branch (970:23): [True: 56, False: 6]
  ------------------
  971|    410|            }
  972|    242|            return false;
  973|    652|         };
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2686|  53.3k|            {
 2687|  53.3k|               if constexpr (emplace_backable<V>) {
 2688|  53.3k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|  53.3k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|   263k|      {
 3160|   263k|         using V = std::remove_cvref_t<T>;
 3161|   263k|         using value_type = typename V::value_type;
 3162|       |
 3163|   263k|         struct sequence_container_adapter
 3164|   263k|         {
 3165|   263k|            size_t index = 0;
 3166|       |
 3167|   263k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|   263k|            {
 3169|   263k|               if constexpr (!resizable<V>) {
 3170|   263k|                  return index >= container.size();
 3171|   263k|               }
 3172|   263k|               else {
 3173|   263k|                  (void)container;
 3174|   263k|                  return false;
 3175|   263k|               }
 3176|   263k|            }
 3177|       |
 3178|   263k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|   263k|            inline void append(V& container, value_type&& element) noexcept
 3181|   263k|            {
 3182|   263k|               if constexpr (emplace_backable<V>) {
 3183|   263k|                  container.emplace_back(std::move(element));
 3184|   263k|               }
 3185|   263k|               else if constexpr (emplaceable<V>) {
 3186|   263k|                  container.emplace(std::move(element));
 3187|   263k|               }
 3188|   263k|            }
 3189|   263k|         };
 3190|       |
 3191|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3192|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3193|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3194|   263k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|   263k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|   263k|         bool first_item = true;
 3200|   263k|         bool has_pending_item_anchor = false;
 3201|   263k|         std::string pending_item_anchor_name{};
 3202|   263k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   738k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 620k, False: 118k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   620k|            int32_t line_indent = 0;
 3215|   620k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   620k|            auto line_start = it;
 3217|       |
 3218|   956k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 907k, False: 48.9k]
  ------------------
 3219|   907k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 52.1k, False: 855k]
  ------------------
 3220|  52.1k|                  skip_comment(it, end);
 3221|  52.1k|                  skip_newline(it, end);
 3222|  52.1k|                  line_start = it;
 3223|  52.1k|                  line_indent = 0;
 3224|  52.1k|               }
 3225|   855k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 58.9k, False: 796k]
  |  Branch (3225:40): [True: 169k, False: 626k]
  ------------------
 3226|   228k|                  skip_newline(it, end);
 3227|   228k|                  line_start = it;
 3228|   228k|                  line_indent = 0;
 3229|   228k|               }
 3230|   626k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 80.8k, False: 545k]
  ------------------
 3231|  80.8k|                  line_start = it;
 3232|  80.8k|                  line_indent = 0;
 3233|  1.31M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 1.30M, False: 10.8k]
  |  Branch (3233:39): [True: 1.23M, False: 70.0k]
  ------------------
 3234|  1.23M|                     ++line_indent;
 3235|  1.23M|                     ++it;
 3236|  1.23M|                  }
 3237|       |
 3238|  80.8k|                  bool saw_tab = false;
 3239|  87.7k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 76.1k, False: 11.5k]
  |  Branch (3239:40): [True: 2.23k, False: 73.9k]
  |  Branch (3239:54): [True: 4.57k, False: 69.3k]
  ------------------
 3240|  6.81k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 2.83k, False: 3.98k]
  |  Branch (3240:43): [True: 3.98k, False: 0]
  ------------------
 3241|  6.81k|                     ++it;
 3242|  6.81k|                  }
 3243|       |
 3244|  80.8k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 11.5k, False: 69.3k]
  |  Branch (3244:36): [True: 2.43k, False: 66.9k]
  |  Branch (3244:51): [True: 14.2k, False: 52.6k]
  |  Branch (3244:66): [True: 12.5k, False: 40.0k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  40.8k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 29.3k, False: 11.5k]
  |  Branch (3246:39): [True: 12.5k, False: 16.7k]
  ------------------
 3247|  12.5k|                        skip_comment(it, end);
 3248|  12.5k|                     }
 3249|  40.8k|                     line_indent = 0;
 3250|  40.8k|                     continue;
 3251|  40.8k|                  }
 3252|       |
 3253|  40.0k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 34, False: 40.0k]
  ------------------
 3254|     34|                     ctx.error = error_code::syntax_error;
 3255|     34|                     return;
 3256|     34|                  }
 3257|  40.0k|                  break; // Found content
 3258|  40.0k|               }
 3259|   545k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 14.8k, False: 531k]
  ------------------
 3260|  14.8k|                  line_start = it;
 3261|  43.9k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 43.2k, False: 706]
  |  Branch (3261:40): [True: 2.83k, False: 40.4k]
  |  Branch (3261:54): [True: 26.2k, False: 14.1k]
  ------------------
 3262|  14.8k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 706, False: 14.1k]
  |  Branch (3262:36): [True: 4.46k, False: 9.69k]
  |  Branch (3262:51): [True: 1.49k, False: 8.19k]
  |  Branch (3262:66): [True: 8.15k, False: 38]
  ------------------
 3263|  14.8k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 14.1k, False: 706]
  |  Branch (3263:39): [True: 8.15k, False: 5.96k]
  ------------------
 3264|  8.15k|                        skip_comment(it, end);
 3265|  8.15k|                     }
 3266|  14.8k|                     line_indent = 0;
 3267|  14.8k|                     continue;
 3268|  14.8k|                  }
 3269|     38|                  ctx.error = error_code::syntax_error;
 3270|     38|                  return;
 3271|  14.8k|               }
 3272|   531k|               else {
 3273|       |                  // At content (no leading space on this line)
 3274|       |                  // If first item and at '-', whitespace was consumed by caller;
 3275|       |                  // treat as having correct indentation
 3276|   531k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 263k, False: 267k]
  |  Branch (3276:37): [True: 261k, False: 1.25k]
  ------------------
 3277|   261k|                     line_indent = sequence_indent;
 3278|   261k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   261k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 261k, False: 0]
  |  Branch (3279:49): [True: 261k, False: 0]
  ------------------
 3280|   261k|                           auto probe = it;
 3281|   261k|                           int32_t leading_ws = 0;
 3282|   261k|                           bool saw_tab = false;
 3283|   509k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 509k, False: 0]
  |  Branch (3283:64): [True: 241k, False: 267k]
  |  Branch (3283:87): [True: 5.38k, False: 261k]
  ------------------
 3284|   247k|                              --probe;
 3285|   247k|                              ++leading_ws;
 3286|   247k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 268, False: 246k]
  |  Branch (3286:52): [True: 5.18k, False: 241k]
  ------------------
 3287|   247k|                           }
 3288|   261k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 0, False: 261k]
  |  Branch (3288:61): [True: 24.8k, False: 237k]
  |  Branch (3288:85): [True: 90.0k, False: 146k]
  ------------------
 3289|   114k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 12, False: 114k]
  ------------------
 3290|     12|                                 ctx.error = error_code::syntax_error;
 3291|     12|                                 return;
 3292|     12|                              }
 3293|   114k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|   114k|                           }
 3295|   261k|                        }
 3296|   261k|                     }
 3297|   261k|                  }
 3298|   261k|                  break;
 3299|   531k|               }
 3300|   907k|            }
 3301|       |
 3302|   620k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 48.9k, False: 571k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   571k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 3.84k, False: 567k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   567k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 19.4k, False: 547k]
  ------------------
 3309|  19.4k|               it = line_start;
 3310|  19.4k|               return;
 3311|  19.4k|            }
 3312|       |
 3313|   547k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 30.8k, False: 517k]
  ------------------
 3314|       |               // Standalone anchor lines before "- item" are only supported for
 3315|       |               // indentless mapping values. At top-level block sequences these are
 3316|       |               // malformed in yaml-test-suite cases.
 3317|  30.8k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 20, False: 30.8k]
  ------------------
 3318|     20|                  ctx.error = error_code::syntax_error;
 3319|     20|                  return;
 3320|     20|               }
 3321|       |
 3322|  30.8k|               ++it;
 3323|  30.8k|               auto pending_name = parse_anchor_name(it, end);
 3324|  30.8k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 16, False: 30.8k]
  ------------------
 3325|     16|                  ctx.error = error_code::syntax_error;
 3326|     16|                  return;
 3327|     16|               }
 3328|  30.8k|               skip_inline_ws(it, end);
 3329|  30.8k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 30.8k, False: 20]
  |  Branch (3329:33): [True: 3.32k, False: 27.4k]
  ------------------
 3330|  3.32k|                  skip_comment(it, end);
 3331|  3.32k|               }
 3332|       |
 3333|  30.8k|               has_pending_item_anchor = true;
 3334|  30.8k|               pending_item_anchor_name = std::string(pending_name);
 3335|  30.8k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  30.8k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 20, False: 30.8k]
  |  Branch (3337:34): [True: 20.9k, False: 9.84k]
  |  Branch (3337:49): [True: 26, False: 20.9k]
  ------------------
 3338|     46|                  ctx.error = error_code::syntax_error;
 3339|     46|                  return;
 3340|     46|               }
 3341|       |
 3342|  30.7k|               skip_newline(it, end);
 3343|  30.7k|               continue;
 3344|  30.8k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   517k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 61.8k, False: 455k]
  ------------------
 3348|  61.8k|               it = line_start;
 3349|  61.8k|               return;
 3350|  61.8k|            }
 3351|       |
 3352|       |            // Compute the actual column of this sequence dash.
 3353|       |            // This is needed by plain-scalar multiline folding to distinguish
 3354|       |            // sibling "- item" entries from deeper "- " continuation content.
 3355|   455k|            dash_col = line_indent;
 3356|   455k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   455k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 455k, False: 12]
  ------------------
 3358|   455k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   455k|               }
 3360|   455k|            }
 3361|       |
 3362|   455k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   455k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 436k, False: 18.4k]
  |  Branch (3365:30): [True: 6.65k, False: 430k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  6.65k|               it = line_start;
 3368|  6.65k|               return;
 3369|  6.65k|            }
 3370|       |
 3371|   448k|            bool saw_tab_after_dash = false;
 3372|   738k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 714k, False: 24.0k]
  |  Branch (3372:34): [True: 199k, False: 515k]
  |  Branch (3372:48): [True: 90.9k, False: 424k]
  ------------------
 3373|   290k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 2.66k, False: 287k]
  |  Branch (3373:59): [True: 89.7k, False: 197k]
  ------------------
 3374|   290k|               ++it;
 3375|   290k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   448k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 89.7k, False: 358k]
  |  Branch (3377:39): [True: 89.3k, False: 390]
  |  Branch (3377:52): [True: 464, False: 88.8k]
  ------------------
 3378|    464|               const auto after_dash = it + 1;
 3379|    464|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 8, False: 456]
  |  Branch (3379:41): [True: 6, False: 450]
  ------------------
 3380|     14|                  ctx.error = error_code::syntax_error;
 3381|     14|                  return;
 3382|     14|               }
 3383|    464|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   448k|            auto parse_element = [&](auto& element) {
 3387|   448k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   448k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   448k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   448k|                     return;
 3397|   448k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   448k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   448k|                  ctx.sequence_item_value_context = true;
 3400|   448k|                  ctx.sequence_dash_indent = dash_col;
 3401|   448k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   448k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   448k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   448k|                  ctx.pop_indent();
 3405|   448k|               }
 3406|   448k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   448k|                  skip_ws_and_comment(it, end);
 3409|   448k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   448k|                  auto nested_start = it;
 3413|   448k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   448k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   448k|                     return;
 3416|   448k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   448k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   448k|                  if (nested_indent > effective_line_indent) {
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|   448k|                     const int32_t element_indent =
 3428|   448k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   448k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   448k|                        return;
 3431|   448k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   448k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   448k|                     ctx.sequence_item_value_context = true;
 3434|   448k|                     ctx.sequence_dash_indent = dash_col;
 3435|   448k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   448k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   448k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   448k|                     ctx.pop_indent();
 3439|   448k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   448k|               }
 3442|       |
 3443|   448k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   448k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   448k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   448k|                                                                      pending_item_anchor_indent};
 3447|   448k|                  has_pending_item_anchor = false;
 3448|   448k|               }
 3449|   448k|            };
 3450|       |
 3451|   448k|            if constexpr (emplace_backable<V>) {
 3452|   448k|               auto& element = value.emplace_back();
 3453|   448k|               parse_element(element);
 3454|       |            }
 3455|       |            else if constexpr (emplaceable<V>) {
 3456|       |               value_type element{};
 3457|       |               parse_element(element);
 3458|       |               if (!bool(ctx.error)) {
 3459|       |                  adapter.append(value, std::move(element));
 3460|       |               }
 3461|       |            }
 3462|       |            else if constexpr (!resizable<V>) {
 3463|       |               parse_element(value[adapter.index]);
 3464|       |               adapter.commit_fixed_slot();
 3465|       |            }
 3466|       |            else {
 3467|       |               ctx.error = error_code::syntax_error;
 3468|       |               return;
 3469|       |            }
 3470|       |
 3471|   448k|            first_item = false;
 3472|       |
 3473|   448k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 4.01k, False: 444k]
  ------------------
 3474|  4.01k|               return;
 3475|       |
 3476|       |            // Note: after parsing nested block content, iterator may already be
 3477|       |            // at the start of the next line. The outer loop will handle it.
 3478|   448k|         }
 3479|   263k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3386|   448k|            auto parse_element = [&](auto& element) {
 3387|   448k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 424k, False: 24.0k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   448k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 424k, False: 24.0k]
  |  Branch (3390:33): [True: 209k, False: 214k]
  ------------------
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   209k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 209k]
  ------------------
 3396|      0|                     return;
 3397|   209k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   209k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   209k|                  ctx.sequence_item_value_context = true;
 3400|   209k|                  ctx.sequence_dash_indent = dash_col;
 3401|   209k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   209k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   209k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   209k|                  ctx.pop_indent();
 3405|   209k|               }
 3406|   238k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   238k|                  skip_ws_and_comment(it, end);
 3409|   238k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   238k|                  auto nested_start = it;
 3413|   238k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   238k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 6, False: 238k]
  ------------------
 3415|      6|                     return;
 3416|   238k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   238k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 16.5k, False: 222k]
  ------------------
 3422|   238k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 52.2k, False: 186k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  52.2k|                     const int32_t element_indent =
 3428|  52.2k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 52.2k]
  ------------------
 3429|  52.2k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 52.2k]
  ------------------
 3430|      0|                        return;
 3431|  52.2k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  52.2k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  52.2k|                     ctx.sequence_item_value_context = true;
 3434|  52.2k|                     ctx.sequence_dash_indent = dash_col;
 3435|  52.2k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  52.2k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  52.2k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  52.2k|                     ctx.pop_indent();
 3439|  52.2k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   238k|               }
 3442|       |
 3443|   448k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 9.16k, False: 439k]
  |  Branch (3443:47): [True: 9.09k, False: 64]
  ------------------
 3444|  9.09k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 6.66k, False: 2.43k]
  ------------------
 3445|  9.09k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  9.09k|                                                                      pending_item_anchor_indent};
 3447|  9.09k|                  has_pending_item_anchor = false;
 3448|  9.09k|               }
 3449|   448k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5503|   631k|   {
 5504|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5505|       |         // In flow context, only treat plain content as an implicit "key: value"
 5506|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5507|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5508|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5509|       |            // once per entry per nesting level over the whole remaining flow collection.
 5510|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5511|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5512|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5513|       |            // flow-context plain scalar, so every one of them is an indicator.
 5514|       |            bool at_node_start = true;
 5515|       |            int depth = 0;
 5516|       |            while (pos != stop) {
 5517|       |               const char c = *pos;
 5518|       |               if (c == ' ' || c == '\t') {
 5519|       |                  ++pos;
 5520|       |                  continue;
 5521|       |               }
 5522|       |               const bool node_start = std::exchange(at_node_start, false);
 5523|       |
 5524|       |               if ((c == '"' || c == '\'') && node_start) {
 5525|       |                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5526|       |                  continue;
 5527|       |               }
 5528|       |               if (c == '[' || c == '{') {
 5529|       |                  ++depth;
 5530|       |                  at_node_start = true;
 5531|       |                  ++pos;
 5532|       |                  continue;
 5533|       |               }
 5534|       |               if (c == ']' || c == '}') {
 5535|       |                  if (depth == 0) return false;
 5536|       |                  --depth;
 5537|       |                  ++pos;
 5538|       |                  continue;
 5539|       |               }
 5540|       |               if (c == ',' && depth == 0) return false;
 5541|       |               if (c == ':' && depth == 0) {
 5542|       |                  auto next = pos + 1;
 5543|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5544|       |               }
 5545|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5546|       |               if (c == ',' || c == ':') {
 5547|       |                  at_node_start = true;
 5548|       |                  ++pos;
 5549|       |                  continue;
 5550|       |               }
 5551|       |               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5552|       |                  at_node_start = true;
 5553|       |                  continue;
 5554|       |               }
 5555|       |               ++pos;
 5556|       |            }
 5557|       |            return false;
 5558|       |         };
 5559|       |
 5560|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5561|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5562|       |               return;
 5563|       |            }
 5564|       |            if (bool(ctx.error)) {
 5565|       |               return;
 5566|       |            }
 5567|       |         }
 5568|       |
 5569|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5570|       |         return;
 5571|       |      }
 5572|       |
 5573|   631k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5573:11): [True: 245k, False: 385k]
  ------------------
 5574|   245k|         return;
 5575|   245k|      }
 5576|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5577|   385k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5577:11): [True: 34.3k, False: 351k]
  ------------------
 5578|  34.3k|         return;
 5579|  34.3k|      }
 5580|   351k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5581|   351k|   }
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISM_EEDaSZ_:
 5938|   112k|            auto is_word_boundary = [&](const auto ptr) {
 5939|   112k|               if (ptr == end) {
  ------------------
  |  Branch (5939:20): [True: 5.75k, False: 106k]
  ------------------
 5940|  5.75k|                  return true;
 5941|  5.75k|               }
 5942|   106k|               if (*ptr == ':') {
  ------------------
  |  Branch (5942:20): [True: 56.1k, False: 50.6k]
  ------------------
 5943|  56.1k|                  auto next = ptr + 1;
 5944|  56.1k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5944:26): [True: 22.7k, False: 33.3k]
  |  Branch (5944:43): [True: 4.57k, False: 28.7k]
  |  Branch (5944:59): [True: 2.73k, False: 26.0k]
  |  Branch (5944:76): [True: 18.4k, False: 7.52k]
  |  Branch (5944:93): [True: 3.82k, False: 3.70k]
  ------------------
 5945|  56.1k|               }
 5946|  50.6k|               return is_plain_scalar_boundary(*ptr);
 5947|   106k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5864|  50.6k|            auto is_plain_scalar_boundary = [](const char ch) {
 5865|  50.6k|               switch (ch) {
 5866|  1.56k|               case ' ':
  ------------------
  |  Branch (5866:16): [True: 1.56k, False: 49.1k]
  ------------------
 5867|  3.63k|               case '\t':
  ------------------
  |  Branch (5867:16): [True: 2.07k, False: 48.6k]
  ------------------
 5868|  15.7k|               case '\n':
  ------------------
  |  Branch (5868:16): [True: 12.0k, False: 38.5k]
  ------------------
 5869|  42.1k|               case '\r':
  ------------------
  |  Branch (5869:16): [True: 26.4k, False: 24.2k]
  ------------------
 5870|  42.3k|               case ',':
  ------------------
  |  Branch (5870:16): [True: 244, False: 50.4k]
  ------------------
 5871|  42.6k|               case ']':
  ------------------
  |  Branch (5871:16): [True: 210, False: 50.4k]
  ------------------
 5872|  43.0k|               case '}':
  ------------------
  |  Branch (5872:16): [True: 430, False: 50.2k]
  ------------------
 5873|  43.0k|                  return true;
 5874|  7.64k|               default:
  ------------------
  |  Branch (5874:16): [True: 7.64k, False: 43.0k]
  ------------------
 5875|  7.64k|                  return false;
 5876|  50.6k|               }
 5877|  50.6k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISM_EEDaSZ_:
 5879|   101k|            auto has_indented_block_continuation = [&](auto word_end) {
 5880|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5881|       |                  return false;
 5882|       |               }
 5883|   101k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5883:20): [True: 43.0k, False: 58.1k]
  ------------------
 5884|  43.0k|                  return false;
 5885|  43.0k|               }
 5886|  58.1k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5886:20): [True: 3.57k, False: 54.5k]
  |  Branch (5886:40): [True: 42.5k, False: 11.9k]
  |  Branch (5886:61): [True: 20.4k, False: 22.0k]
  ------------------
 5887|  24.0k|                  return false;
 5888|  24.0k|               }
 5889|       |
 5890|  34.0k|               auto look = word_end;
 5891|  34.0k|               yaml::skip_newline(look, end);
 5892|   216k|               while (look != end) {
  ------------------
  |  Branch (5892:23): [True: 210k, False: 6.39k]
  ------------------
 5893|   210k|                  int32_t line_indent = 0;
 5894|  1.50M|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5894:26): [True: 1.50M, False: 308]
  |  Branch (5894:41): [True: 1.29M, False: 210k]
  ------------------
 5895|  1.29M|                     ++line_indent;
 5896|  1.29M|                     ++look;
 5897|  1.29M|                  }
 5898|   210k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5898:23): [True: 210k, False: 308]
  |  Branch (5898:38): [True: 2.69k, False: 207k]
  ------------------
 5899|  2.69k|                     return false;
 5900|  2.69k|                  }
 5901|   207k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5901:23): [True: 308, False: 207k]
  |  Branch (5901:38): [True: 145k, False: 61.5k]
  |  Branch (5901:55): [True: 24.5k, False: 37.0k]
  ------------------
 5902|   170k|                     if (look != end) {
  ------------------
  |  Branch (5902:26): [True: 170k, False: 308]
  ------------------
 5903|   170k|                        yaml::skip_newline(look, end);
 5904|   170k|                        continue;
 5905|   170k|                     }
 5906|    308|                     return false;
 5907|   170k|                  }
 5908|  37.0k|                  if (*look == '#') {
  ------------------
  |  Branch (5908:23): [True: 13.9k, False: 23.1k]
  ------------------
 5909|  13.9k|                     yaml::skip_comment(look, end);
 5910|  13.9k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5910:26): [True: 12.3k, False: 1.55k]
  |  Branch (5910:42): [True: 5.76k, False: 6.61k]
  |  Branch (5910:59): [True: 6.61k, False: 0]
  ------------------
 5911|  12.3k|                        yaml::skip_newline(look, end);
 5912|  12.3k|                        continue;
 5913|  12.3k|                     }
 5914|  1.55k|                     return false;
 5915|  13.9k|                  }
 5916|       |
 5917|       |                  // If the next non-empty line is an implicit mapping entry,
 5918|       |                  // don't treat it as scalar continuation for auto-deduced
 5919|       |                  // booleans/nulls.
 5920|  23.1k|                  {
 5921|  23.1k|                     auto scan = look;
 5922|  1.79M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5922:29): [True: 1.78M, False: 12.0k]
  |  Branch (5922:44): [True: 1.78M, False: 2.31k]
  |  Branch (5922:61): [True: 1.78M, False: 1.36k]
  ------------------
 5923|  1.78M|                        if (*scan == ':') {
  ------------------
  |  Branch (5923:29): [True: 13.1k, False: 1.76M]
  ------------------
 5924|  13.1k|                           auto after_colon = scan + 1;
 5925|  13.1k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5925:32): [True: 694, False: 12.4k]
  |  Branch (5925:54): [True: 3.13k, False: 9.35k]
  |  Branch (5925:77): [True: 478, False: 8.87k]
  ------------------
 5926|  8.87k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5926:32): [True: 1.99k, False: 6.88k]
  |  Branch (5926:56): [True: 1.12k, False: 5.75k]
  ------------------
 5927|  7.42k|                              return false;
 5928|  7.42k|                           }
 5929|  13.1k|                        }
 5930|  1.77M|                        ++scan;
 5931|  1.77M|                     }
 5932|  23.1k|                  }
 5933|       |
 5934|  15.6k|                  return line_indent > ctx.current_indent();
 5935|  23.1k|               }
 5936|  6.39k|               return false;
 5937|  34.0k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5457|   694k|   {
 5458|   694k|      using counts = yaml_variant_type_count<Variant>;
 5459|       |      if constexpr (counts::n_object == 0) {
 5460|       |         return false;
 5461|       |      }
 5462|   694k|      else {
 5463|       |         // Quick check: if no viable mapping separator in the current span,
 5464|       |         // avoid expensive speculative parse.
 5465|   694k|         const bool could_be_mapping = [&] {
 5466|   694k|            if constexpr (yaml::check_flow_context(Opts)) {
 5467|   694k|               return line_could_be_flow_mapping(it, end);
 5468|   694k|            }
 5469|   694k|            else {
 5470|   694k|               return yaml::line_could_be_block_mapping(it, end);
 5471|   694k|            }
 5472|   694k|         }();
 5473|   694k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5473:14): [True: 386k, False: 308k]
  ------------------
 5474|   386k|            return false;
 5475|   386k|         }
 5476|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5477|   308k|         auto temp_ctx = ctx.make_speculative();
 5478|   308k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5479|   308k|                                                                                               end);
 5480|   308k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5481|   308k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5482|   308k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5482:14): [True: 257k, False: 50.8k]
  ------------------
 5483|   257k|            ctx.anchors = std::move(temp_ctx.anchors);
 5484|   257k|            return true;
 5485|   257k|         }
 5486|       |         // The line matched "key: value" pattern but parsing failed.
 5487|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5488|       |         // so propagate the error rather than silently falling back to string.
 5489|  50.8k|         ctx.error = temp_ctx.error;
 5490|  50.8k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5491|  50.8k|         return false;
 5492|   308k|      }
 5493|   694k|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5465|   694k|         const bool could_be_mapping = [&] {
 5466|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5467|       |               return line_could_be_flow_mapping(it, end);
 5468|       |            }
 5469|   694k|            else {
 5470|   694k|               return yaml::line_could_be_block_mapping(it, end);
 5471|   694k|            }
 5472|   694k|         }();
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4736|  43.8k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4737|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4738|       |                     val = {};
 4739|       |                     return true;
 4740|       |                  }
 4741|  43.8k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4742|  43.8k|                     val = glz::generic{};
 4743|  43.8k|                     return true;
 4744|       |                  }
 4745|       |                  else {
 4746|       |                     static constexpr std::string_view null_value{"null"};
 4747|       |                     auto null_it = null_value.data();
 4748|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4749|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4750|       |                     return !bool(ctx.error);
 4751|       |                  }
 4752|  43.8k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|   263k|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|   263k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 263k]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|   263k|         const int32_t parent_indent = ctx.current_indent();
 3722|   263k|         const bool discover_indent = (mapping_indent < 0);
 3723|   263k|         bool first_key = !discover_indent;
 3724|   263k|         bool discovered_first_key_mid_line = false;
 3725|   263k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|   694k|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 593k, False: 100k]
  ------------------
 3728|   593k|            auto line_start = it;
 3729|   593k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 593k]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|   749k|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 739k, False: 9.49k]
  ------------------
 3733|   739k|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 18.3k, False: 721k]
  ------------------
 3734|  18.3k|                  skip_comment(it, end);
 3735|  18.3k|                  skip_newline(it, end);
 3736|  18.3k|                  first_key = false;
 3737|  18.3k|                  line_indent = 0;
 3738|  18.3k|               }
 3739|   721k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 79.3k, False: 642k]
  |  Branch (3739:40): [True: 40.7k, False: 601k]
  ------------------
 3740|   120k|                  skip_newline(it, end);
 3741|   120k|                  first_key = false;
 3742|   120k|                  line_indent = 0;
 3743|   120k|               }
 3744|   601k|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 228k, False: 373k]
  ------------------
 3745|   228k|                  line_start = it;
 3746|   228k|                  line_indent = 0;
 3747|  1.18M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 1.18M, False: 1.62k]
  |  Branch (3747:39): [True: 957k, False: 226k]
  ------------------
 3748|   957k|                     ++line_indent;
 3749|   957k|                     ++it;
 3750|   957k|                  }
 3751|       |
 3752|   228k|                  bool saw_tab = false;
 3753|   231k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 229k, False: 1.88k]
  |  Branch (3753:40): [True: 391, False: 229k]
  |  Branch (3753:54): [True: 3.12k, False: 226k]
  ------------------
 3754|  3.51k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 2.09k, False: 1.42k]
  |  Branch (3754:43): [True: 1.42k, False: 0]
  ------------------
 3755|  3.51k|                     ++it;
 3756|  3.51k|                  }
 3757|       |
 3758|   228k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 1.88k, False: 226k]
  |  Branch (3758:36): [True: 3.07k, False: 223k]
  |  Branch (3758:51): [True: 2.12k, False: 221k]
  |  Branch (3758:66): [True: 8.44k, False: 212k]
  ------------------
 3759|  15.5k|                     first_key = false;
 3760|  15.5k|                     line_indent = 0;
 3761|  15.5k|                     continue; // Blank or comment line
 3762|  15.5k|                  }
 3763|       |
 3764|   212k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 29, False: 212k]
  ------------------
 3765|     29|                     ctx.error = error_code::syntax_error;
 3766|     29|                     return;
 3767|     29|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   212k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 211k, False: 907]
  |  Branch (3770:46): [True: 162, False: 211k]
  ------------------
 3771|    162|                     it = line_start;
 3772|    162|                     return;
 3773|    162|                  }
 3774|       |
 3775|   212k|                  first_key = false;
 3776|   212k|                  break; // Found content
 3777|   212k|               }
 3778|   373k|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 2.26k, False: 370k]
  ------------------
 3779|  2.26k|                  line_start = it;
 3780|  8.00k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 7.71k, False: 285]
  |  Branch (3780:40): [True: 1.48k, False: 6.23k]
  |  Branch (3780:54): [True: 4.25k, False: 1.97k]
  ------------------
 3781|  2.26k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 285, False: 1.97k]
  |  Branch (3781:36): [True: 474, False: 1.50k]
  |  Branch (3781:51): [True: 858, False: 645]
  |  Branch (3781:66): [True: 587, False: 58]
  ------------------
 3782|  2.20k|                     first_key = false;
 3783|  2.20k|                     line_indent = 0;
 3784|  2.20k|                     continue; // Blank or comment-only line with tab indentation
 3785|  2.20k|                  }
 3786|     58|                  ctx.error = error_code::syntax_error;
 3787|     58|                  return;
 3788|  2.26k|               }
 3789|   370k|               else {
 3790|   370k|                  line_start = it;
 3791|   370k|                  break; // Content at column 0
 3792|   370k|               }
 3793|   739k|            }
 3794|       |
 3795|   592k|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 9.49k, False: 583k]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|   583k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 1.21k, False: 582k]
  |  Branch (3799:45): [True: 707, False: 581k]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|   581k|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 581k, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|   581k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 581k, False: 0]
  |  Branch (3806:39): [True: 318k, False: 263k]
  |  Branch (3806:62): [True: 162k, False: 156k]
  |  Branch (3806:84): [True: 123k, False: 38.8k]
  ------------------
 3807|   123k|                  it = line_start;
 3808|   123k|                  return;
 3809|   123k|               }
 3810|   458k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 194k, False: 263k]
  |  Branch (3810:43): [True: 121, False: 194k]
  ------------------
 3811|    121|                  it = line_start;
 3812|    121|                  return;
 3813|    121|               }
 3814|   458k|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|   458k|            bool established_mapping_indent_this_line = false;
 3818|   458k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 263k, False: 194k]
  ------------------
 3819|   263k|               mapping_indent = line_indent;
 3820|   263k|               established_mapping_indent_this_line = true;
 3821|   263k|               discovered_first_key_visual_indent = line_indent;
 3822|   263k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   263k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 263k, False: 0]
  |  Branch (3823:43): [True: 258k, False: 5.20k]
  ------------------
 3824|   258k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   258k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 309, False: 257k]
  ------------------
 3826|    309|                        ctx.error = error_code::syntax_error;
 3827|    309|                        return;
 3828|    309|                     }
 3829|       |
 3830|   257k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   257k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 256k, False: 907]
  |  Branch (3831:49): [True: 227k, False: 29.7k]
  ------------------
 3832|   227k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   227k|                     }
 3834|   257k|                  }
 3835|   263k|               }
 3836|   263k|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|   458k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 457k, False: 309]
  |  Branch (3840:36): [True: 457k, False: 0]
  |  Branch (3840:59): [True: 194k, False: 262k]
  ------------------
 3841|   194k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 39.1k, False: 155k]
  ------------------
 3842|  39.1k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 38.5k, False: 522]
  |  Branch (3842:43): [True: 18.5k, False: 20.0k]
  ------------------
 3843|  18.5k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 25, False: 18.4k]
  ------------------
 3844|     25|                     ctx.error = error_code::syntax_error;
 3845|     25|                     return;
 3846|     25|                  }
 3847|  18.4k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 1.15k, False: 17.3k]
  ------------------
 3848|  1.15k|                     it = line_start;
 3849|  1.15k|                     return;
 3850|  1.15k|                  }
 3851|  18.4k|               }
 3852|  20.5k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 629, False: 19.9k]
  ------------------
 3853|    629|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 214, False: 415]
  |  Branch (3853:47): [True: 2, False: 413]
  ------------------
 3854|    413|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 413, False: 0]
  |  Branch (3854:49): [True: 413, False: 0]
  |  Branch (3854:72): [True: 8, False: 405]
  ------------------
 3855|    224|                  ctx.error = error_code::syntax_error;
 3856|    224|                  return;
 3857|    224|               }
 3858|  39.1k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|   456k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 456k]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|   456k|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 456k]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|   456k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 309, False: 456k]
  |  Branch (3876:32): [True: 0, False: 456k]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|   456k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 122k, False: 334k]
  |  Branch (3885:53): [True: 32.5k, False: 89.5k]
  |  Branch (3885:94): [True: 10.8k, False: 21.6k]
  ------------------
 3886|  10.8k|               const auto after_colon = it + 1;
 3887|  10.8k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 8.20k, False: 2.66k]
  ------------------
 3888|  10.8k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 883, False: 9.98k]
  |  Branch (3888:43): [True: 7.88k, False: 2.10k]
  ------------------
 3889|  8.77k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 1.53k, False: 7.23k]
  ------------------
 3890|  1.53k|                  it = line_start;
 3891|  1.53k|                  return;
 3892|  1.53k|               }
 3893|  10.8k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|   455k|            int32_t effective_line_indent = line_indent;
 3897|   455k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 454k, False: 309]
  |  Branch (3897:36): [True: 262k, False: 191k]
  ------------------
 3898|   262k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 227k, False: 35.8k]
  ------------------
 3899|   227k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 175k, False: 51.5k]
  |  Branch (3899:52): [True: 22.1k, False: 153k]
  ------------------
 3900|       |               // The first discovered key has no indentation of its own left to measure: it may
 3901|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3902|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3903|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3904|       |               // key with an empty value takes the following sibling line for nested content
 3905|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3906|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3907|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3908|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3909|       |               // 7FWL and HMQ5 pin that case.
 3910|   204k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   204k|            }
 3912|       |
 3913|   455k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 25.0k, False: 430k]
  ------------------
 3914|  25.0k|               return;
 3915|  25.0k|            }
 3916|   430k|            first_key = false;
 3917|       |
 3918|   430k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 430k]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|       |               auto flow_end = it;
 3925|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|       |               if (bool(ctx.error)) [[unlikely]]
 3927|       |                  return;
 3928|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3929|       |                  it = flow_end;
 3930|       |                  return;
 3931|       |               }
 3932|       |            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|   430k|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 349k, False: 80.3k]
  ------------------
 3938|   349k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 172k, False: 177k]
  |  Branch (3938:34): [True: 2.12k, False: 175k]
  ------------------
 3939|   174k|                  auto peek = it;
 3940|   174k|                  skip_inline_ws(peek, end);
 3941|   174k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 174k, False: 482]
  |  Branch (3941:38): [True: 171k, False: 2.85k]
  |  Branch (3941:55): [True: 167k, False: 4.39k]
  |  Branch (3941:72): [True: 165k, False: 1.93k]
  ------------------
 3942|   165k|                     continue; // At leading indent of new line
 3943|   165k|                  }
 3944|   174k|               }
 3945|   184k|               skip_inline_ws(it, end);
 3946|   184k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 184k, False: 482]
  |  Branch (3946:33): [True: 9.29k, False: 174k]
  ------------------
 3947|  9.29k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  9.29k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 9.29k, False: 0]
  ------------------
 3949|  9.29k|                        const char prev = *(it - 1);
 3950|  9.29k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 3.46k, False: 5.82k]
  |  Branch (3950:44): [True: 2.74k, False: 727]
  |  Branch (3950:60): [True: 1.63k, False: 1.10k]
  |  Branch (3950:76): [True: 8, False: 1.62k]
  ------------------
 3951|      8|                           ctx.error = error_code::syntax_error;
 3952|      8|                           return;
 3953|      8|                        }
 3954|  9.29k|                     }
 3955|  9.29k|                  }
 3956|  9.29k|               }
 3957|  9.28k|               skip_comment(it, end);
 3958|   184k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 183k, False: 866]
  |  Branch (3958:34): [True: 68.6k, False: 115k]
  |  Branch (3958:49): [True: 54.9k, False: 60.2k]
  ------------------
 3959|   123k|                  skip_newline(it, end);
 3960|   123k|               }
 3961|  61.1k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 60.2k, False: 866]
  ------------------
 3962|       |                  // The entry stopped part way along its line with something other than
 3963|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3964|       |                  // separator, say. The next pass measures indent as though this were the start
 3965|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3966|  60.2k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|  60.2k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 275, False: 60.0k]
  ------------------
 3968|    275|                        ctx.error = error_code::syntax_error;
 3969|    275|                        return;
 3970|    275|                     }
 3971|  60.2k|                  }
 3972|  60.2k|               }
 3973|   184k|            }
 3974|   430k|         }
 3975|   263k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_i:
 4855|   454k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4856|   454k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|   454k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4858|   454k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   454k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   454k|                           if (ctx.stream_begin) {
 4866|   454k|                              auto is_line_content_start = [&](auto pos) {
 4867|   454k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   454k|                              };
 4869|       |
 4870|   454k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   454k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   454k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   454k|                                 return line != end && *line == ':';
 4874|   454k|                              };
 4875|       |
 4876|   454k|                              if (!is_line_content_start(it) &&
 4877|   454k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4878|   454k|                                  !line_has_explicit_value_indicator(it)) {
 4879|   454k|                                 ctx.error = error_code::syntax_error;
 4880|   454k|                                 return false;
 4881|   454k|                              }
 4882|   454k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   454k|                           }
 4884|   454k|                        }
 4885|       |
 4886|   454k|                        if (*it == '-' &&
 4887|   454k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4888|   454k|                            !line_starts_with_explicit_value_indicator) {
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|   454k|                           ctx.error = error_code::syntax_error;
 4891|   454k|                           return false;
 4892|   454k|                        }
 4893|       |
 4894|   454k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4895|   454k|                           return false;
 4896|   454k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   454k|                        ctx.pop_indent();
 4898|   454k|                     }
 4899|   454k|                     else {
 4900|   454k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|   454k|                        if (nested_indent >= 0) {
 4902|   454k|                           yaml::skip_to_content(it, end);
 4903|   454k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4904|   454k|                              ctx.error = error_code::syntax_error;
 4905|   454k|                              return false;
 4906|   454k|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|   454k|                           const int32_t value_indent =
 4910|   454k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4911|   454k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4912|   454k|                              return false;
 4913|   454k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|   454k|                           ctx.pop_indent();
 4915|   454k|                        }
 4916|   454k|                     }
 4917|   454k|                     return !bool(ctx.error);
 4918|   454k|                  };
 4919|       |
 4920|       |                  // Explicit key entry form:
 4921|       |                  // ? key
 4922|       |                  // : value
 4923|   454k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4923:23): [True: 111k, False: 343k]
  |  Branch (4923:37): [True: 110k, False: 415]
  |  Branch (4923:58): [True: 5, False: 110k]
  ------------------
 4924|      5|                     ctx.error = error_code::syntax_error;
 4925|      5|                     return false;
 4926|      5|                  }
 4927|   454k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4927:23): [True: 111k, False: 343k]
  |  Branch (4927:38): [True: 415, False: 110k]
  |  Branch (4927:57): [True: 43.7k, False: 66.9k]
  |  Branch (4927:77): [True: 43.5k, False: 23.4k]
  |  Branch (4927:98): [True: 20.5k, False: 2.90k]
  ------------------
 4928|   108k|                     ++it; // skip '?'
 4929|   108k|                     yaml::skip_inline_ws(it, end);
 4930|       |
 4931|   108k|                     const int32_t explicit_value_indicator_indent =
 4932|   108k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4932:25): [True: 38.1k, False: 70.1k]
  ------------------
 4933|       |
 4934|   108k|                     key_t key{};
 4935|   108k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4936|   108k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   108k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   108k|                        };
 4939|       |
 4940|   108k|                        auto key_it = it;
 4941|   108k|                        yaml::skip_inline_ws(key_it, end);
 4942|       |
 4943|   108k|                        auto content = key_it;
 4944|   108k|                        yaml::skip_to_content(content, end);
 4945|   108k|                        bool handled_anchor_only_empty_key = false;
 4946|       |
 4947|       |                        // Anchor on an empty explicit key node:
 4948|       |                        //   ? &a
 4949|       |                        //   : value
 4950|   108k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4950:29): [True: 105k, False: 2.63k]
  |  Branch (4950:47): [True: 24.3k, False: 81.2k]
  ------------------
 4951|  24.3k|                           auto anchor_probe = content + 1;
 4952|  24.3k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4953|  24.3k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4953:32): [True: 24.3k, False: 21]
  ------------------
 4954|  24.3k|                              auto after_anchor = anchor_probe;
 4955|  24.3k|                              yaml::skip_inline_ws(after_anchor, end);
 4956|       |
 4957|  24.3k|                              auto value_indicator = after_anchor;
 4958|  24.3k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4958:35): [True: 23.9k, False: 452]
  |  Branch (4958:61): [True: 2.36k, False: 21.5k]
  ------------------
 4959|  2.36k|                                 key.clear();
 4960|  2.36k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4961|  2.36k|                                 it = value_indicator;
 4962|  2.36k|                                 handled_anchor_only_empty_key = true;
 4963|  2.36k|                              }
 4964|  22.0k|                              else {
 4965|  22.0k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4965:38): [True: 21.5k, False: 452]
  |  Branch (4965:64): [True: 952, False: 20.6k]
  ------------------
 4966|    952|                                    yaml::skip_comment(value_indicator, end);
 4967|    952|                                 }
 4968|  22.0k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4968:38): [True: 21.1k, False: 818]
  |  Branch (4968:65): [True: 3.01k, False: 18.1k]
  |  Branch (4968:93): [True: 5.92k, False: 12.2k]
  ------------------
 4969|  8.93k|                                    yaml::skip_newline(value_indicator, end);
 4970|  8.93k|                                    auto value_line = value_indicator;
 4971|  8.93k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4972|  8.93k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4972:41): [True: 3, False: 8.93k]
  ------------------
 4973|      3|                                       return false;
 4974|  8.93k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4974:41): [True: 7.31k, False: 1.62k]
  |  Branch (4974:62): [True: 782, False: 6.53k]
  ------------------
 4975|    782|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4975:41): [True: 777, False: 5]
  ------------------
 4976|    777|                                       key.clear();
 4977|    777|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4978|    777|                                       it = value_line;
 4979|    777|                                       handled_anchor_only_empty_key = true;
 4980|    777|                                    }
 4981|  8.15k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4981:46): [True: 6.53k, False: 1.62k]
  |  Branch (4981:67): [True: 5, False: 6.53k]
  ------------------
 4982|       |                                       // In explicit-key form ("? &a"), a following ':'
 4983|       |                                       // starts the outer value indicator only at the same
 4984|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4985|      5|                                       ctx.error = error_code::syntax_error;
 4986|      5|                                       return false;
 4987|      5|                                    }
 4988|  8.93k|                                 }
 4989|  22.0k|                              }
 4990|  24.3k|                           }
 4991|  24.3k|                        }
 4992|       |
 4993|   108k|                        const bool key_content_spans_lines = [&] {
 4994|   108k|                           auto scan = key_it;
 4995|   108k|                           while (scan != content && scan != end) {
 4996|   108k|                              if (*scan == '\n' || *scan == '\r') return true;
 4997|   108k|                              ++scan;
 4998|   108k|                           }
 4999|   108k|                           return false;
 5000|   108k|                        }();
 5001|       |
 5002|   108k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5002:29): [True: 3.13k, False: 105k]
  ------------------
 5003|       |                           // 'it' already points to the explicit value indicator ':'
 5004|  3.13k|                        }
 5005|   105k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5005:34): [True: 2.63k, False: 102k]
  |  Branch (5005:53): [True: 4.92k, False: 97.5k]
  |  Branch (5005:72): [True: 3.34k, False: 1.57k]
  ------------------
 5006|  5.98k|                           key.clear();
 5007|  5.98k|                           it = content;
 5008|  5.98k|                        }
 5009|  99.1k|                        else {
 5010|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5011|       |                           // Parse the key node structurally (not via plain-key scanning)
 5012|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5013|       |                           // as complex keys, not split into implicit key/value pairs.
 5014|  99.1k|                           auto key_node_it = content;
 5015|  99.1k|                           auto key_node_end = end;
 5016|  99.1k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5017|       |                              // In explicit-key form, a following standalone ':'
 5018|       |                              // line (same or lower indentation) belongs to the
 5019|       |                              // outer mapping value, not the key node itself.
 5020|  99.1k|                              auto scan = content;
 5021|  2.50M|                              while (scan != end) {
  ------------------
  |  Branch (5021:38): [True: 2.44M, False: 60.0k]
  ------------------
 5022|  68.6M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5022:41): [True: 68.5M, False: 19.6k]
  |  Branch (5022:56): [True: 67.5M, False: 1.08M]
  |  Branch (5022:73): [True: 66.1M, False: 1.33M]
  ------------------
 5023|  66.1M|                                    ++scan;
 5024|  66.1M|                                 }
 5025|  2.44M|                                 if (scan == end) {
  ------------------
  |  Branch (5025:38): [True: 19.6k, False: 2.42M]
  ------------------
 5026|  19.6k|                                    break;
 5027|  19.6k|                                 }
 5028|       |
 5029|  2.42M|                                 yaml::skip_newline(scan, end);
 5030|  2.42M|                                 auto line_start = scan;
 5031|       |
 5032|  2.42M|                                 int32_t indicator_indent = 0;
 5033|  3.93M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5033:41): [True: 3.87M, False: 60.0k]
  |  Branch (5033:56): [True: 1.51M, False: 2.36M]
  ------------------
 5034|  1.51M|                                    ++indicator_indent;
 5035|  1.51M|                                    ++scan;
 5036|  1.51M|                                 }
 5037|       |
 5038|  2.42M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5038:38): [True: 2.36M, False: 60.0k]
  |  Branch (5038:53): [True: 236k, False: 2.12M]
  ------------------
 5039|   236k|                                    const auto after_colon = scan + 1;
 5040|   236k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5040:42): [True: 828, False: 236k]
  ------------------
 5041|   236k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5041:42): [True: 196k, False: 40.0k]
  ------------------
 5042|   196k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5042:41): [True: 19.3k, False: 177k]
  ------------------
 5043|  19.3k|                                       key_node_end = line_start;
 5044|  19.3k|                                       break;
 5045|  19.3k|                                    }
 5046|   236k|                                 }
 5047|  2.42M|                              }
 5048|  99.1k|                           }
 5049|       |
 5050|  99.1k|                           glz::generic key_node{};
 5051|  99.1k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5052|  99.1k|                           ctx.explicit_mapping_key_context = true;
 5053|  99.1k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5054|  99.1k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5055|  99.1k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5055:32): [True: 3.84k, False: 95.2k]
  ------------------
 5056|  3.84k|                              return false;
 5057|  95.2k|                           it = key_node_it;
 5058|  95.2k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5058:32): [True: 48, False: 95.2k]
  ------------------
 5059|     48|                              return false;
 5060|  95.2k|                        }
 5061|       |                     }
 5062|       |                     else {
 5063|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5064|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5065|       |                           if (bool(ctx.error)) [[unlikely]]
 5066|       |                              return false;
 5067|       |                        }
 5068|       |                     }
 5069|       |
 5070|   104k|                     yaml::skip_inline_ws(it, end);
 5071|   108k|                     yaml::skip_comment(it, end);
 5072|       |
 5073|       |                     // Value indicator may appear on the next line at the same indent.
 5074|   108k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5074:26): [True: 73.1k, False: 35.0k]
  |  Branch (5074:40): [True: 19.0k, False: 54.0k]
  |  Branch (5074:55): [True: 19.9k, False: 34.1k]
  ------------------
 5075|  39.0k|                        auto probe = it;
 5076|  39.0k|                        bool found_value_indicator = false;
 5077|       |
 5078|  81.5k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5078:32): [True: 66.7k, False: 14.8k]
  |  Branch (5078:49): [True: 25.4k, False: 41.2k]
  |  Branch (5078:67): [True: 41.2k, False: 8]
  ------------------
 5079|  66.7k|                           yaml::skip_newline(probe, end);
 5080|       |
 5081|  66.7k|                           auto value_line = probe;
 5082|  66.7k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5083|  66.7k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5083:32): [True: 6, False: 66.7k]
  ------------------
 5084|      6|                              return false;
 5085|       |
 5086|  66.7k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5086:32): [True: 14.6k, False: 52.0k]
  |  Branch (5086:53): [True: 2.08k, False: 49.9k]
  |  Branch (5086:76): [True: 19.7k, False: 30.1k]
  ------------------
 5087|  36.5k|                              probe = value_line;
 5088|  36.5k|                              continue; // blank line
 5089|  36.5k|                           }
 5090|  30.1k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5090:32): [True: 6.01k, False: 24.1k]
  ------------------
 5091|  6.01k|                              yaml::skip_comment(value_line, end);
 5092|  6.01k|                              probe = value_line;
 5093|  6.01k|                              continue; // comment-only line
 5094|  6.01k|                           }
 5095|  24.1k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5095:32): [True: 4.92k, False: 19.2k]
  |  Branch (5095:54): [True: 1.40k, False: 3.52k]
  ------------------
 5096|  1.40k|                              it = value_line;
 5097|  1.40k|                              found_value_indicator = true;
 5098|  1.40k|                           }
 5099|  24.1k|                           break;
 5100|  30.1k|                        }
 5101|       |
 5102|  39.0k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5102:29): [True: 1.40k, False: 37.6k]
  ------------------
 5103|  1.40k|                           yaml::skip_inline_ws(it, end);
 5104|  1.40k|                        }
 5105|  39.0k|                     }
 5106|       |
 5107|   108k|                     val_t val{};
 5108|   108k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5108:26): [True: 73.1k, False: 35.0k]
  |  Branch (5108:39): [True: 26.7k, False: 46.4k]
  ------------------
 5109|  26.7k|                        ++it;
 5110|  26.7k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5110:29): [True: 26.4k, False: 280]
  |  Branch (5110:42): [True: 5, False: 26.4k]
  ------------------
 5111|      5|                           ctx.error = error_code::syntax_error;
 5112|      5|                           return false;
 5113|      5|                        }
 5114|  26.6k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5114:29): [True: 26.4k, False: 280]
  |  Branch (5114:43): [True: 1.51k, False: 24.9k]
  |  Branch (5114:58): [True: 4.13k, False: 20.7k]
  ------------------
 5115|  5.64k|                           auto probe = it;
 5116|  5.64k|                           yaml::skip_newline(probe, end);
 5117|  15.0k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5117:35): [True: 14.0k, False: 986]
  |  Branch (5117:51): [True: 9.37k, False: 4.66k]
  ------------------
 5118|  5.64k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5118:32): [True: 4.66k, False: 986]
  |  Branch (5118:48): [True: 711, False: 3.95k]
  |  Branch (5118:65): [True: 609, False: 102]
  |  Branch (5118:89): [True: 2, False: 607]
  ------------------
 5119|      2|                              ctx.error = error_code::syntax_error;
 5120|      2|                              return false;
 5121|      2|                           }
 5122|  5.64k|                        }
 5123|  26.6k|                        yaml::skip_inline_ws(it, end);
 5124|  26.6k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5124:29): [True: 345, False: 26.3k]
  ------------------
 5125|    345|                           return false;
 5126|  26.6k|                     }
 5127|       |
 5128|   107k|                     value.emplace(std::move(key), std::move(val));
 5129|   107k|                     return true;
 5130|   108k|                  }
 5131|       |
 5132|   346k|                  key_t key{};
 5133|   346k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5134|   346k|                     auto key_probe = it;
 5135|   346k|                     yaml::skip_inline_ws(key_probe, end);
 5136|   346k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5136:53): [True: 346k, False: 0]
  |  Branch (5136:74): [True: 1.43k, False: 345k]
  |  Branch (5136:95): [True: 799, False: 344k]
  ------------------
 5137|   346k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5137:26): [True: 2.23k, False: 344k]
  ------------------
 5138|  2.23k|                        glz::generic key_node{};
 5139|  2.23k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5140|  2.23k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5140:29): [True: 633, False: 1.60k]
  ------------------
 5141|    633|                           return false;
 5142|  1.60k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5142:29): [True: 2, False: 1.60k]
  ------------------
 5143|      2|                           return false;
 5144|  1.60k|                     }
 5145|   344k|                     else {
 5146|   344k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5146:29): [True: 1.94k, False: 342k]
  ------------------
 5147|  1.94k|                           return false;
 5148|  1.94k|                        }
 5149|   344k|                     }
 5150|       |                  }
 5151|       |                  else {
 5152|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5153|       |                     if (bool(ctx.error)) [[unlikely]]
 5154|       |                        return false;
 5155|       |                  }
 5156|       |
 5157|   344k|                  yaml::skip_inline_ws(it, end);
 5158|       |
 5159|   346k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5159:23): [True: 3.32k, False: 343k]
  |  Branch (5159:36): [True: 886, False: 342k]
  ------------------
 5160|  1.63k|                     ctx.error = error_code::syntax_error;
 5161|  1.63k|                     return false;
 5162|  1.63k|                  }
 5163|   344k|                  ++it;
 5164|   344k|                  yaml::skip_inline_ws(it, end);
 5165|       |
 5166|   344k|                  val_t val{};
 5167|   344k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5167:23): [True: 16.5k, False: 328k]
  ------------------
 5168|  16.5k|                     return false;
 5169|       |
 5170|   328k|                  value.emplace(std::move(key), std::move(val));
 5171|   328k|                  return true;
 5172|   344k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlvE_clEv:
 4993|   108k|                        const bool key_content_spans_lines = [&] {
 4994|   108k|                           auto scan = key_it;
 4995|   117k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4995:35): [True: 75.1k, False: 42.5k]
  |  Branch (4995:54): [True: 75.1k, False: 0]
  ------------------
 4996|  75.1k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4996:35): [True: 44.2k, False: 30.9k]
  |  Branch (4996:52): [True: 21.5k, False: 9.41k]
  ------------------
 4997|  9.41k|                              ++scan;
 4998|  9.41k|                           }
 4999|  42.5k|                           return false;
 5000|   108k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4936|  95.2k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|  95.2k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|  95.2k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4856|   369k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|   369k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4857:26): [True: 359k, False: 9.38k]
  |  Branch (4857:39): [True: 257k, False: 102k]
  ------------------
 4858|   257k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   257k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   257k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4865:32): [True: 257k, False: 0]
  ------------------
 4866|   257k|                              auto is_line_content_start = [&](auto pos) {
 4867|   257k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   257k|                              };
 4869|       |
 4870|   257k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   257k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   257k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   257k|                                 return line != end && *line == ':';
 4874|   257k|                              };
 4875|       |
 4876|   257k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4876:35): [True: 257k, False: 0]
  ------------------
 4877|   257k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4877:35): [True: 32.7k, False: 224k]
  ------------------
 4878|  32.7k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4878:35): [True: 429, False: 32.3k]
  ------------------
 4879|    429|                                 ctx.error = error_code::syntax_error;
 4880|    429|                                 return false;
 4881|    429|                              }
 4882|   256k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   256k|                           }
 4884|   257k|                        }
 4885|       |
 4886|   257k|                        if (*it == '-' &&
  ------------------
  |  Branch (4886:29): [True: 2.92k, False: 254k]
  ------------------
 4887|  2.92k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4887:30): [True: 324, False: 2.59k]
  |  Branch (4887:49): [True: 656, False: 1.94k]
  ------------------
 4888|    980|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4888:29): [True: 12, False: 968]
  ------------------
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|     12|                           ctx.error = error_code::syntax_error;
 4891|     12|                           return false;
 4892|     12|                        }
 4893|       |
 4894|   257k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4894:29): [True: 0, False: 257k]
  ------------------
 4895|      0|                           return false;
 4896|   257k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   257k|                        ctx.pop_indent();
 4898|   257k|                     }
 4899|   111k|                     else {
 4900|   111k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|   111k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4901:29): [True: 44.7k, False: 67.0k]
  ------------------
 4902|  44.7k|                           yaml::skip_to_content(it, end);
 4903|  44.7k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4903:32): [True: 44.7k, False: 0]
  |  Branch (4903:45): [True: 0, False: 44.7k]
  |  Branch (4903:59): [True: 0, False: 0]
  |  Branch (4903:78): [True: 0, False: 0]
  ------------------
 4904|      0|                              ctx.error = error_code::syntax_error;
 4905|      0|                              return false;
 4906|      0|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|  44.7k|                           const int32_t value_indent =
 4910|  44.7k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4910:31): [Folded, False: 44.7k]
  ------------------
 4911|  44.7k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4911:32): [True: 0, False: 44.7k]
  ------------------
 4912|      0|                              return false;
 4913|  44.7k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|  44.7k|                           ctx.pop_indent();
 4915|  44.7k|                        }
 4916|   111k|                     }
 4917|   369k|                     return !bool(ctx.error);
 4918|   369k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISA_EEDaSN_:
 4866|   257k|                              auto is_line_content_start = [&](auto pos) {
 4867|   257k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   257k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SA_SA_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISA_EEDaSN_:
 4870|   289k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   289k|                                 const char* line = ctx.line_begin_of(pos);
 4872|  1.06M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4872:41): [True: 1.06M, False: 0]
  |  Branch (4872:57): [True: 779k, False: 290k]
  |  Branch (4872:73): [True: 513, False: 289k]
  ------------------
 4873|   289k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4873:41): [True: 289k, False: 0]
  |  Branch (4873:56): [True: 195k, False: 94.4k]
  ------------------
 4874|   289k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4625|   287k|            {
 4626|       |               // emplace is a no-op for keys the document already wrote, so only
 4627|       |               // untouched pre-existing entries are put back.
 4628|   287k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4628:33): [True: 0, False: 287k]
  ------------------
 4629|      0|                  target.emplace(entry.first, std::move(entry.second));
 4630|      0|               }
 4631|   287k|            }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|  89.0k|      {
  301|  89.0k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 89.0k]
  |  Branch (301:27): [True: 0, False: 89.0k]
  ------------------
  302|       |
  303|  89.0k|         ++it; // skip '*'
  304|  89.0k|         auto name = parse_anchor_name(it, end);
  305|  89.0k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 184, False: 88.8k]
  ------------------
  306|    184|            ctx.error = error_code::syntax_error;
  307|    184|            return true;
  308|    184|         }
  309|       |
  310|  88.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  88.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 437, False: 88.4k]
  ------------------
  312|    437|            ctx.error = error_code::syntax_error; // undefined alias
  313|    437|            return true;
  314|    437|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  88.4k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  88.4k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.63k, False: 86.8k]
  ------------------
  322|  1.63k|            return true;
  323|  1.63k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  86.8k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 60, False: 86.7k]
  ------------------
  329|     60|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     60|            return true;
  331|     60|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  86.7k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  86.7k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 86.7k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  86.7k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 6, False: 86.7k]
  ------------------
  342|      6|            ctx.error = error_code::exceeded_max_expansion;
  343|      6|            ctx.custom_error_message = "alias expansion";
  344|      6|            return true;
  345|      6|         }
  346|       |
  347|  86.7k|         auto replay_it = span.begin;
  348|  86.7k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  86.7k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  86.7k|         ctx.indent_stack.clear();
  353|  86.7k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 55.0k, False: 31.6k]
  ------------------
  354|  55.0k|            ctx.push_indent(span.base_indent - 1);
  355|  55.0k|         }
  356|       |
  357|  86.7k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  86.7k|         using V = std::remove_cvref_t<T>;
  360|  86.7k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  86.7k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  86.7k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  86.7k|         return true;
  367|  86.7k|      }
_ZN3glz4yaml15skip_to_contentIPKcS3_EEvRT_T0_:
 3637|  3.28M|      {
 3638|  5.66M|         while (it != end) {
  ------------------
  |  Branch (3638:17): [True: 5.57M, False: 85.6k]
  ------------------
 3639|  5.57M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3639:17): [True: 1.33M, False: 4.24M]
  |  Branch (3639:32): [True: 847k, False: 3.39M]
  ------------------
 3640|  2.18M|               skip_newline(it, end);
 3641|  2.18M|            }
 3642|  3.39M|            else if (*it == '#') {
  ------------------
  |  Branch (3642:22): [True: 64.9k, False: 3.33M]
  ------------------
 3643|  64.9k|               skip_comment(it, end);
 3644|  64.9k|            }
 3645|  3.33M|            else if (*it == ' ') {
  ------------------
  |  Branch (3645:22): [True: 1.24M, False: 2.08M]
  ------------------
 3646|  1.24M|               auto line_start = it;
 3647|  4.75M|               while (it != end && *it == ' ') ++it;
  ------------------
  |  Branch (3647:23): [True: 4.74M, False: 11.6k]
  |  Branch (3647:36): [True: 3.51M, False: 1.23M]
  ------------------
 3648|  1.24M|               if (it == end || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3648:20): [True: 11.6k, False: 1.23M]
  |  Branch (3648:33): [True: 35.2k, False: 1.19M]
  |  Branch (3648:48): [True: 25.5k, False: 1.17M]
  ------------------
 3649|  72.4k|                  continue; // blank line with trailing spaces
 3650|  72.4k|               }
 3651|  1.17M|               if (*it == '#') {
  ------------------
  |  Branch (3651:20): [True: 58.0k, False: 1.11M]
  ------------------
 3652|  58.0k|                  skip_comment(it, end);
 3653|  58.0k|                  continue; // comment-only line
 3654|  58.0k|               }
 3655|  1.11M|               it = line_start; // content found, restore to start of indent
 3656|  1.11M|               return;
 3657|  1.17M|            }
 3658|  2.08M|            else {
 3659|  2.08M|               return; // content at column 0
 3660|  2.08M|            }
 3661|  5.57M|         }
 3662|  3.28M|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   104k|      {
 5284|   104k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   104k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   104k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   104k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   104k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 104k, False: 0]
  ------------------
 5294|   104k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   104k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1960|   107k|      {
 1961|   107k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 8.73k, False: 98.7k]
  ------------------
 1962|  8.73k|            return;
 1963|       |
 1964|  98.7k|         yaml::node_preamble_state preamble{};
 1965|  98.7k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 3.83k, False: 94.9k]
  ------------------
 1966|  98.7k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  3.83k|            return;
 1968|       |
 1969|  94.9k|         std::string str;
 1970|  94.9k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|  94.9k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 94.9k, False: 0]
  ------------------
 1973|    910|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 910, False: 94.0k]
  ------------------
 1974|    910|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|    910|            break;
 1976|    537|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 537, False: 94.3k]
  ------------------
 1977|    537|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|    537|            break;
 1979|    402|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 402, False: 94.5k]
  ------------------
 1980|  1.74k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 1.34k, False: 93.5k]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  1.74k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  1.74k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 657, False: 1.08k]
  ------------------
 1986|  1.74k|            break;
 1987|  91.7k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 91.7k, False: 3.19k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|  91.7k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|  91.7k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1991:20): [True: 78.4k, False: 13.2k]
  ------------------
 1992|  78.4k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|  78.4k|               }
 1994|  13.2k|               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|  13.2k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|  13.2k|               }
 1998|       |            }
 1999|       |            else {
 2000|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|       |            }
 2002|  91.7k|            break;
 2003|  94.9k|         }
 2004|       |
 2005|  94.9k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 93.7k, False: 1.16k]
  ------------------
 2006|  93.7k|            value = std::move(str);
 2007|  93.7k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|  93.7k|         }
 2009|  94.9k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  98.7k|      {
  466|  98.7k|         skip_inline_ws(it, end);
  467|       |
  468|  98.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 16, False: 98.7k]
  ------------------
  469|     16|            if constexpr (!AllowEmptyInput) {
  470|     16|               ctx.error = error_code::unexpected_end;
  471|     16|            }
  472|     16|            return true;
  473|     16|         }
  474|       |
  475|  98.7k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  98.7k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 18, False: 98.7k]
  ------------------
  477|     18|            ctx.error = error_code::syntax_error;
  478|     18|            return true;
  479|     18|         }
  480|  98.7k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 98.7k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  98.7k|         skip_inline_ws(it, end);
  486|       |
  487|  98.7k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 13, False: 98.7k]
  ------------------
  488|     13|            if constexpr (!AllowEmptyInput) {
  489|     13|               ctx.error = error_code::unexpected_end;
  490|     13|            }
  491|     13|            return true;
  492|     13|         }
  493|       |
  494|  98.7k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.77k, False: 94.9k]
  ------------------
  495|  3.77k|            return true;
  496|  3.77k|         }
  497|       |
  498|  94.9k|         return false;
  499|  98.7k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1966|  98.7k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  98.7k|      {
  409|  98.7k|         state.has_anchor = false;
  410|  98.7k|         state.anchor_name.clear();
  411|  98.7k|         state.anchor_start = nullptr;
  412|  98.7k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  98.7k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  98.7k|            else {
  421|  98.7k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.72k, False: 94.9k]
  ------------------
  422|  98.7k|            }
  423|  98.7k|         }
  424|       |
  425|  98.7k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 94.9k, False: 3.72k]
  |  Branch (425:27): [True: 6.16k, False: 88.8k]
  ------------------
  426|  6.16k|            ++it;
  427|  6.16k|            auto name = parse_anchor_name(it, end);
  428|  6.16k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 10, False: 6.15k]
  ------------------
  429|     10|               ctx.error = error_code::syntax_error;
  430|     10|               return true;
  431|     10|            }
  432|  6.15k|            skip_inline_ws(it, end);
  433|  6.15k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 44, False: 6.11k]
  ------------------
  434|     44|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     44|                  ctx.error = error_code::unexpected_end;
  436|     44|               }
  437|     44|               return true;
  438|     44|            }
  439|  6.11k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  6.11k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 4, False: 6.11k]
  ------------------
  441|      4|                  ctx.error = error_code::syntax_error;
  442|      4|                  return true;
  443|      4|               }
  444|  6.11k|            }
  445|  6.11k|            state.has_anchor = true;
  446|  6.11k|            state.anchor_name = std::string(name);
  447|  6.11k|            state.anchor_start = &*it;
  448|  6.11k|         }
  449|       |
  450|  98.6k|         return false;
  451|  98.7k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|  98.7k|      {
  301|  98.7k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 98.7k]
  |  Branch (301:27): [True: 94.9k, False: 3.72k]
  ------------------
  302|       |
  303|  3.72k|         ++it; // skip '*'
  304|  3.72k|         auto name = parse_anchor_name(it, end);
  305|  3.72k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 8, False: 3.71k]
  ------------------
  306|      8|            ctx.error = error_code::syntax_error;
  307|      8|            return true;
  308|      8|         }
  309|       |
  310|  3.71k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.71k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 25, False: 3.68k]
  ------------------
  312|     25|            ctx.error = error_code::syntax_error; // undefined alias
  313|     25|            return true;
  314|     25|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  3.68k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.68k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 362, False: 3.32k]
  ------------------
  322|    362|            return true;
  323|    362|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  3.32k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 14, False: 3.31k]
  ------------------
  329|     14|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     14|            return true;
  331|     14|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  3.31k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.31k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 3.31k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  3.31k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.31k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  3.31k|         auto replay_it = span.begin;
  348|  3.31k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.31k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.31k|         ctx.indent_stack.clear();
  353|  3.31k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.47k, False: 839]
  ------------------
  354|  2.47k|            ctx.push_indent(span.base_indent - 1);
  355|  2.47k|         }
  356|       |
  357|  3.31k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.31k|         using V = std::remove_cvref_t<T>;
  360|  3.31k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.31k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.31k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.31k|         return true;
  367|  3.31k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|  37.0k|      {
 5284|  37.0k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|  37.0k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|  37.0k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|  37.0k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|  37.0k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 37.0k, False: 0]
  ------------------
 5294|  37.0k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|  37.0k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2115|  38.3k|      {
 2116|  38.3k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 38.3k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|  38.3k|         yaml::node_preamble_state preamble{};
 2120|  38.3k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 4.84k, False: 33.4k]
  ------------------
 2121|  38.3k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  38.3k|                   return yaml::tag_valid_for_float(tag);
 2123|  38.3k|                }
 2124|  38.3k|                else {
 2125|  38.3k|                   return yaml::tag_valid_for_int(tag);
 2126|  38.3k|                }
 2127|  38.3k|             }))
 2128|  4.84k|            return;
 2129|       |
 2130|  33.4k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|  33.4k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|  33.4k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|  33.4k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 7.14k, False: 26.3k]
  ------------------
 2138|  7.14k|               ++it;
 2139|  7.14k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 6.57k, False: 573]
  |  Branch (2139:38): [True: 704, False: 5.86k]
  |  Branch (2139:74): [True: 260, False: 5.60k]
  ------------------
 2140|  5.60k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 282, False: 5.32k]
  ------------------
 2141|  1.24k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  1.24k|                  it += 3;
 2143|  1.24k|                  finalize();
 2144|  1.24k|                  return;
 2145|  1.24k|               }
 2146|  5.90k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 5.32k, False: 573]
  |  Branch (2146:38): [True: 1.15k, False: 4.17k]
  |  Branch (2146:74): [True: 227, False: 3.94k]
  ------------------
 2147|  3.94k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 260, False: 3.68k]
  ------------------
 2148|  1.64k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  1.64k|                  it += 3;
 2150|  1.64k|                  finalize();
 2151|  1.64k|                  return;
 2152|  1.64k|               }
 2153|  4.25k|               it = start;
 2154|  4.25k|            }
 2155|       |
 2156|  30.6k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 1.64k, False: 28.9k]
  |  Branch (2156:31): [True: 2.91k, False: 26.0k]
  ------------------
 2157|  4.56k|               const char sign = *it;
 2158|  4.56k|               ++it;
 2159|  4.56k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 4.29k, False: 265]
  |  Branch (2159:33): [True: 1.67k, False: 2.62k]
  ------------------
 2160|  1.67k|                  ++it;
 2161|  1.67k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 1.51k, False: 161]
  |  Branch (2161:41): [True: 279, False: 1.23k]
  |  Branch (2161:77): [True: 602, False: 631]
  ------------------
 2162|  1.01k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 136, False: 495]
  ------------------
 2163|  1.01k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 549, False: 468]
  ------------------
 2164|    549|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|    549|                     }
 2166|    468|                     else {
 2167|    468|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|    468|                     }
 2169|  1.01k|                     it += 3;
 2170|  1.01k|                     finalize();
 2171|  1.01k|                     return;
 2172|  1.01k|                  }
 2173|  1.67k|               }
 2174|  3.54k|               it = start;
 2175|  3.54k|            }
 2176|  30.6k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|  29.5k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  19.0M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 19.0M, False: 7.11k]
  ------------------
 2183|  19.0M|            const char c = *it;
 2184|  19.0M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 9.22k, False: 19.0M]
  |  Branch (2184:29): [True: 1.08k, False: 19.0M]
  |  Branch (2184:42): [True: 6.19k, False: 19.0M]
  |  Branch (2184:55): [True: 1.19k, False: 19.0M]
  |  Branch (2184:68): [True: 1.18k, False: 19.0M]
  |  Branch (2184:80): [True: 655, False: 19.0M]
  |  Branch (2184:92): [True: 979, False: 18.9M]
  |  Branch (2184:104): [True: 2.26k, False: 18.9M]
  ------------------
 2185|  22.7k|               break;
 2186|  22.7k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  18.9M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 30.3k, False: 18.9M]
  ------------------
 2189|  30.3k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 499, False: 29.8k]
  |  Branch (2189:39): [True: 2.33k, False: 27.5k]
  |  Branch (2189:59): [True: 144, False: 27.3k]
  |  Branch (2189:80): [True: 456, False: 26.9k]
  |  Branch (2189:101): [True: 173, False: 26.7k]
  ------------------
 2190|  3.60k|                  break;
 2191|  3.60k|               }
 2192|  30.3k|            }
 2193|  18.9M|            ++it;
 2194|  18.9M|         }
 2195|       |
 2196|  33.4k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|  33.4k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 1.46k, False: 32.0k]
  ------------------
 2199|  1.46k|            ctx.error = error_code::parse_number_failure;
 2200|  1.46k|            return;
 2201|  1.46k|         }
 2202|       |
 2203|       |         // Handle hex, octal, binary
 2204|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2205|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2206|       |               int base = 10;
 2207|       |               size_t offset = 0;
 2208|       |
 2209|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2210|       |                  base = 16;
 2211|       |                  offset = 2;
 2212|       |               }
 2213|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2214|       |                  base = 8;
 2215|       |                  offset = 2;
 2216|       |               }
 2217|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2218|       |                  base = 2;
 2219|       |                  offset = 2;
 2220|       |               }
 2221|       |
 2222|       |               if (base != 10) {
 2223|       |                  const auto digits = num_str.substr(offset);
 2224|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2225|       |
 2226|       |                  std::string clean_storage;
 2227|       |                  std::string_view clean_view;
 2228|       |
 2229|       |                  if (has_underscores) {
 2230|       |                     clean_storage.reserve(digits.size());
 2231|       |                     for (char c : digits) {
 2232|       |                        if (c != '_') {
 2233|       |                           clean_storage.push_back(c);
 2234|       |                        }
 2235|       |                     }
 2236|       |                     clean_view = clean_storage;
 2237|       |                  }
 2238|       |                  else {
 2239|       |                     clean_view = digits;
 2240|       |                  }
 2241|       |
 2242|       |                  auto [ptr, ec] =
 2243|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2244|       |                  if (ec != std::errc{}) {
 2245|       |                     ctx.error = error_code::parse_number_failure;
 2246|       |                  }
 2247|       |                  finalize();
 2248|       |                  return;
 2249|       |               }
 2250|       |            }
 2251|       |         }
 2252|  32.0k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|  32.0k|            bool negative = false;
 2254|  32.0k|            std::string_view digits = num_str;
 2255|       |
 2256|  32.0k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 28.1k, False: 3.90k]
  |  Branch (2256:37): [True: 2.45k, False: 25.6k]
  |  Branch (2256:62): [True: 1.09k, False: 24.5k]
  ------------------
 2257|  3.54k|               negative = (digits.front() == '-');
 2258|  3.54k|               digits.remove_prefix(1);
 2259|  3.54k|            }
 2260|       |
 2261|  32.0k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 17.7k, False: 14.3k]
  |  Branch (2261:38): [True: 9.14k, False: 8.55k]
  ------------------
 2262|  9.14k|               int base = 10;
 2263|  9.14k|               size_t offset = 0;
 2264|       |
 2265|  9.14k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 1.70k, False: 7.44k]
  |  Branch (2265:40): [True: 324, False: 7.12k]
  ------------------
 2266|  2.02k|                  base = 16;
 2267|  2.02k|                  offset = 2;
 2268|  2.02k|               }
 2269|  7.12k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 482, False: 6.63k]
  |  Branch (2269:45): [True: 346, False: 6.29k]
  ------------------
 2270|    828|                  base = 8;
 2271|    828|                  offset = 2;
 2272|    828|               }
 2273|  6.29k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 281, False: 6.01k]
  |  Branch (2273:45): [True: 99, False: 5.91k]
  ------------------
 2274|    380|                  base = 2;
 2275|    380|                  offset = 2;
 2276|    380|               }
 2277|       |
 2278|  9.14k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 3.23k, False: 5.91k]
  ------------------
 2279|  3.23k|                  auto raw_digits = digits.substr(offset);
 2280|  3.23k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  3.23k|                  std::string clean_storage;
 2283|  3.23k|                  std::string_view clean_view;
 2284|  3.23k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 1.16k, False: 2.07k]
  ------------------
 2285|  1.16k|                     clean_storage.reserve(raw_digits.size());
 2286|  2.30M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 2.30M, False: 1.16k]
  ------------------
 2287|  2.30M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 2.30M, False: 2.19k]
  ------------------
 2288|  2.30M|                           clean_storage.push_back(c);
 2289|  2.30M|                        }
 2290|  2.30M|                     }
 2291|  1.16k|                     clean_view = clean_storage;
 2292|  1.16k|                  }
 2293|  2.07k|                  else {
 2294|  2.07k|                     clean_view = raw_digits;
 2295|  2.07k|                  }
 2296|       |
 2297|  3.23k|                  uint64_t parsed_int{};
 2298|  3.23k|                  auto [ptr, ec] =
 2299|  3.23k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  3.23k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 1.73k, False: 1.50k]
  |  Branch (2300:44): [True: 995, False: 507]
  ------------------
 2301|  2.72k|                     ctx.error = error_code::parse_number_failure;
 2302|  2.72k|                     finalize();
 2303|  2.72k|                     return;
 2304|  2.72k|                  }
 2305|       |
 2306|    507|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|    507|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 143, False: 364]
  ------------------
 2308|    507|                  finalize();
 2309|    507|                  return;
 2310|  3.23k|               }
 2311|  9.14k|            }
 2312|  32.0k|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|  28.8k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|  32.0k|         std::string clean_storage;
 2318|  32.0k|         std::string_view clean_view;
 2319|       |
 2320|  32.0k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 1.08k, False: 30.9k]
  ------------------
 2321|  1.08k|            clean_storage.reserve(num_str.size());
 2322|  7.90M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 7.90M, False: 1.08k]
  ------------------
 2323|  7.90M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 7.89M, False: 3.70k]
  ------------------
 2324|  7.89M|                  clean_storage.push_back(c);
 2325|  7.89M|               }
 2326|  7.90M|            }
 2327|  1.08k|            clean_view = clean_storage;
 2328|  1.08k|         }
 2329|  30.9k|         else {
 2330|  30.9k|            clean_view = num_str;
 2331|  30.9k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|  32.0k|         auto parse_view = clean_view;
 2336|  32.0k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 24.7k, False: 7.27k]
  |  Branch (2336:37): [True: 2.45k, False: 22.3k]
  ------------------
 2337|  2.45k|            parse_view.remove_prefix(1);
 2338|  2.45k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 690, False: 1.76k]
  ------------------
 2339|    690|               ctx.error = error_code::parse_number_failure;
 2340|    690|               return;
 2341|    690|            }
 2342|  2.45k|         }
 2343|       |
 2344|  31.3k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|  31.3k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2346|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2347|  31.3k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 15.4k, False: 15.9k]
  |  Branch (2347:45): [True: 13.0k, False: 2.84k]
  ------------------
 2348|  21.3k|               ctx.error = error_code::parse_number_failure;
 2349|  21.3k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|  31.3k|         finalize();
 2360|  31.3k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEELb0ERdNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EdE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  38.3k|      {
  466|  38.3k|         skip_inline_ws(it, end);
  467|       |
  468|  38.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 242, False: 38.0k]
  ------------------
  469|    242|            if constexpr (!AllowEmptyInput) {
  470|    242|               ctx.error = error_code::unexpected_end;
  471|    242|            }
  472|    242|            return true;
  473|    242|         }
  474|       |
  475|  38.0k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  38.0k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 327, False: 37.7k]
  ------------------
  477|    327|            ctx.error = error_code::syntax_error;
  478|    327|            return true;
  479|    327|         }
  480|  37.7k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 216, False: 37.5k]
  ------------------
  481|    216|            ctx.error = error_code::syntax_error;
  482|    216|            return true;
  483|    216|         }
  484|       |
  485|  37.5k|         skip_inline_ws(it, end);
  486|       |
  487|  37.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 154, False: 37.4k]
  ------------------
  488|    154|            if constexpr (!AllowEmptyInput) {
  489|    154|               ctx.error = error_code::unexpected_end;
  490|    154|            }
  491|    154|            return true;
  492|    154|         }
  493|       |
  494|  37.4k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.90k, False: 33.4k]
  ------------------
  495|  3.90k|            return true;
  496|  3.90k|         }
  497|       |
  498|  33.4k|         return false;
  499|  37.4k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2120|  37.7k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|  37.7k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  37.7k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|  37.7k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  37.4k|      {
  409|  37.4k|         state.has_anchor = false;
  410|  37.4k|         state.anchor_name.clear();
  411|  37.4k|         state.anchor_start = nullptr;
  412|  37.4k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  37.4k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  37.4k|            else {
  421|  37.4k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.25k, False: 34.1k]
  ------------------
  422|  37.4k|            }
  423|  37.4k|         }
  424|       |
  425|  37.4k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 34.1k, False: 3.25k]
  |  Branch (425:27): [True: 2.57k, False: 31.5k]
  ------------------
  426|  2.57k|            ++it;
  427|  2.57k|            auto name = parse_anchor_name(it, end);
  428|  2.57k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 337, False: 2.23k]
  ------------------
  429|    337|               ctx.error = error_code::syntax_error;
  430|    337|               return true;
  431|    337|            }
  432|  2.23k|            skip_inline_ws(it, end);
  433|  2.23k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 310, False: 1.92k]
  ------------------
  434|    310|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    310|                  ctx.error = error_code::unexpected_end;
  436|    310|               }
  437|    310|               return true;
  438|    310|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  1.92k|            state.has_anchor = true;
  446|  1.92k|            state.anchor_name = std::string(name);
  447|  1.92k|            state.anchor_start = &*it;
  448|  1.92k|         }
  449|       |
  450|  36.7k|         return false;
  451|  37.4k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  37.4k|      {
  301|  37.4k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 37.4k]
  |  Branch (301:27): [True: 34.1k, False: 3.25k]
  ------------------
  302|       |
  303|  3.25k|         ++it; // skip '*'
  304|  3.25k|         auto name = parse_anchor_name(it, end);
  305|  3.25k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 313, False: 2.94k]
  ------------------
  306|    313|            ctx.error = error_code::syntax_error;
  307|    313|            return true;
  308|    313|         }
  309|       |
  310|  2.94k|         auto anchor_it = ctx.anchors.find(name);
  311|  2.94k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 1.07k, False: 1.86k]
  ------------------
  312|  1.07k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  1.07k|            return true;
  314|  1.07k|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  1.86k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.86k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 439, False: 1.42k]
  ------------------
  322|    439|            return true;
  323|    439|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  1.42k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 134, False: 1.29k]
  ------------------
  329|    134|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    134|            return true;
  331|    134|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  1.29k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.29k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 1.29k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  1.29k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.29k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  1.29k|         auto replay_it = span.begin;
  348|  1.29k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.29k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.29k|         ctx.indent_stack.clear();
  353|  1.29k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 570, False: 723]
  ------------------
  354|    570|            ctx.push_indent(span.base_indent - 1);
  355|    570|         }
  356|       |
  357|  1.29k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.29k|         using V = std::remove_cvref_t<T>;
  360|  1.29k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.29k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.29k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.29k|         return true;
  367|  1.29k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|  31.3k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|  21.0k|      {
 5284|  21.0k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|  21.0k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|  21.0k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|  21.0k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|  21.0k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 21.0k, False: 0]
  ------------------
 5294|  21.0k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|  21.0k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2080|  26.3k|      {
 2081|  26.3k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 26.3k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  26.3k|         yaml::node_preamble_state preamble{};
 2085|  26.3k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 6.33k, False: 20.0k]
  ------------------
 2086|  26.3k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  6.33k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  20.0k|         std::string str;
 2091|  20.0k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  20.0k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 9.45k, False: 10.5k]
  |  Branch (2093:31): [True: 2.44k, False: 8.14k]
  |  Branch (2093:48): [True: 607, False: 7.54k]
  |  Branch (2093:65): [True: 247, False: 7.29k]
  |  Branch (2093:81): [True: 322, False: 6.97k]
  |  Branch (2093:97): [True: 315, False: 6.65k]
  ------------------
 2094|  14.1k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 195, False: 6.46k]
  |  Branch (2094:29): [True: 127, False: 6.33k]
  |  Branch (2094:44): [True: 390, False: 5.94k]
  ------------------
 2095|  14.1k|            value = true;
 2096|  14.1k|         }
 2097|  5.94k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 1.34k, False: 4.59k]
  |  Branch (2097:37): [True: 1.95k, False: 2.63k]
  |  Branch (2097:55): [True: 913, False: 1.72k]
  |  Branch (2097:73): [True: 318, False: 1.40k]
  |  Branch (2097:88): [True: 354, False: 1.05k]
  |  Branch (2097:103): [True: 261, False: 792]
  ------------------
 2098|  5.79k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 119, False: 673]
  |  Branch (2098:35): [True: 262, False: 411]
  |  Branch (2098:51): [True: 258, False: 153]
  ------------------
 2099|  5.79k|            value = false;
 2100|  5.79k|         }
 2101|    153|         else {
 2102|    153|            ctx.error = error_code::expected_true_or_false;
 2103|    153|         }
 2104|       |
 2105|  20.0k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  20.0k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  26.3k|      {
  466|  26.3k|         skip_inline_ws(it, end);
  467|       |
  468|  26.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 8, False: 26.3k]
  ------------------
  469|      8|            if constexpr (!AllowEmptyInput) {
  470|      8|               ctx.error = error_code::unexpected_end;
  471|      8|            }
  472|      8|            return true;
  473|      8|         }
  474|       |
  475|  26.3k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  26.3k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 26.3k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|  26.3k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 26.3k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  26.3k|         skip_inline_ws(it, end);
  486|       |
  487|  26.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 26.3k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|  26.3k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 6.32k, False: 20.0k]
  ------------------
  495|  6.32k|            return true;
  496|  6.32k|         }
  497|       |
  498|  20.0k|         return false;
  499|  26.3k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2086|  26.3k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEERbNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  26.3k|      {
  409|  26.3k|         state.has_anchor = false;
  410|  26.3k|         state.anchor_name.clear();
  411|  26.3k|         state.anchor_start = nullptr;
  412|  26.3k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  26.3k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  26.3k|            else {
  421|  26.3k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 6.30k, False: 20.0k]
  ------------------
  422|  26.3k|            }
  423|  26.3k|         }
  424|       |
  425|  26.3k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 20.0k, False: 6.30k]
  |  Branch (425:27): [True: 1.20k, False: 18.8k]
  ------------------
  426|  1.20k|            ++it;
  427|  1.20k|            auto name = parse_anchor_name(it, end);
  428|  1.20k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 4, False: 1.20k]
  ------------------
  429|      4|               ctx.error = error_code::syntax_error;
  430|      4|               return true;
  431|      4|            }
  432|  1.20k|            skip_inline_ws(it, end);
  433|  1.20k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 15, False: 1.18k]
  ------------------
  434|     15|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     15|                  ctx.error = error_code::unexpected_end;
  436|     15|               }
  437|     15|               return true;
  438|     15|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  1.18k|            state.has_anchor = true;
  446|  1.18k|            state.anchor_name = std::string(name);
  447|  1.18k|            state.anchor_start = &*it;
  448|  1.18k|         }
  449|       |
  450|  26.3k|         return false;
  451|  26.3k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  26.3k|      {
  301|  26.3k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 26.3k]
  |  Branch (301:27): [True: 20.0k, False: 6.30k]
  ------------------
  302|       |
  303|  6.30k|         ++it; // skip '*'
  304|  6.30k|         auto name = parse_anchor_name(it, end);
  305|  6.30k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 12, False: 6.29k]
  ------------------
  306|     12|            ctx.error = error_code::syntax_error;
  307|     12|            return true;
  308|     12|         }
  309|       |
  310|  6.29k|         auto anchor_it = ctx.anchors.find(name);
  311|  6.29k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 27, False: 6.26k]
  ------------------
  312|     27|            ctx.error = error_code::syntax_error; // undefined alias
  313|     27|            return true;
  314|     27|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  6.26k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  6.26k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 891, False: 5.37k]
  ------------------
  322|    891|            return true;
  323|    891|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  5.37k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 3, False: 5.37k]
  ------------------
  329|      3|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      3|            return true;
  331|      3|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  5.37k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  5.37k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 5.37k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  5.37k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 5.37k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  5.37k|         auto replay_it = span.begin;
  348|  5.37k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  5.37k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  5.37k|         ctx.indent_stack.clear();
  353|  5.37k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.35k, False: 3.01k]
  ------------------
  354|  2.35k|            ctx.push_indent(span.base_indent - 1);
  355|  2.35k|         }
  356|       |
  357|  5.37k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  5.37k|         using V = std::remove_cvref_t<T>;
  360|  5.37k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  5.37k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  5.37k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  5.37k|         return true;
  367|  5.37k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2466|  6.19k|      {
 2467|  6.19k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 6.19k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  6.19k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  6.19k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 10, False: 6.18k]
  ------------------
 2473|     10|            ctx.error = error_code::unexpected_end;
 2474|     10|            return;
 2475|     10|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  6.18k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 1.02k, False: 5.16k]
  ------------------
 2479|  1.02k|            ++it;
 2480|  1.02k|            return;
 2481|  1.02k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  5.16k|         auto start = it;
 2485|  72.5k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 72.3k, False: 237]
  |  Branch (2485:30): [True: 67.4k, False: 4.92k]
  ------------------
 2486|  67.4k|            ++it;
 2487|  67.4k|         }
 2488|       |
 2489|  5.16k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  5.16k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 28, False: 5.13k]
  ------------------
 2491|     28|            ctx.error = error_code::syntax_error;
 2492|     28|         }
 2493|  5.16k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   121k|      {
 5284|   121k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   121k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   121k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   121k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   121k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 121k, False: 0]
  ------------------
 5294|   121k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   121k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4176|   124k|      {
 4177|   124k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4177:14): [True: 0, False: 124k]
  ------------------
 4178|      0|            return;
 4179|       |
 4180|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4181|   124k|         auto peek = it;
 4182|   124k|         yaml::node_preamble_state preamble{};
 4183|   124k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4183:14): [True: 4.06k, False: 120k]
  ------------------
 4184|   124k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4185|  4.06k|            it = peek;
 4186|  4.06k|            return;
 4187|  4.06k|         }
 4188|       |
 4189|   120k|         if (*peek == '[') {
  ------------------
  |  Branch (4189:14): [True: 30.7k, False: 89.9k]
  ------------------
 4190|       |            // Flow sequence - consume whitespace and parse
 4191|  30.7k|            it = peek;
 4192|  30.7k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4193|  30.7k|         }
 4194|  89.9k|         else if (*peek == '-') {
  ------------------
  |  Branch (4194:19): [True: 89.8k, False: 91]
  ------------------
 4195|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4196|       |            // But if there was a tag, we need to advance past it
 4197|  89.8k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4197:17): [True: 290, False: 89.5k]
  |  Branch (4197:57): [True: 715, False: 88.8k]
  ------------------
 4198|  1.00k|               it = peek;
 4199|  1.00k|            }
 4200|  89.8k|            int32_t seq_indent = ctx.current_indent();
 4201|  89.8k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4201:17): [True: 89.5k, False: 293]
  |  Branch (4201:31): [True: 75.6k, False: 13.9k]
  ------------------
 4202|  75.6k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4202:29): [True: 54.1k, False: 21.4k]
  |  Branch (4202:62): [True: 46.2k, False: 7.92k]
  ------------------
 4203|  75.6k|                                                          : (ctx.current_indent() + 1);
 4204|  75.6k|            }
 4205|  89.8k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4206|  89.8k|         }
 4207|     91|         else {
 4208|     91|            ctx.error = error_code::syntax_error;
 4209|     91|         }
 4210|       |
 4211|   120k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4212|   120k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEELb0ERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_ZNS_4fromILj450ESC_E2opITnDaXtlS2_Lj450ELb0ELb0ELb1ELb1EEERSG_SD_TkNS_10is_contextERSE_SG_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSP_RSS_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   124k|      {
  466|   124k|         skip_inline_ws(it, end);
  467|       |
  468|   124k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 11, False: 124k]
  ------------------
  469|     11|            if constexpr (!AllowEmptyInput) {
  470|     11|               ctx.error = error_code::unexpected_end;
  471|     11|            }
  472|     11|            return true;
  473|     11|         }
  474|       |
  475|   124k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   124k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 124k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|   124k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 4, False: 124k]
  ------------------
  481|      4|            ctx.error = error_code::syntax_error;
  482|      4|            return true;
  483|      4|         }
  484|       |
  485|   124k|         skip_inline_ws(it, end);
  486|       |
  487|   124k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 124k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|   124k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 4.04k, False: 120k]
  ------------------
  495|  4.04k|            return true;
  496|  4.04k|         }
  497|       |
  498|   120k|         return false;
  499|   124k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_ENKUlNSH_8yaml_tagEE_clESR_:
 4184|   124k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   124k|      {
  409|   124k|         state.has_anchor = false;
  410|   124k|         state.anchor_name.clear();
  411|   124k|         state.anchor_start = nullptr;
  412|   124k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   124k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   124k|            else {
  421|   124k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 4.01k, False: 120k]
  ------------------
  422|   124k|            }
  423|   124k|         }
  424|       |
  425|   124k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 120k, False: 4.01k]
  |  Branch (425:27): [True: 1.05k, False: 119k]
  ------------------
  426|  1.05k|            ++it;
  427|  1.05k|            auto name = parse_anchor_name(it, end);
  428|  1.05k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 9, False: 1.04k]
  ------------------
  429|      9|               ctx.error = error_code::syntax_error;
  430|      9|               return true;
  431|      9|            }
  432|  1.04k|            skip_inline_ws(it, end);
  433|  1.04k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 24, False: 1.01k]
  ------------------
  434|     24|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     24|                  ctx.error = error_code::unexpected_end;
  436|     24|               }
  437|     24|               return true;
  438|     24|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  1.01k|            state.has_anchor = true;
  446|  1.01k|            state.anchor_name = std::string(name);
  447|  1.01k|            state.anchor_start = &*it;
  448|  1.01k|         }
  449|       |
  450|   124k|         return false;
  451|   124k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   124k|      {
  301|   124k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 124k]
  |  Branch (301:27): [True: 120k, False: 4.01k]
  ------------------
  302|       |
  303|  4.01k|         ++it; // skip '*'
  304|  4.01k|         auto name = parse_anchor_name(it, end);
  305|  4.01k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 5, False: 4.00k]
  ------------------
  306|      5|            ctx.error = error_code::syntax_error;
  307|      5|            return true;
  308|      5|         }
  309|       |
  310|  4.00k|         auto anchor_it = ctx.anchors.find(name);
  311|  4.00k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 23, False: 3.98k]
  ------------------
  312|     23|            ctx.error = error_code::syntax_error; // undefined alias
  313|     23|            return true;
  314|     23|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  3.98k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.98k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 837, False: 3.14k]
  ------------------
  322|    837|            return true;
  323|    837|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  3.14k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 15, False: 3.13k]
  ------------------
  329|     15|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     15|            return true;
  331|     15|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  3.13k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.13k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 3.12k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  3.12k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.12k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  3.12k|         auto replay_it = span.begin;
  348|  3.12k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.12k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.12k|         ctx.indent_stack.clear();
  353|  3.12k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.22k, False: 1.90k]
  ------------------
  354|  1.22k|            ctx.push_indent(span.base_indent - 1);
  355|  1.22k|         }
  356|       |
  357|  3.12k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.12k|         using V = std::remove_cvref_t<T>;
  360|  3.12k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.12k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.12k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.12k|         return true;
  367|  3.12k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  30.7k|      {
 2665|  30.7k|         using V = std::remove_cvref_t<T>;
 2666|  30.7k|         using value_type = typename V::value_type;
 2667|       |
 2668|  30.7k|         struct sequence_container_adapter
 2669|  30.7k|         {
 2670|  30.7k|            size_t index = 0;
 2671|       |
 2672|  30.7k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  30.7k|            {
 2674|  30.7k|               if constexpr (!resizable<V>) {
 2675|  30.7k|                  return index >= container.size();
 2676|  30.7k|               }
 2677|  30.7k|               else {
 2678|  30.7k|                  (void)container;
 2679|  30.7k|                  return false;
 2680|  30.7k|               }
 2681|  30.7k|            }
 2682|       |
 2683|  30.7k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  30.7k|            inline void append(V& container, value_type&& element) noexcept
 2686|  30.7k|            {
 2687|  30.7k|               if constexpr (emplace_backable<V>) {
 2688|  30.7k|                  container.emplace_back(std::move(element));
 2689|  30.7k|               }
 2690|  30.7k|               else if constexpr (emplaceable<V>) {
 2691|  30.7k|                  container.emplace(std::move(element));
 2692|  30.7k|               }
 2693|  30.7k|            }
 2694|  30.7k|         };
 2695|       |
 2696|  30.7k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 30.7k]
  |  Branch (2696:27): [True: 0, False: 30.7k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|  30.7k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  30.7k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  30.7k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  30.7k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 29, False: 30.7k]
  ------------------
 2709|     29|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  30.7k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 30.1k, False: 560]
  |  Branch (2712:27): [True: 3.15k, False: 27.0k]
  ------------------
 2713|  3.15k|            ++it;
 2714|  3.15k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  3.15k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 16, False: 3.13k]
  ------------------
 2716|     16|               return;
 2717|  3.13k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|  3.13k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2718:20): [True: 275, False: 2.86k]
  ------------------
 2719|    275|                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|    275|               }
 2721|  3.13k|            }
 2722|  3.13k|            return;
 2723|  3.15k|         }
 2724|       |
 2725|  27.6k|         bool just_saw_comma = false;
 2726|  27.6k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  27.6k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|   616k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 615k, False: 1.06k]
  ------------------
 2731|   615k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|   615k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 615k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|   615k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 615k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|   615k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 5.10k, False: 609k]
  ------------------
 2741|  5.10k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 5.10k, False: 0]
  ------------------
 2742|  5.10k|                     ++it;
 2743|  5.10k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  5.10k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 5, False: 5.10k]
  ------------------
 2745|      5|                        return;
 2746|  5.10k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|  5.10k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2747:29): [True: 620, False: 4.48k]
  ------------------
 2748|    620|                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|    620|                        }
 2750|  5.10k|                     }
 2751|  5.10k|                     return;
 2752|  5.10k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  5.10k|               }
 2756|       |
 2757|   609k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 97, False: 609k]
  |  Branch (2757:34): [True: 18, False: 609k]
  ------------------
 2758|    115|                  ctx.error = error_code::syntax_error;
 2759|    115|                  return;
 2760|    115|               }
 2761|   609k|               just_saw_comma = false;
 2762|       |
 2763|   609k|               value_type element{};
 2764|   609k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|   609k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 13.3k, False: 596k]
  ------------------
 2767|  13.3k|                  return;
 2768|       |
 2769|   596k|               bool saw_line_break_before_separator = false;
 2770|   596k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|   596k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 7, False: 596k]
  ------------------
 2772|      7|                  return;
 2773|       |
 2774|   596k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 594k, False: 2.28k]
  |  Branch (2774:33): [True: 3.64k, False: 590k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  3.64k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 47, False: 3.59k]
  ------------------
 2777|     47|                     ctx.error = error_code::syntax_error;
 2778|     47|                     return;
 2779|     47|                  }
 2780|  3.59k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  3.59k|                     glz::generic key_node = std::move(element);
 2782|  3.59k|                     ++it;
 2783|  3.59k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  3.59k|                     glz::generic mapped{};
 2786|  3.59k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  3.59k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 371, False: 3.22k]
  ------------------
 2788|    371|                        return;
 2789|       |
 2790|  3.22k|                     std::string key;
 2791|  3.22k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 6, False: 3.22k]
  ------------------
 2792|      6|                        return;
 2793|       |
 2794|  3.22k|                     glz::generic pair{};
 2795|  3.22k|                     pair[key] = std::move(mapped);
 2796|  3.22k|                     element = std::move(pair);
 2797|       |
 2798|  3.22k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  3.22k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 0, False: 3.22k]
  ------------------
 2800|      0|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  3.59k|               }
 2807|       |
 2808|   596k|               adapter.append(value, std::move(element));
 2809|       |
 2810|   596k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 2.41k, False: 594k]
  ------------------
 2811|  2.41k|                  ctx.error = error_code::unexpected_end;
 2812|  2.41k|                  return;
 2813|  2.41k|               }
 2814|       |
 2815|   594k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 3.88k, False: 590k]
  ------------------
 2816|  3.88k|                  ++it;
 2817|  3.88k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  3.88k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 32, False: 3.85k]
  ------------------
 2819|     32|                     return;
 2820|  3.85k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|  3.85k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2821:26): [True: 622, False: 3.23k]
  ------------------
 2822|    622|                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|    622|                     }
 2824|  3.85k|                  }
 2825|  3.85k|                  return;
 2826|  3.88k|               }
 2827|   590k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 588k, False: 1.63k]
  ------------------
 2828|   588k|                  ++it;
 2829|   588k|                  just_saw_comma = true;
 2830|   588k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|   588k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 5, False: 588k]
  ------------------
 2832|      5|                     return;
 2833|   588k|               }
 2834|  1.63k|               else {
 2835|  1.63k|                  ctx.error = error_code::syntax_error;
 2836|  1.63k|                  return;
 2837|  1.63k|               }
 2838|   594k|            }
 2839|       |         }
 2840|       |         else if constexpr (!resizable<V>) {
 2841|       |            // Fixed-size containers (std::array)
 2842|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2843|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2844|       |               if (bool(ctx.error)) [[unlikely]]
 2845|       |                  return;
 2846|       |
 2847|       |               if (it == end) [[unlikely]] {
 2848|       |                  ctx.error = error_code::unexpected_end;
 2849|       |                  return;
 2850|       |               }
 2851|       |
 2852|       |               if (*it == ']') {
 2853|       |                  if (just_saw_comma) {
 2854|       |                     ++it;
 2855|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2856|       |                     if (bool(ctx.error)) [[unlikely]]
 2857|       |                        return;
 2858|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2859|       |                        if (ctx.current_indent() < 0) {
 2860|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2861|       |                        }
 2862|       |                     }
 2863|       |                     return;
 2864|       |                  }
 2865|       |                  ctx.error = error_code::syntax_error;
 2866|       |                  return;
 2867|       |               }
 2868|       |
 2869|       |               if (*it == ',' || *it == '#') {
 2870|       |                  ctx.error = error_code::syntax_error;
 2871|       |                  return;
 2872|       |               }
 2873|       |               just_saw_comma = false;
 2874|       |
 2875|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2876|       |
 2877|       |               if (bool(ctx.error)) [[unlikely]]
 2878|       |                  return;
 2879|       |
 2880|       |               adapter.commit_fixed_slot();
 2881|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2882|       |               if (bool(ctx.error)) [[unlikely]]
 2883|       |                  return;
 2884|       |
 2885|       |               if (it == end) [[unlikely]] {
 2886|       |                  ctx.error = error_code::unexpected_end;
 2887|       |                  return;
 2888|       |               }
 2889|       |
 2890|       |               if (*it == ']') {
 2891|       |                  ++it;
 2892|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2893|       |                  if (bool(ctx.error)) [[unlikely]]
 2894|       |                     return;
 2895|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2896|       |                     if (ctx.current_indent() < 0) {
 2897|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2898|       |                     }
 2899|       |                  }
 2900|       |                  return;
 2901|       |               }
 2902|       |               else if (*it == ',') {
 2903|       |                  ++it;
 2904|       |                  just_saw_comma = true;
 2905|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2906|       |                  if (bool(ctx.error)) [[unlikely]]
 2907|       |                     return;
 2908|       |               }
 2909|       |               else {
 2910|       |                  ctx.error = error_code::syntax_error;
 2911|       |                  return;
 2912|       |               }
 2913|       |            }
 2914|       |
 2915|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2916|       |            // skip to the closing bracket to consume overflow elements.
 2917|       |            int bracket_depth = 1;
 2918|       |            while (it != end && bracket_depth > 0) {
 2919|       |               if (*it == '[') {
 2920|       |                  ++bracket_depth;
 2921|       |               }
 2922|       |               else if (*it == ']') {
 2923|       |                  --bracket_depth;
 2924|       |               }
 2925|       |               ++it;
 2926|       |            }
 2927|       |         }
 2928|       |         else {
 2929|       |            ctx.error = error_code::syntax_error;
 2930|       |            return;
 2931|       |         }
 2932|  27.6k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   120k|      {
 2649|   120k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   120k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   120k|               value.clear();
 2653|   120k|            }
 2654|       |         }
 2655|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2656|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2657|       |            value.clear();
 2658|       |         }
 2659|   120k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2686|   596k|            {
 2687|   596k|               if constexpr (emplace_backable<V>) {
 2688|   596k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|   596k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|  89.8k|      {
 3160|  89.8k|         using V = std::remove_cvref_t<T>;
 3161|  89.8k|         using value_type = typename V::value_type;
 3162|       |
 3163|  89.8k|         struct sequence_container_adapter
 3164|  89.8k|         {
 3165|  89.8k|            size_t index = 0;
 3166|       |
 3167|  89.8k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|  89.8k|            {
 3169|  89.8k|               if constexpr (!resizable<V>) {
 3170|  89.8k|                  return index >= container.size();
 3171|  89.8k|               }
 3172|  89.8k|               else {
 3173|  89.8k|                  (void)container;
 3174|  89.8k|                  return false;
 3175|  89.8k|               }
 3176|  89.8k|            }
 3177|       |
 3178|  89.8k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|  89.8k|            inline void append(V& container, value_type&& element) noexcept
 3181|  89.8k|            {
 3182|  89.8k|               if constexpr (emplace_backable<V>) {
 3183|  89.8k|                  container.emplace_back(std::move(element));
 3184|  89.8k|               }
 3185|  89.8k|               else if constexpr (emplaceable<V>) {
 3186|  89.8k|                  container.emplace(std::move(element));
 3187|  89.8k|               }
 3188|  89.8k|            }
 3189|  89.8k|         };
 3190|       |
 3191|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3192|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3193|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3194|  89.8k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|  89.8k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|  89.8k|         bool first_item = true;
 3200|  89.8k|         bool has_pending_item_anchor = false;
 3201|  89.8k|         std::string pending_item_anchor_name{};
 3202|  89.8k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   249k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 189k, False: 60.7k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   189k|            int32_t line_indent = 0;
 3215|   189k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   189k|            auto line_start = it;
 3217|       |
 3218|   303k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 290k, False: 13.1k]
  ------------------
 3219|   290k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 7.92k, False: 282k]
  ------------------
 3220|  7.92k|                  skip_comment(it, end);
 3221|  7.92k|                  skip_newline(it, end);
 3222|  7.92k|                  line_start = it;
 3223|  7.92k|                  line_indent = 0;
 3224|  7.92k|               }
 3225|   282k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 36.5k, False: 245k]
  |  Branch (3225:40): [True: 55.0k, False: 190k]
  ------------------
 3226|  91.5k|                  skip_newline(it, end);
 3227|  91.5k|                  line_start = it;
 3228|  91.5k|                  line_indent = 0;
 3229|  91.5k|               }
 3230|   190k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 39.0k, False: 151k]
  ------------------
 3231|  39.0k|                  line_start = it;
 3232|  39.0k|                  line_indent = 0;
 3233|   120k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 120k, False: 426]
  |  Branch (3233:39): [True: 81.4k, False: 38.5k]
  ------------------
 3234|  81.4k|                     ++line_indent;
 3235|  81.4k|                     ++it;
 3236|  81.4k|                  }
 3237|       |
 3238|  39.0k|                  bool saw_tab = false;
 3239|  40.6k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 40.1k, False: 468]
  |  Branch (3239:40): [True: 342, False: 39.8k]
  |  Branch (3239:54): [True: 1.28k, False: 38.5k]
  ------------------
 3240|  1.62k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 1.18k, False: 442]
  |  Branch (3240:43): [True: 442, False: 0]
  ------------------
 3241|  1.62k|                     ++it;
 3242|  1.62k|                  }
 3243|       |
 3244|  39.0k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 468, False: 38.5k]
  |  Branch (3244:36): [True: 757, False: 37.7k]
  |  Branch (3244:51): [True: 7.66k, False: 30.1k]
  |  Branch (3244:66): [True: 4.47k, False: 25.6k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  13.3k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 12.8k, False: 468]
  |  Branch (3246:39): [True: 4.47k, False: 8.42k]
  ------------------
 3247|  4.47k|                        skip_comment(it, end);
 3248|  4.47k|                     }
 3249|  13.3k|                     line_indent = 0;
 3250|  13.3k|                     continue;
 3251|  13.3k|                  }
 3252|       |
 3253|  25.6k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 11, False: 25.6k]
  ------------------
 3254|     11|                     ctx.error = error_code::syntax_error;
 3255|     11|                     return;
 3256|     11|                  }
 3257|  25.6k|                  break; // Found content
 3258|  25.6k|               }
 3259|   151k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 1.63k, False: 150k]
  ------------------
 3260|  1.63k|                  line_start = it;
 3261|  7.57k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 7.29k, False: 282]
  |  Branch (3261:40): [True: 632, False: 6.65k]
  |  Branch (3261:54): [True: 5.30k, False: 1.35k]
  ------------------
 3262|  1.63k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 282, False: 1.35k]
  |  Branch (3262:36): [True: 422, False: 929]
  |  Branch (3262:51): [True: 343, False: 586]
  |  Branch (3262:66): [True: 565, False: 21]
  ------------------
 3263|  1.61k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 1.33k, False: 282]
  |  Branch (3263:39): [True: 565, False: 765]
  ------------------
 3264|    565|                        skip_comment(it, end);
 3265|    565|                     }
 3266|  1.61k|                     line_indent = 0;
 3267|  1.61k|                     continue;
 3268|  1.61k|                  }
 3269|     21|                  ctx.error = error_code::syntax_error;
 3270|     21|                  return;
 3271|  1.63k|               }
 3272|   150k|               else {
 3273|       |                  // At content (no leading space on this line)
 3274|       |                  // If first item and at '-', whitespace was consumed by caller;
 3275|       |                  // treat as having correct indentation
 3276|   150k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 89.8k, False: 60.4k]
  |  Branch (3276:37): [True: 89.5k, False: 293]
  ------------------
 3277|  89.5k|                     line_indent = sequence_indent;
 3278|  89.5k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|  89.5k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 89.5k, False: 0]
  |  Branch (3279:49): [True: 88.9k, False: 617]
  ------------------
 3280|  88.9k|                           auto probe = it;
 3281|  88.9k|                           int32_t leading_ws = 0;
 3282|  88.9k|                           bool saw_tab = false;
 3283|   210k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 210k, False: 99]
  |  Branch (3283:64): [True: 119k, False: 90.6k]
  |  Branch (3283:87): [True: 1.79k, False: 88.8k]
  ------------------
 3284|   121k|                              --probe;
 3285|   121k|                              ++leading_ws;
 3286|   121k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 752, False: 120k]
  |  Branch (3286:52): [True: 1.07k, False: 119k]
  ------------------
 3287|   121k|                           }
 3288|  88.9k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 99, False: 88.8k]
  |  Branch (3288:61): [True: 51.9k, False: 36.8k]
  |  Branch (3288:85): [True: 9.81k, False: 27.0k]
  ------------------
 3289|  61.8k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 23, False: 61.8k]
  ------------------
 3290|     23|                                 ctx.error = error_code::syntax_error;
 3291|     23|                                 return;
 3292|     23|                              }
 3293|  61.8k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  61.8k|                           }
 3295|  88.9k|                        }
 3296|  89.5k|                     }
 3297|  89.5k|                  }
 3298|  89.5k|                  break;
 3299|   150k|               }
 3300|   290k|            }
 3301|       |
 3302|   189k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 13.1k, False: 175k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   175k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 743, False: 175k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   175k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 3.82k, False: 171k]
  ------------------
 3309|  3.82k|               it = line_start;
 3310|  3.82k|               return;
 3311|  3.82k|            }
 3312|       |
 3313|   171k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 4.75k, False: 166k]
  ------------------
 3314|       |               // Standalone anchor lines before "- item" are only supported for
 3315|       |               // indentless mapping values. At top-level block sequences these are
 3316|       |               // malformed in yaml-test-suite cases.
 3317|  4.75k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 5, False: 4.74k]
  ------------------
 3318|      5|                  ctx.error = error_code::syntax_error;
 3319|      5|                  return;
 3320|      5|               }
 3321|       |
 3322|  4.74k|               ++it;
 3323|  4.74k|               auto pending_name = parse_anchor_name(it, end);
 3324|  4.74k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 11, False: 4.73k]
  ------------------
 3325|     11|                  ctx.error = error_code::syntax_error;
 3326|     11|                  return;
 3327|     11|               }
 3328|  4.73k|               skip_inline_ws(it, end);
 3329|  4.73k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 4.69k, False: 44]
  |  Branch (3329:33): [True: 996, False: 3.69k]
  ------------------
 3330|    996|                  skip_comment(it, end);
 3331|    996|               }
 3332|       |
 3333|  4.73k|               has_pending_item_anchor = true;
 3334|  4.73k|               pending_item_anchor_name = std::string(pending_name);
 3335|  4.73k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  4.73k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 55, False: 4.68k]
  |  Branch (3337:34): [True: 2.14k, False: 2.53k]
  |  Branch (3337:49): [True: 28, False: 2.11k]
  ------------------
 3338|     83|                  ctx.error = error_code::syntax_error;
 3339|     83|                  return;
 3340|     83|               }
 3341|       |
 3342|  4.65k|               skip_newline(it, end);
 3343|  4.65k|               continue;
 3344|  4.73k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   166k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 7.78k, False: 158k]
  ------------------
 3348|  7.78k|               it = line_start;
 3349|  7.78k|               return;
 3350|  7.78k|            }
 3351|       |
 3352|       |            // Compute the actual column of this sequence dash.
 3353|       |            // This is needed by plain-scalar multiline folding to distinguish
 3354|       |            // sibling "- item" entries from deeper "- " continuation content.
 3355|   158k|            dash_col = line_indent;
 3356|   158k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   158k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 158k, False: 23]
  ------------------
 3358|   158k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   158k|               }
 3360|   158k|            }
 3361|       |
 3362|   158k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   158k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 157k, False: 1.17k]
  |  Branch (3365:30): [True: 2.69k, False: 154k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  2.69k|               it = line_start;
 3368|  2.69k|               return;
 3369|  2.69k|            }
 3370|       |
 3371|   156k|            bool saw_tab_after_dash = false;
 3372|   357k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 355k, False: 1.73k]
  |  Branch (3372:34): [True: 191k, False: 164k]
  |  Branch (3372:48): [True: 9.81k, False: 154k]
  ------------------
 3373|   201k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 1.33k, False: 199k]
  |  Branch (3373:59): [True: 8.64k, False: 191k]
  ------------------
 3374|   201k|               ++it;
 3375|   201k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   156k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 8.64k, False: 147k]
  |  Branch (3377:39): [True: 8.37k, False: 273]
  |  Branch (3377:52): [True: 303, False: 8.06k]
  ------------------
 3378|    303|               const auto after_dash = it + 1;
 3379|    303|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 5, False: 298]
  |  Branch (3379:41): [True: 5, False: 293]
  ------------------
 3380|     10|                  ctx.error = error_code::syntax_error;
 3381|     10|                  return;
 3382|     10|               }
 3383|    303|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   156k|            auto parse_element = [&](auto& element) {
 3387|   156k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   156k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   156k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   156k|                     return;
 3397|   156k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   156k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   156k|                  ctx.sequence_item_value_context = true;
 3400|   156k|                  ctx.sequence_dash_indent = dash_col;
 3401|   156k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   156k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   156k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   156k|                  ctx.pop_indent();
 3405|   156k|               }
 3406|   156k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   156k|                  skip_ws_and_comment(it, end);
 3409|   156k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   156k|                  auto nested_start = it;
 3413|   156k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   156k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   156k|                     return;
 3416|   156k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   156k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   156k|                  if (nested_indent > effective_line_indent) {
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|   156k|                     const int32_t element_indent =
 3428|   156k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   156k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   156k|                        return;
 3431|   156k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   156k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   156k|                     ctx.sequence_item_value_context = true;
 3434|   156k|                     ctx.sequence_dash_indent = dash_col;
 3435|   156k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   156k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   156k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   156k|                     ctx.pop_indent();
 3439|   156k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   156k|               }
 3442|       |
 3443|   156k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   156k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   156k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   156k|                                                                      pending_item_anchor_indent};
 3447|   156k|                  has_pending_item_anchor = false;
 3448|   156k|               }
 3449|   156k|            };
 3450|       |
 3451|   156k|            if constexpr (emplace_backable<V>) {
 3452|   156k|               auto& element = value.emplace_back();
 3453|   156k|               parse_element(element);
 3454|       |            }
 3455|       |            else if constexpr (emplaceable<V>) {
 3456|       |               value_type element{};
 3457|       |               parse_element(element);
 3458|       |               if (!bool(ctx.error)) {
 3459|       |                  adapter.append(value, std::move(element));
 3460|       |               }
 3461|       |            }
 3462|       |            else if constexpr (!resizable<V>) {
 3463|       |               parse_element(value[adapter.index]);
 3464|       |               adapter.commit_fixed_slot();
 3465|       |            }
 3466|       |            else {
 3467|       |               ctx.error = error_code::syntax_error;
 3468|       |               return;
 3469|       |            }
 3470|       |
 3471|   156k|            first_item = false;
 3472|       |
 3473|   156k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 789, False: 155k]
  ------------------
 3474|    789|               return;
 3475|       |
 3476|       |            // Note: after parsing nested block content, iterator may already be
 3477|       |            // at the start of the next line. The outer loop will handle it.
 3478|   156k|         }
 3479|  89.8k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3386|   156k|            auto parse_element = [&](auto& element) {
 3387|   156k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 154k, False: 1.71k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   156k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 154k, False: 1.71k]
  |  Branch (3390:33): [True: 111k, False: 43.0k]
  ------------------
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   111k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 111k]
  ------------------
 3396|      0|                     return;
 3397|   111k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   111k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   111k|                  ctx.sequence_item_value_context = true;
 3400|   111k|                  ctx.sequence_dash_indent = dash_col;
 3401|   111k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   111k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   111k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   111k|                  ctx.pop_indent();
 3405|   111k|               }
 3406|  44.7k|               else {
 3407|       |                  // Value on next line - nested block
 3408|  44.7k|                  skip_ws_and_comment(it, end);
 3409|  44.7k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|  44.7k|                  auto nested_start = it;
 3413|  44.7k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|  44.7k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 3, False: 44.7k]
  ------------------
 3415|      3|                     return;
 3416|  44.7k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|  44.7k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 1.69k, False: 43.0k]
  ------------------
 3422|  44.7k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 32.4k, False: 12.3k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  32.4k|                     const int32_t element_indent =
 3428|  32.4k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 32.4k]
  ------------------
 3429|  32.4k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 32.4k]
  ------------------
 3430|      0|                        return;
 3431|  32.4k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  32.4k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  32.4k|                     ctx.sequence_item_value_context = true;
 3434|  32.4k|                     ctx.sequence_dash_indent = dash_col;
 3435|  32.4k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  32.4k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  32.4k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  32.4k|                     ctx.pop_indent();
 3439|  32.4k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|  44.7k|               }
 3442|       |
 3443|   156k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 1.64k, False: 154k]
  |  Branch (3443:47): [True: 1.53k, False: 113]
  ------------------
 3444|  1.53k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 1.17k, False: 366]
  ------------------
 3445|  1.53k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  1.53k|                                                                      pending_item_anchor_indent};
 3447|  1.53k|                  has_pending_item_anchor = false;
 3448|  1.53k|               }
 3449|   156k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5503|   182k|   {
 5504|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5505|       |         // In flow context, only treat plain content as an implicit "key: value"
 5506|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5507|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5508|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5509|       |            // once per entry per nesting level over the whole remaining flow collection.
 5510|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5511|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5512|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5513|       |            // flow-context plain scalar, so every one of them is an indicator.
 5514|       |            bool at_node_start = true;
 5515|       |            int depth = 0;
 5516|       |            while (pos != stop) {
 5517|       |               const char c = *pos;
 5518|       |               if (c == ' ' || c == '\t') {
 5519|       |                  ++pos;
 5520|       |                  continue;
 5521|       |               }
 5522|       |               const bool node_start = std::exchange(at_node_start, false);
 5523|       |
 5524|       |               if ((c == '"' || c == '\'') && node_start) {
 5525|       |                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5526|       |                  continue;
 5527|       |               }
 5528|       |               if (c == '[' || c == '{') {
 5529|       |                  ++depth;
 5530|       |                  at_node_start = true;
 5531|       |                  ++pos;
 5532|       |                  continue;
 5533|       |               }
 5534|       |               if (c == ']' || c == '}') {
 5535|       |                  if (depth == 0) return false;
 5536|       |                  --depth;
 5537|       |                  ++pos;
 5538|       |                  continue;
 5539|       |               }
 5540|       |               if (c == ',' && depth == 0) return false;
 5541|       |               if (c == ':' && depth == 0) {
 5542|       |                  auto next = pos + 1;
 5543|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5544|       |               }
 5545|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5546|       |               if (c == ',' || c == ':') {
 5547|       |                  at_node_start = true;
 5548|       |                  ++pos;
 5549|       |                  continue;
 5550|       |               }
 5551|       |               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5552|       |                  at_node_start = true;
 5553|       |                  continue;
 5554|       |               }
 5555|       |               ++pos;
 5556|       |            }
 5557|       |            return false;
 5558|       |         };
 5559|       |
 5560|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5561|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5562|       |               return;
 5563|       |            }
 5564|       |            if (bool(ctx.error)) {
 5565|       |               return;
 5566|       |            }
 5567|       |         }
 5568|       |
 5569|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5570|       |         return;
 5571|       |      }
 5572|       |
 5573|   182k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5573:11): [True: 106k, False: 75.2k]
  ------------------
 5574|   106k|         return;
 5575|   106k|      }
 5576|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5577|  75.2k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5577:11): [True: 6.51k, False: 68.7k]
  ------------------
 5578|  6.51k|         return;
 5579|  6.51k|      }
 5580|  68.7k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5581|  68.7k|   }
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISM_EEDaSZ_:
 5938|  28.2k|            auto is_word_boundary = [&](const auto ptr) {
 5939|  28.2k|               if (ptr == end) {
  ------------------
  |  Branch (5939:20): [True: 3.33k, False: 24.9k]
  ------------------
 5940|  3.33k|                  return true;
 5941|  3.33k|               }
 5942|  24.9k|               if (*ptr == ':') {
  ------------------
  |  Branch (5942:20): [True: 8.83k, False: 16.0k]
  ------------------
 5943|  8.83k|                  auto next = ptr + 1;
 5944|  8.83k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5944:26): [True: 3.29k, False: 5.54k]
  |  Branch (5944:43): [True: 1.09k, False: 4.45k]
  |  Branch (5944:59): [True: 1.25k, False: 3.19k]
  |  Branch (5944:76): [True: 953, False: 2.24k]
  |  Branch (5944:93): [True: 1.42k, False: 815]
  ------------------
 5945|  8.83k|               }
 5946|  16.0k|               return is_plain_scalar_boundary(*ptr);
 5947|  24.9k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5864|  16.0k|            auto is_plain_scalar_boundary = [](const char ch) {
 5865|  16.0k|               switch (ch) {
 5866|    467|               case ' ':
  ------------------
  |  Branch (5866:16): [True: 467, False: 15.6k]
  ------------------
 5867|    861|               case '\t':
  ------------------
  |  Branch (5867:16): [True: 394, False: 15.6k]
  ------------------
 5868|  6.03k|               case '\n':
  ------------------
  |  Branch (5868:16): [True: 5.17k, False: 10.9k]
  ------------------
 5869|  13.1k|               case '\r':
  ------------------
  |  Branch (5869:16): [True: 7.08k, False: 8.98k]
  ------------------
 5870|  13.4k|               case ',':
  ------------------
  |  Branch (5870:16): [True: 334, False: 15.7k]
  ------------------
 5871|  13.7k|               case ']':
  ------------------
  |  Branch (5871:16): [True: 304, False: 15.7k]
  ------------------
 5872|  14.0k|               case '}':
  ------------------
  |  Branch (5872:16): [True: 308, False: 15.7k]
  ------------------
 5873|  14.0k|                  return true;
 5874|  2.01k|               default:
  ------------------
  |  Branch (5874:16): [True: 2.01k, False: 14.0k]
  ------------------
 5875|  2.01k|                  return false;
 5876|  16.0k|               }
 5877|  16.0k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRSH_TkNS_10is_contextERNS_4yaml12yaml_contextESM_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISM_EEDaSZ_:
 5879|  25.4k|            auto has_indented_block_continuation = [&](auto word_end) {
 5880|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5881|       |                  return false;
 5882|       |               }
 5883|  25.4k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5883:20): [True: 4.00k, False: 21.4k]
  ------------------
 5884|  4.00k|                  return false;
 5885|  4.00k|               }
 5886|  21.4k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5886:20): [True: 2.43k, False: 18.9k]
  |  Branch (5886:40): [True: 13.8k, False: 5.15k]
  |  Branch (5886:61): [True: 6.81k, False: 7.01k]
  ------------------
 5887|  9.24k|                  return false;
 5888|  9.24k|               }
 5889|       |
 5890|  12.1k|               auto look = word_end;
 5891|  12.1k|               yaml::skip_newline(look, end);
 5892|  61.7k|               while (look != end) {
  ------------------
  |  Branch (5892:23): [True: 58.6k, False: 3.11k]
  ------------------
 5893|  58.6k|                  int32_t line_indent = 0;
 5894|  79.0k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5894:26): [True: 78.9k, False: 139]
  |  Branch (5894:41): [True: 20.4k, False: 58.4k]
  ------------------
 5895|  20.4k|                     ++line_indent;
 5896|  20.4k|                     ++look;
 5897|  20.4k|                  }
 5898|  58.6k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5898:23): [True: 58.4k, False: 139]
  |  Branch (5898:38): [True: 754, False: 57.7k]
  ------------------
 5899|    754|                     return false;
 5900|    754|                  }
 5901|  57.8k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5901:23): [True: 139, False: 57.7k]
  |  Branch (5901:38): [True: 41.6k, False: 16.0k]
  |  Branch (5901:55): [True: 4.38k, False: 11.6k]
  ------------------
 5902|  46.1k|                     if (look != end) {
  ------------------
  |  Branch (5902:26): [True: 46.0k, False: 139]
  ------------------
 5903|  46.0k|                        yaml::skip_newline(look, end);
 5904|  46.0k|                        continue;
 5905|  46.0k|                     }
 5906|    139|                     return false;
 5907|  46.1k|                  }
 5908|  11.6k|                  if (*look == '#') {
  ------------------
  |  Branch (5908:23): [True: 3.85k, False: 7.83k]
  ------------------
 5909|  3.85k|                     yaml::skip_comment(look, end);
 5910|  3.85k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5910:26): [True: 3.53k, False: 325]
  |  Branch (5910:42): [True: 1.71k, False: 1.81k]
  |  Branch (5910:59): [True: 1.80k, False: 10]
  ------------------
 5911|  3.52k|                        yaml::skip_newline(look, end);
 5912|  3.52k|                        continue;
 5913|  3.52k|                     }
 5914|    335|                     return false;
 5915|  3.85k|                  }
 5916|       |
 5917|       |                  // If the next non-empty line is an implicit mapping entry,
 5918|       |                  // don't treat it as scalar continuation for auto-deduced
 5919|       |                  // booleans/nulls.
 5920|  7.83k|                  {
 5921|  7.83k|                     auto scan = look;
 5922|  82.1k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5922:29): [True: 81.8k, False: 298]
  |  Branch (5922:44): [True: 78.9k, False: 2.90k]
  |  Branch (5922:61): [True: 78.3k, False: 673]
  ------------------
 5923|  78.3k|                        if (*scan == ':') {
  ------------------
  |  Branch (5923:29): [True: 6.61k, False: 71.6k]
  ------------------
 5924|  6.61k|                           auto after_colon = scan + 1;
 5925|  6.61k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5925:32): [True: 151, False: 6.46k]
  |  Branch (5925:54): [True: 2.27k, False: 4.19k]
  |  Branch (5925:77): [True: 628, False: 3.56k]
  ------------------
 5926|  3.95k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5926:32): [True: 504, False: 3.06k]
  |  Branch (5926:56): [True: 395, False: 2.66k]
  ------------------
 5927|  3.95k|                              return false;
 5928|  3.95k|                           }
 5929|  6.61k|                        }
 5930|  74.3k|                        ++scan;
 5931|  74.3k|                     }
 5932|  7.83k|                  }
 5933|       |
 5934|  3.87k|                  return line_indent > ctx.current_indent();
 5935|  7.83k|               }
 5936|  3.11k|               return false;
 5937|  12.1k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5457|   217k|   {
 5458|   217k|      using counts = yaml_variant_type_count<Variant>;
 5459|       |      if constexpr (counts::n_object == 0) {
 5460|       |         return false;
 5461|       |      }
 5462|   217k|      else {
 5463|       |         // Quick check: if no viable mapping separator in the current span,
 5464|       |         // avoid expensive speculative parse.
 5465|   217k|         const bool could_be_mapping = [&] {
 5466|   217k|            if constexpr (yaml::check_flow_context(Opts)) {
 5467|   217k|               return line_could_be_flow_mapping(it, end);
 5468|   217k|            }
 5469|   217k|            else {
 5470|   217k|               return yaml::line_could_be_block_mapping(it, end);
 5471|   217k|            }
 5472|   217k|         }();
 5473|   217k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5473:14): [True: 85.1k, False: 132k]
  ------------------
 5474|  85.1k|            return false;
 5475|  85.1k|         }
 5476|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5477|   132k|         auto temp_ctx = ctx.make_speculative();
 5478|   132k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5479|   132k|                                                                                               end);
 5480|   132k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5481|   132k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5482|   132k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5482:14): [True: 116k, False: 15.3k]
  ------------------
 5483|   116k|            ctx.anchors = std::move(temp_ctx.anchors);
 5484|   116k|            return true;
 5485|   116k|         }
 5486|       |         // The line matched "key: value" pattern but parsing failed.
 5487|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5488|       |         // so propagate the error rather than silently falling back to string.
 5489|  15.3k|         ctx.error = temp_ctx.error;
 5490|  15.3k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5491|  15.3k|         return false;
 5492|   132k|      }
 5493|   217k|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5465|   217k|         const bool could_be_mapping = [&] {
 5466|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5467|       |               return line_could_be_flow_mapping(it, end);
 5468|       |            }
 5469|   217k|            else {
 5470|   217k|               return yaml::line_could_be_block_mapping(it, end);
 5471|   217k|            }
 5472|   217k|         }();
_ZZN3glz5parseILj450EE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_ENKUlT_E_clISD_EEDaSM_:
  145|    435|               auto is_document_start = [&](auto pos) {
  146|    435|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (146:23): [True: 317, False: 118]
  |  Branch (146:41): [True: 150, False: 167]
  |  Branch (146:58): [True: 133, False: 17]
  |  Branch (146:75): [True: 124, False: 9]
  ------------------
  147|    124|                     auto after = pos + 3;
  148|    124|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (148:29): [True: 12, False: 112]
  |  Branch (148:45): [True: 38, False: 74]
  |  Branch (148:62): [True: 51, False: 23]
  |  Branch (148:80): [True: 13, False: 10]
  |  Branch (148:98): [True: 6, False: 4]
  ------------------
  149|      4|                            *after == '#';
  ------------------
  |  Branch (149:29): [True: 1, False: 3]
  ------------------
  150|    124|                  }
  151|    311|                  return false;
  152|    435|               };
_ZN3glz9read_yamlITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERKNSt3__16vectorIcNS8_9allocatorIcEEEEEENS_9error_ctxEOT0_OT1_:
 6696|  78.6k|   {
 6697|  78.6k|      if (buffer.size() == 0) {
  ------------------
  |  Branch (6697:11): [True: 0, False: 78.6k]
  ------------------
 6698|      0|         using V = std::remove_cvref_t<T>;
 6699|      0|         if constexpr (requires { value = nullptr; }) {
 6700|      0|            value = nullptr;
 6701|      0|            return {};
 6702|       |         }
 6703|       |         else if constexpr (nullable_like<V>) {
 6704|       |            value = {};
 6705|       |            return {};
 6706|       |         }
 6707|      0|      }
 6708|      0|      yaml::yaml_context ctx{};
 6709|  78.6k|      return read<set_yaml<Opts>()>(std::forward<T>(value), std::forward<Buffer>(buffer), ctx);
 6710|  78.6k|   }
_ZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   69|   117k|      {
   70|   117k|         if constexpr (requires { ctx.stream_begin; }) {
   71|   117k|            if (!ctx.stream_begin && it != end) {
  ------------------
  |  Branch (71:17): [True: 117k, False: 0]
  |  Branch (71:38): [True: 117k, False: 0]
  ------------------
   72|   117k|               ctx.stream_begin = &*it;
   73|       |               // Anchors and the line memo hold pointers into whatever buffer filled them, so a
   74|       |               // reused context must not carry a previous read's into this one.
   75|   117k|               if constexpr (requires { ctx.reset_read_state(); }) {
   76|   117k|                  ctx.reset_read_state();
   77|   117k|               }
   78|       |               // Seed the alias replay budget from the document this read was handed. Done here
   79|       |               // rather than in glz::read so every YAML entry point is covered, and only on the
   80|       |               // outermost parse so a nested document does not hand itself a fresh budget.
   81|   117k|               if constexpr (requires { ctx.alias_expansion_budget; } && requires { size_t(end - it); }) {
   82|   117k|                  const size_t scaled = size_t(end - it) * yaml::max_alias_expansion_factor;
   83|   117k|                  ctx.alias_expansion_budget =
   84|   117k|                     scaled > yaml::min_alias_expansion_bytes ? scaled : yaml::min_alias_expansion_bytes;
  ------------------
  |  Branch (84:22): [True: 883, False: 117k]
  ------------------
   85|   117k|               }
   86|       |               // Same treatment for the text complex keys materialize, seeded on its own budget so
   87|       |               // exhausting one reports which of the two ran away.
   88|   117k|               if constexpr (requires { ctx.key_expansion_budget; } && requires { size_t(end - it); }) {
   89|   117k|                  const size_t scaled = size_t(end - it) * yaml::max_key_expansion_factor;
   90|   117k|                  ctx.key_expansion_budget =
   91|   117k|                     scaled > yaml::min_key_expansion_bytes ? scaled : yaml::min_key_expansion_bytes;
  ------------------
  |  Branch (91:22): [True: 883, False: 117k]
  ------------------
   92|   117k|               }
   93|   117k|            }
   94|   117k|         }
   95|       |         // Skip YAML directives and document start marker (---) if present
   96|   117k|         yaml::skip_document_start(it, end, ctx);
   97|   117k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (97:14): [True: 837, False: 117k]
  ------------------
   98|    837|            return;
   99|    837|         }
  100|       |
  101|   117k|         using V = std::remove_cvref_t<T>;
  102|   117k|         if (it == end) {
  ------------------
  |  Branch (102:14): [True: 60, False: 117k]
  ------------------
  103|       |            // An empty document is a valid YAML null document.
  104|     60|            if constexpr (requires { value = nullptr; }) {
  105|     60|               value = nullptr;
  106|     60|               return;
  107|       |            }
  108|       |            else if constexpr (nullable_like<V>) {
  109|       |               value = {};
  110|       |               return;
  111|       |            }
  112|       |            else {
  113|       |               ctx.error = error_code::unexpected_end;
  114|       |               return;
  115|       |            }
  116|     60|         }
  117|       |
  118|       |         // A bare document boundary marker at root denotes an empty document.
  119|       |         // Examples: "---\n---\n", "# comment\n...\n"
  120|   117k|         if (yaml::at_document_start(it, end) || yaml::at_document_end(it, end)) {
  ------------------
  |  Branch (120:14): [True: 77, False: 117k]
  |  Branch (120:50): [True: 26, False: 117k]
  ------------------
  121|     43|            if constexpr (requires { value = nullptr; }) {
  122|     43|               value = nullptr;
  123|     43|               return;
  124|       |            }
  125|       |            else if constexpr (nullable_like<V>) {
  126|       |               value = {};
  127|       |               return;
  128|       |            }
  129|       |            else {
  130|       |               ctx.error = error_code::unexpected_end;
  131|       |               return;
  132|       |            }
  133|     43|         }
  134|       |
  135|      0|         from<YAML, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  136|       |
  137|       |         // A directive line (%YAML/%TAG/...) is only valid in the document prefix.
  138|       |         // If parsing stopped before the end and we encounter a directive in the
  139|       |         // remaining tail, treat it as malformed stream structure. This is a document-level
  140|       |         // concern, so only enforce it at the document root: a nested call (e.g. a tagged
  141|       |         // variant handing a custom alternative its body) is mid-document and its tail
  142|       |         // belongs to an enclosing node, not this value.
  143|   117k|         if constexpr (!check_partial_read(Opts)) {
  144|   117k|            if (!bool(ctx.error) && ctx.current_indent() < 0) {
  ------------------
  |  Branch (144:17): [True: 12.3k, False: 104k]
  |  Branch (144:37): [True: 12.3k, False: 0]
  ------------------
  145|  12.3k|               auto is_document_start = [&](auto pos) {
  146|  12.3k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  147|  12.3k|                     auto after = pos + 3;
  148|  12.3k|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  149|  12.3k|                            *after == '#';
  150|  12.3k|                  }
  151|  12.3k|                  return false;
  152|  12.3k|               };
  153|       |
  154|       |               // The scan below reads the tail a line at a time, which only means anything if the
  155|       |               // tail starts at one. A root node can stop mid-line -- a plain scalar ends at a
  156|       |               // ':' it is not allowed to take as a separator, a flow collection ends at its
  157|       |               // bracket -- and what sits after it there is leftover content on that line, not
  158|       |               // the opening of a new one. Only inline whitespace and a comment may follow. Let
  159|       |               // the line scan see anything else and it misreads it: a leftover ':' passes as an
  160|       |               // explicit-key continuation and the remainder of the document falls on the floor.
  161|  12.3k|               if constexpr (requires { ctx.line_prefix_before(it); }) {
  162|  12.3k|                  if (it != end && ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (162:23): [True: 4.97k, False: 7.41k]
  |  Branch (162:23): [True: 3.27k, False: 9.11k]
  |  Branch (162:36): [True: 3.27k, False: 1.69k]
  ------------------
  163|  3.27k|                     auto rest = it;
  164|  6.06k|                     while (rest != end && (*rest == ' ' || *rest == '\t')) ++rest;
  ------------------
  |  Branch (164:29): [True: 6.01k, False: 52]
  |  Branch (164:45): [True: 1.68k, False: 4.32k]
  |  Branch (164:61): [True: 1.10k, False: 3.22k]
  ------------------
  165|  3.27k|                     if (rest != end && *rest != '\n' && *rest != '\r' && *rest != '#') {
  ------------------
  |  Branch (165:26): [True: 3.22k, False: 52]
  |  Branch (165:41): [True: 2.67k, False: 550]
  |  Branch (165:58): [True: 2.05k, False: 616]
  |  Branch (165:75): [True: 1.79k, False: 264]
  ------------------
  166|  1.79k|                        ctx.error = error_code::syntax_error;
  167|  1.79k|                        return;
  168|  1.79k|                     }
  169|  3.27k|                  }
  170|  12.3k|               }
  171|       |
  172|  10.5k|               auto tail_scan = it;
  173|  12.3k|               bool seen_document_end_marker = false;
  174|   107k|               while (tail_scan != end) {
  ------------------
  |  Branch (174:23): [True: 97.2k, False: 9.99k]
  ------------------
  175|  97.2k|                  auto line = tail_scan;
  176|   119k|                  while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (176:26): [True: 119k, False: 93]
  |  Branch (176:42): [True: 21.3k, False: 98.2k]
  |  Branch (176:58): [True: 1.14k, False: 97.1k]
  ------------------
  177|  97.2k|                  if (line != tail_scan && line != end && *line != '\n' && *line != '\r' && *line != '#') {
  ------------------
  |  Branch (177:23): [True: 3.18k, False: 94.0k]
  |  Branch (177:44): [True: 3.09k, False: 93]
  |  Branch (177:59): [True: 2.11k, False: 977]
  |  Branch (177:76): [True: 1.49k, False: 621]
  |  Branch (177:93): [True: 393, False: 1.10k]
  ------------------
  178|       |                     // Indented tail usually belongs to continuation content.
  179|       |                     // But a plain "key: value" pattern here indicates malformed
  180|       |                     // trailing mapping content after a completed root node.
  181|    393|                     const char first = *line;
  182|    393|                     const bool explicit_or_structural_start =
  183|    393|                        (first == ':' || first == '?' || first == '!' || first == '&' || first == '*' || first == '[' ||
  ------------------
  |  Branch (183:26): [True: 25, False: 368]
  |  Branch (183:42): [True: 7, False: 361]
  |  Branch (183:58): [True: 9, False: 352]
  |  Branch (183:74): [True: 9, False: 343]
  |  Branch (183:90): [True: 16, False: 327]
  |  Branch (183:106): [True: 10, False: 317]
  ------------------
  184|    317|                         first == '{' || first == '"' || first == '\'' || first == '-');
  ------------------
  |  Branch (184:26): [True: 4, False: 313]
  |  Branch (184:42): [True: 7, False: 306]
  |  Branch (184:58): [True: 4, False: 302]
  |  Branch (184:75): [True: 23, False: 279]
  ------------------
  185|    393|                     if (!explicit_or_structural_start) {
  ------------------
  |  Branch (185:26): [True: 279, False: 114]
  ------------------
  186|    279|                        auto scan = line;
  187|  2.72k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (187:32): [True: 2.51k, False: 210]
  |  Branch (187:47): [True: 2.49k, False: 21]
  |  Branch (187:64): [True: 2.48k, False: 6]
  ------------------
  188|  2.48k|                           if (*scan == ':') {
  ------------------
  |  Branch (188:32): [True: 475, False: 2.01k]
  ------------------
  189|    475|                              auto after = scan + 1;
  190|    475|                              if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (190:35): [True: 21, False: 454]
  |  Branch (190:51): [True: 6, False: 448]
  |  Branch (190:68): [True: 6, False: 442]
  |  Branch (190:86): [True: 3, False: 439]
  |  Branch (190:104): [True: 6, False: 433]
  ------------------
  191|     42|                                 ctx.error = error_code::syntax_error;
  192|     42|                                 return;
  193|     42|                              }
  194|    475|                           }
  195|  2.44k|                           ++scan;
  196|  2.44k|                        }
  197|    279|                     }
  198|    351|                     return;
  199|    393|                  }
  200|  96.8k|                  if (line == end) {
  ------------------
  |  Branch (200:23): [True: 93, False: 96.7k]
  ------------------
  201|     93|                     return;
  202|     93|                  }
  203|  96.7k|                  if (*line == ':' || *line == '?') {
  ------------------
  |  Branch (203:23): [True: 82, False: 96.6k]
  |  Branch (203:39): [True: 40, False: 96.6k]
  ------------------
  204|    122|                     return; // Explicit key/value continuation.
  205|    122|                  }
  206|  96.6k|                  if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (206:23): [True: 38.6k, False: 57.9k]
  |  Branch (206:40): [True: 16.5k, False: 41.4k]
  ------------------
  207|  55.2k|                     tail_scan = line;
  208|  55.2k|                     yaml::skip_newline(tail_scan, end);
  209|  55.2k|                     continue;
  210|  55.2k|                  }
  211|  41.4k|                  if (*line == '#') {
  ------------------
  |  Branch (211:23): [True: 30.6k, False: 10.7k]
  ------------------
  212|   245k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (212:29): [True: 245k, False: 422]
  |  Branch (212:49): [True: 238k, False: 6.56k]
  |  Branch (212:71): [True: 215k, False: 23.6k]
  ------------------
  213|  30.6k|                     yaml::skip_newline(tail_scan, end);
  214|  30.6k|                     continue;
  215|  30.6k|                  }
  216|  10.7k|                  if (yaml::at_document_end(line, end)) {
  ------------------
  |  Branch (216:23): [True: 8.96k, False: 1.78k]
  ------------------
  217|  8.96k|                     seen_document_end_marker = true;
  218|  68.4k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (218:29): [True: 68.2k, False: 127]
  |  Branch (218:49): [True: 61.9k, False: 6.33k]
  |  Branch (218:71): [True: 59.4k, False: 2.50k]
  ------------------
  219|  8.96k|                     yaml::skip_newline(tail_scan, end);
  220|  8.96k|                     continue;
  221|  8.96k|                  }
  222|  1.78k|                  if (is_document_start(line)) {
  ------------------
  |  Branch (222:23): [True: 323, False: 1.46k]
  ------------------
  223|       |                     // Additional documents are accepted, but document-start lines
  224|       |                     // that use non-standard tag handles (e.g. !prefix!Type) are
  225|       |                     // malformed in this single-document reader unless re-declared
  226|       |                     // for that document. Reject this shape in the stream tail.
  227|    323|                     auto header = line + 3;
  228|  2.19k|                     while (header != end && (*header == ' ' || *header == '\t')) ++header;
  ------------------
  |  Branch (228:29): [True: 2.16k, False: 29]
  |  Branch (228:47): [True: 993, False: 1.17k]
  |  Branch (228:65): [True: 880, False: 294]
  ------------------
  229|    323|                     if (header != end && *header == '!') {
  ------------------
  |  Branch (229:26): [True: 294, False: 29]
  |  Branch (229:43): [True: 131, False: 163]
  ------------------
  230|    131|                        auto tag_end = header + 1;
  231|  2.13M|                        while (tag_end != end && *tag_end != ' ' && *tag_end != '\t' && *tag_end != '\n' &&
  ------------------
  |  Branch (231:32): [True: 2.13M, False: 50]
  |  Branch (231:50): [True: 2.13M, False: 55]
  |  Branch (231:69): [True: 2.13M, False: 7]
  |  Branch (231:89): [True: 2.13M, False: 3]
  ------------------
  232|  2.13M|                               *tag_end != '\r' && *tag_end != '#') {
  ------------------
  |  Branch (232:32): [True: 2.13M, False: 6]
  |  Branch (232:52): [True: 2.13M, False: 10]
  ------------------
  233|  2.13M|                           ++tag_end;
  234|  2.13M|                        }
  235|    131|                        std::string_view tag_token(header, static_cast<size_t>(tag_end - header));
  236|    131|                        const auto second_bang = tag_token.find('!', 1);
  237|    131|                        if (second_bang != std::string_view::npos) {
  ------------------
  |  Branch (237:29): [True: 89, False: 42]
  ------------------
  238|     89|                           std::string_view handle = tag_token.substr(0, second_bang + 1);
  239|     89|                           if (handle != "!" && handle != "!!") {
  ------------------
  |  Branch (239:32): [True: 89, False: 0]
  |  Branch (239:49): [True: 82, False: 7]
  ------------------
  240|     82|                              ctx.error = error_code::syntax_error;
  241|     82|                              return;
  242|     82|                           }
  243|     89|                        }
  244|    131|                     }
  245|    241|                     return; // Additional documents are allowed in the stream tail.
  246|    323|                  }
  247|  1.46k|                  if (line != end && *line == '%') {
  ------------------
  |  Branch (247:23): [True: 1.46k, False: 0]
  |  Branch (247:38): [True: 23, False: 1.44k]
  ------------------
  248|       |                     // YAML directives are only valid in document prefixes. A directive
  249|       |                     // encountered mid-document (without a prior ...) is malformed.
  250|     23|                     if (!seen_document_end_marker) {
  ------------------
  |  Branch (250:26): [True: 17, False: 6]
  ------------------
  251|     17|                        ctx.error = error_code::syntax_error;
  252|     17|                        return;
  253|     17|                     }
  254|      6|                     return;
  255|     23|                  }
  256|  1.44k|                  if (seen_document_end_marker) {
  ------------------
  |  Branch (256:23): [True: 196, False: 1.24k]
  ------------------
  257|    196|                     return; // Implicit next document after explicit document end marker.
  258|    196|                  }
  259|  1.24k|                  ctx.error = error_code::syntax_error;
  260|  1.24k|                  return;
  261|  1.44k|               }
  262|  12.3k|            }
  263|   117k|         }
  264|   117k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  1.75M|      {
  275|  1.75M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  1.75M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  1.75M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  1.75M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_:
 5725|  2.26M|      {
 5726|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5727|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5728|  2.26M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5729|  2.26M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5730|  2.26M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5731|  2.26M|                       "the internally tagged shape, so it is rejected here instead.");
 5732|  2.26M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5732:14): [True: 0, False: 2.26M]
  ------------------
 5733|      0|            return;
 5734|       |
 5735|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5736|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5737|       |         // indent stack does not cover.
 5738|  2.26M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5739|  2.26M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5739:14): [True: 53, False: 2.26M]
  ------------------
 5740|     53|            return;
 5741|       |
 5742|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5743|       |         // For nested values, only skip inline whitespace to preserve block structure
 5744|  2.26M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5744:14): [True: 354k, False: 1.90M]
  ------------------
 5745|   354k|            yaml::skip_ws_newlines_comments(it, end);
 5746|   354k|         }
 5747|  1.90M|         else {
 5748|  1.90M|            yaml::skip_inline_ws(it, end);
 5749|  1.90M|         }
 5750|       |
 5751|  2.26M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5751:14): [True: 128, False: 2.26M]
  ------------------
 5752|    128|            ctx.error = error_code::unexpected_end;
 5753|    128|            return;
 5754|    128|         }
 5755|       |
 5756|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5757|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5758|       |         // same variant definitions round-trip across both formats.
 5759|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5760|       |            using V = std::remove_cvref_t<T>;
 5761|       |            const bool value_is_mapping =
 5762|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5763|       |            if (value_is_mapping) {
 5764|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5765|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5766|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5767|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5768|       |               auto tag_ctx = ctx.make_speculative();
 5769|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5770|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5771|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5772|       |               if (index < ids_v<V>.size()) {
 5773|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5774|       |                  emplace_runtime_variant(value, index);
 5775|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5776|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5777|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5778|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5779|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5780|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5781|       |                     return;
 5782|       |                  }
 5783|       |                  std::visit(
 5784|       |                     [&](auto&& alt) {
 5785|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5786|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5787|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5788|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5789|       |                        }
 5790|       |                        else if constexpr (custom_read<Alt>) {
 5791|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5792|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5793|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5794|       |                           // entry, then hand the remaining mapping to the custom handler.
 5795|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5796|       |                              ctx.error = error_code::feature_not_supported;
 5797|       |                              ctx.custom_error_message =
 5798|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5799|       |                           }
 5800|       |                           else {
 5801|       |                              ctx.scratch.clear();
 5802|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5803|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5804|       |                                    ctx.error = error_code::feature_not_supported;
 5805|       |                                    ctx.custom_error_message =
 5806|       |                                       "the tag must be the first key for a custom variant alternative";
 5807|       |                                 }
 5808|       |                                 else {
 5809|       |                                    yaml::skip_inline_ws(it, end);
 5810|       |                                    if (it == end || *it != ':') {
 5811|       |                                       ctx.error = error_code::syntax_error;
 5812|       |                                    }
 5813|       |                                    else {
 5814|       |                                       ++it;
 5815|       |                                       yaml::skip_inline_ws(it, end);
 5816|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5817|       |                                       if (!bool(ctx.error)) {
 5818|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5819|       |                                          // was the whole mapping: leave the alternative default.
 5820|       |                                          auto probe = it;
 5821|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5822|       |                                          if (probe == end) {
 5823|       |                                             it = probe;
 5824|       |                                          }
 5825|       |                                          else {
 5826|       |                                             // Publish the mapping's column so the custom handler's block
 5827|       |                                             // mapping (which would otherwise discover its own indent) reads
 5828|       |                                             // the remaining entries at the variant's indent and dedents
 5829|       |                                             // correctly in every context (root, sequence, nested).
 5830|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5831|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5832|       |                                             ctx.forced_block_mapping_indent = -1;
 5833|       |                                          }
 5834|       |                                       }
 5835|       |                                    }
 5836|       |                                 }
 5837|       |                              }
 5838|       |                           }
 5839|       |                        }
 5840|       |                        else {
 5841|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5842|       |                           // the value, but the mapping must still be consumed.
 5843|       |                           walk_tagged_mapping<Opts>(
 5844|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5845|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5846|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5847|       |                              });
 5848|       |                        }
 5849|       |                     },
 5850|       |                     value);
 5851|       |                  ctx.pop_indent();
 5852|       |                  return;
 5853|       |               }
 5854|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5855|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5856|       |               // otherwise the deduction path reports no_matching_variant_type.
 5857|       |            }
 5858|       |         }
 5859|       |
 5860|  2.26M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5861|  2.26M|            using V = std::remove_cvref_t<T>;
 5862|  2.26M|            using counts = yaml_variant_type_count<V>;
 5863|  2.26M|            const char c = *it;
 5864|  2.26M|            auto is_plain_scalar_boundary = [](const char ch) {
 5865|  2.26M|               switch (ch) {
 5866|  2.26M|               case ' ':
 5867|  2.26M|               case '\t':
 5868|  2.26M|               case '\n':
 5869|  2.26M|               case '\r':
 5870|  2.26M|               case ',':
 5871|  2.26M|               case ']':
 5872|  2.26M|               case '}':
 5873|  2.26M|                  return true;
 5874|  2.26M|               default:
 5875|  2.26M|                  return false;
 5876|  2.26M|               }
 5877|  2.26M|            };
 5878|       |
 5879|  2.26M|            auto has_indented_block_continuation = [&](auto word_end) {
 5880|  2.26M|               if constexpr (yaml::check_flow_context(Opts)) {
 5881|  2.26M|                  return false;
 5882|  2.26M|               }
 5883|  2.26M|               if (ctx.current_indent() < 0) {
 5884|  2.26M|                  return false;
 5885|  2.26M|               }
 5886|  2.26M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5887|  2.26M|                  return false;
 5888|  2.26M|               }
 5889|       |
 5890|  2.26M|               auto look = word_end;
 5891|  2.26M|               yaml::skip_newline(look, end);
 5892|  2.26M|               while (look != end) {
 5893|  2.26M|                  int32_t line_indent = 0;
 5894|  2.26M|                  while (look != end && *look == ' ') {
 5895|  2.26M|                     ++line_indent;
 5896|  2.26M|                     ++look;
 5897|  2.26M|                  }
 5898|  2.26M|                  if (look != end && *look == '\t') {
 5899|  2.26M|                     return false;
 5900|  2.26M|                  }
 5901|  2.26M|                  if (look == end || *look == '\n' || *look == '\r') {
 5902|  2.26M|                     if (look != end) {
 5903|  2.26M|                        yaml::skip_newline(look, end);
 5904|  2.26M|                        continue;
 5905|  2.26M|                     }
 5906|  2.26M|                     return false;
 5907|  2.26M|                  }
 5908|  2.26M|                  if (*look == '#') {
 5909|  2.26M|                     yaml::skip_comment(look, end);
 5910|  2.26M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5911|  2.26M|                        yaml::skip_newline(look, end);
 5912|  2.26M|                        continue;
 5913|  2.26M|                     }
 5914|  2.26M|                     return false;
 5915|  2.26M|                  }
 5916|       |
 5917|       |                  // If the next non-empty line is an implicit mapping entry,
 5918|       |                  // don't treat it as scalar continuation for auto-deduced
 5919|       |                  // booleans/nulls.
 5920|  2.26M|                  {
 5921|  2.26M|                     auto scan = look;
 5922|  2.26M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5923|  2.26M|                        if (*scan == ':') {
 5924|  2.26M|                           auto after_colon = scan + 1;
 5925|  2.26M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5926|  2.26M|                               *after_colon == '\n' || *after_colon == '\r') {
 5927|  2.26M|                              return false;
 5928|  2.26M|                           }
 5929|  2.26M|                        }
 5930|  2.26M|                        ++scan;
 5931|  2.26M|                     }
 5932|  2.26M|                  }
 5933|       |
 5934|  2.26M|                  return line_indent > ctx.current_indent();
 5935|  2.26M|               }
 5936|  2.26M|               return false;
 5937|  2.26M|            };
 5938|  2.26M|            auto is_word_boundary = [&](const auto ptr) {
 5939|  2.26M|               if (ptr == end) {
 5940|  2.26M|                  return true;
 5941|  2.26M|               }
 5942|  2.26M|               if (*ptr == ':') {
 5943|  2.26M|                  auto next = ptr + 1;
 5944|  2.26M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5945|  2.26M|               }
 5946|  2.26M|               return is_plain_scalar_boundary(*ptr);
 5947|  2.26M|            };
 5948|       |
 5949|  2.26M|            switch (c) {
 5950|   379k|            case '&': {
  ------------------
  |  Branch (5950:13): [True: 379k, False: 1.88M]
  ------------------
 5951|       |               // Anchor before value: parse name, then re-dispatch
 5952|   379k|               ++it;
 5953|   379k|               auto aname = yaml::parse_anchor_name(it, end);
 5954|   379k|               if (aname.empty()) {
  ------------------
  |  Branch (5954:20): [True: 402, False: 379k]
  ------------------
 5955|    402|                  ctx.error = error_code::syntax_error;
 5956|    402|                  return;
 5957|    402|               }
 5958|   379k|               yaml::skip_inline_ws(it, end);
 5959|   379k|               bool anchor_on_same_line = true;
 5960|   379k|               bool value_is_indentless_sequence = false;
 5961|   379k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5961:20): [True: 4.04k, False: 375k]
  |  Branch (5961:33): [True: 21.8k, False: 353k]
  |  Branch (5961:48): [True: 40.8k, False: 312k]
  |  Branch (5961:63): [True: 20.8k, False: 291k]
  ------------------
 5962|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5963|       |                  // next line (indented past current context) or if this is an empty node.
 5964|  87.6k|                  bool value_on_next_line = false;
 5965|  87.6k|                  if (it != end) {
  ------------------
  |  Branch (5965:23): [True: 83.5k, False: 4.04k]
  ------------------
 5966|  83.5k|                     auto peek = it;
 5967|       |                     // Skip comment if present
 5968|  83.5k|                     if (*peek == '#') {
  ------------------
  |  Branch (5968:26): [True: 20.8k, False: 62.6k]
  ------------------
 5969|   288k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5969:32): [True: 287k, False: 1.87k]
  |  Branch (5969:47): [True: 280k, False: 6.50k]
  |  Branch (5969:64): [True: 267k, False: 12.5k]
  ------------------
 5970|  20.8k|                     }
 5971|       |                     // Skip newline
 5972|  83.5k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5972:26): [True: 81.7k, False: 1.87k]
  |  Branch (5972:42): [True: 28.3k, False: 53.3k]
  |  Branch (5972:59): [True: 53.3k, False: 0]
  ------------------
 5973|  81.7k|                        yaml::skip_newline(peek, end);
 5974|       |                        // Skip blank lines
 5975|   165k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5975:32): [True: 152k, False: 13.0k]
  |  Branch (5975:48): [True: 25.2k, False: 127k]
  |  Branch (5975:65): [True: 58.3k, False: 68.7k]
  ------------------
 5976|  83.6k|                           yaml::skip_newline(peek, end);
 5977|  83.6k|                        }
 5978|       |                        // Measure indent of next content line
 5979|  81.7k|                        int32_t next_indent = 0;
 5980|   238k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5980:32): [True: 223k, False: 14.2k]
  |  Branch (5980:47): [True: 156k, False: 67.4k]
  ------------------
 5981|   156k|                           ++next_indent;
 5982|   156k|                           ++peek;
 5983|   156k|                        }
 5984|  81.7k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5984:29): [True: 67.4k, False: 14.2k]
  |  Branch (5984:44): [True: 65.7k, False: 1.70k]
  |  Branch (5984:61): [True: 64.2k, False: 1.44k]
  ------------------
 5985|  64.2k|                           const bool indentless_sequence =
 5986|  64.2k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5986:31): [True: 58.0k, False: 6.20k]
  |  Branch (5986:69): [True: 23.3k, False: 34.7k]
  ------------------
 5987|  23.3k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5987:32): [True: 818, False: 22.5k]
  ------------------
 5988|  22.5k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5988:32): [True: 21.2k, False: 1.22k]
  ------------------
 5989|  22.0k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5989:32): [True: 7.67k, False: 14.4k]
  ------------------
 5990|  14.4k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5990:33): [True: 10.5k, False: 3.84k]
  |  Branch (5990:61): [True: 6.07k, False: 4.50k]
  ------------------
 5991|  64.2k|                           value_is_indentless_sequence = indentless_sequence;
 5992|  64.2k|                           const bool same_indent_property_node =
 5993|  64.2k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5993:31): [True: 19.7k, False: 44.5k]
  ------------------
 5994|  19.7k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5994:32): [True: 1.42k, False: 18.3k]
  |  Branch (5994:48): [True: 4.45k, False: 13.9k]
  |  Branch (5994:64): [True: 789, False: 13.1k]
  |  Branch (5994:80): [True: 1.00k, False: 12.1k]
  |  Branch (5994:96): [True: 832, False: 11.2k]
  ------------------
 5995|  11.2k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5995:32): [True: 1.34k, False: 9.94k]
  |  Branch (5995:48): [True: 771, False: 9.17k]
  |  Branch (5995:65): [True: 795, False: 8.38k]
  |  Branch (5995:81): [True: 168, False: 8.21k]
  ------------------
 5996|  64.2k|                           value_on_next_line =
 5997|  64.2k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5997:31): [True: 26.0k, False: 38.2k]
  |  Branch (5997:71): [True: 13.7k, False: 24.5k]
  |  Branch (5997:94): [True: 11.5k, False: 12.9k]
  ------------------
 5998|  64.2k|                        }
 5999|  81.7k|                     }
 6000|  83.5k|                  }
 6001|  87.6k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6001:23): [True: 36.3k, False: 51.3k]
  ------------------
 6002|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6003|  36.3k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6004|  36.3k|                     return;
 6005|  36.3k|                  }
 6006|       |                  // Value is on next line — advance past newline/blank lines to the content
 6007|  51.3k|                  if (*it == '#') {
  ------------------
  |  Branch (6007:23): [True: 13.6k, False: 37.6k]
  ------------------
 6008|   165k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6008:29): [True: 165k, False: 0]
  |  Branch (6008:42): [True: 160k, False: 5.03k]
  |  Branch (6008:57): [True: 151k, False: 8.64k]
  ------------------
 6009|  13.6k|                  }
 6010|  51.3k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6010:23): [True: 51.3k, False: 0]
  ------------------
 6011|  85.5k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6011:26): [True: 85.5k, False: 0]
  |  Branch (6011:40): [True: 23.7k, False: 61.7k]
  |  Branch (6011:55): [True: 10.4k, False: 51.3k]
  ------------------
 6012|  34.1k|                     yaml::skip_newline(it, end);
 6013|  34.1k|                  }
 6014|  51.3k|                  yaml::skip_inline_ws(it, end);
 6015|  51.3k|                  anchor_on_same_line = false;
 6016|  51.3k|               }
 6017|       |
 6018|   343k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6019|   343k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (6019:23): [True: 291k, False: 51.3k]
  |  Branch (6019:46): [True: 12.9k, False: 278k]
  ------------------
 6020|  12.9k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (6020:24): [True: 9, False: 12.9k]
  |  Branch (6020:43): [True: 41, False: 12.8k]
  ------------------
 6021|       |                     // "&anchor - item" is malformed in block context.
 6022|     50|                     ctx.error = error_code::syntax_error;
 6023|     50|                     return;
 6024|     50|                  }
 6025|   343k|               }
 6026|       |
 6027|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6028|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6029|   343k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6029:20): [True: 343k, False: 69]
  |  Branch (6029:33): [True: 2.28k, False: 340k]
  |  Branch (6029:47): [True: 359, False: 1.92k]
  ------------------
 6030|    359|                  ctx.error = error_code::syntax_error;
 6031|    359|                  return;
 6032|    359|               }
 6033|       |
 6034|   342k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6035|   342k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (6035:23): [True: 51.2k, False: 291k]
  |  Branch (6035:47): [True: 51.2k, False: 19]
  |  Branch (6035:60): [True: 7.09k, False: 44.1k]
  ------------------
 6036|  7.09k|                     auto probe = it + 1;
 6037|  7.09k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6038|  7.09k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (6038:26): [True: 46, False: 7.04k]
  ------------------
 6039|     46|                        ctx.error = error_code::syntax_error;
 6040|     46|                        return;
 6041|     46|                     }
 6042|  7.04k|                     yaml::skip_inline_ws(probe, end);
 6043|       |                     // Allow nested anchor usage only when it clearly starts a
 6044|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 6045|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 6046|  7.04k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (6046:26): [True: 247, False: 6.79k]
  ------------------
 6047|    247|                        ctx.error = error_code::syntax_error;
 6048|    247|                        return;
 6049|    247|                     }
 6050|  7.04k|                  }
 6051|   342k|               }
 6052|       |
 6053|   342k|               const char* anchor_start = &*it;
 6054|   342k|               const int32_t anchor_indent = ctx.current_indent();
 6055|       |
 6056|   342k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6057|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 6058|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 6059|       |                  // next line, the anchor applies to the entire next-line content.
 6060|   342k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6060:23): [True: 291k, False: 51.3k]
  |  Branch (6060:46): [True: 134k, False: 156k]
  ------------------
 6061|   134k|                     auto key_start = it;
 6062|   134k|                     if (*key_start == '!') {
  ------------------
  |  Branch (6062:26): [True: 2.72k, False: 132k]
  ------------------
 6063|  2.72k|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6064|  2.72k|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (6064:29): [True: 16, False: 2.70k]
  |  Branch (6064:67): [True: 18, False: 2.69k]
  ------------------
 6065|     34|                           ctx.error = error_code::syntax_error;
 6066|     34|                           return;
 6067|     34|                        }
 6068|  2.69k|                        yaml::skip_inline_ws(key_start, end);
 6069|  2.69k|                        if (key_start == end) {
  ------------------
  |  Branch (6069:29): [True: 5, False: 2.68k]
  ------------------
 6070|      5|                           ctx.error = error_code::unexpected_end;
 6071|      5|                           return;
 6072|      5|                        }
 6073|  2.68k|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (6073:29): [True: 3, False: 2.68k]
  |  Branch (6073:51): [True: 3, False: 2.68k]
  ------------------
 6074|      6|                           ctx.error = error_code::syntax_error;
 6075|      6|                           return;
 6076|      6|                        }
 6077|       |
 6078|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 6079|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 6080|       |                        // key-span registration below while the untagged spelling was rejected;
 6081|       |                        // an alias node carries no other properties either way.
 6082|  2.68k|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (6082:29): [True: 449, False: 2.23k]
  |  Branch (6082:50): [True: 10, False: 439]
  ------------------
 6083|     10|                           ctx.error = error_code::syntax_error;
 6084|     10|                           return;
 6085|     10|                        }
 6086|  2.68k|                     }
 6087|       |
 6088|       |                     // Find the key span by scanning to the key-value separator
 6089|   134k|                     auto key_scan = key_start;
 6090|   134k|                     auto key_end = key_start;
 6091|   134k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6091:26): [True: 1.75k, False: 133k]
  |  Branch (6091:46): [True: 1.15k, False: 131k]
  ------------------
 6092|       |                        // Quoted key: skip to closing quote
 6093|  2.90k|                        const char quote = *key_scan;
 6094|  2.90k|                        ++key_scan;
 6095|  22.3k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6095:32): [True: 22.3k, False: 8]
  |  Branch (6095:51): [True: 19.4k, False: 2.90k]
  ------------------
 6096|  19.4k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6096:32): [True: 1.29k, False: 18.1k]
  |  Branch (6096:53): [True: 683, False: 613]
  ------------------
 6097|    683|                              ++key_scan;
 6098|    683|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6098:35): [True: 683, False: 0]
  ------------------
 6099|    683|                           }
 6100|  18.7k|                           else {
 6101|  18.7k|                              ++key_scan;
 6102|  18.7k|                           }
 6103|  19.4k|                        }
 6104|  2.90k|                        if (key_scan == end) {
  ------------------
  |  Branch (6104:29): [True: 8, False: 2.90k]
  ------------------
 6105|      8|                           ctx.error = error_code::syntax_error;
 6106|      8|                           return;
 6107|      8|                        }
 6108|  2.90k|                        ++key_scan; // past closing quote
 6109|  2.90k|                        key_end = key_scan;
 6110|  2.90k|                        yaml::skip_inline_ws(key_scan, end);
 6111|  2.90k|                     }
 6112|   131k|                     else {
 6113|       |                        // Plain key: scan to ':'
 6114|  2.43M|                        while (key_scan != end) {
  ------------------
  |  Branch (6114:32): [True: 2.43M, False: 7]
  ------------------
 6115|  2.43M|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6115:32): [True: 255k, False: 2.17M]
  ------------------
 6116|   255k|                              auto next = key_scan + 1;
 6117|   255k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6117:35): [True: 14.5k, False: 241k]
  |  Branch (6117:50): [True: 94.6k, False: 146k]
  |  Branch (6117:66): [True: 5.19k, False: 141k]
  |  Branch (6117:83): [True: 9.37k, False: 132k]
  |  Branch (6117:100): [True: 8.23k, False: 123k]
  ------------------
 6118|   131k|                                 break;
 6119|   131k|                              }
 6120|   255k|                           }
 6121|  2.30M|                           ++key_scan;
 6122|  2.30M|                        }
 6123|   131k|                        key_end = key_scan;
 6124|   154k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6124:32): [True: 144k, False: 9.71k]
  |  Branch (6124:57): [True: 20.8k, False: 124k]
  |  Branch (6124:82): [True: 1.82k, False: 122k]
  ------------------
 6125|  22.7k|                           --key_end;
 6126|  22.7k|                        }
 6127|   131k|                     }
 6128|   134k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6128:26): [True: 8, False: 134k]
  |  Branch (6128:45): [True: 77, False: 134k]
  ------------------
 6129|     85|                        ctx.error = error_code::syntax_error;
 6130|     85|                        return;
 6131|     85|                     }
 6132|       |                     // Store anchor with just the key text span
 6133|   134k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6134|   134k|                     it = key_start;
 6135|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6136|   134k|                     if constexpr (counts::n_object > 0) {
 6137|   134k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6138|   134k|                                                                                                        end);
 6139|       |                     }
 6140|       |                     else {
 6141|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6142|       |                     }
 6143|   134k|                     return;
 6144|   134k|                  }
 6145|   342k|               }
 6146|       |
 6147|   207k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6148|   342k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6149|   342k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6150|   342k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6151|   342k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6151:20): [True: 194k, False: 147k]
  ------------------
 6152|   194k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6153|   194k|               }
 6154|   342k|               return;
 6155|   343k|            }
 6156|   274k|            case '*': {
  ------------------
  |  Branch (6156:13): [True: 274k, False: 1.98M]
  ------------------
 6157|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6158|   274k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|   274k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6159:23): [True: 24.7k, False: 249k]
  ------------------
 6160|  24.7k|                     if constexpr (counts::n_object > 0) {
 6161|  24.7k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|  24.7k|                                                                                                        end);
 6163|  24.7k|                        return;
 6164|       |                     }
 6165|       |                     else {
 6166|       |                        ctx.error = error_code::syntax_error;
 6167|       |                        return;
 6168|       |                     }
 6169|  24.7k|                  }
 6170|   274k|               }
 6171|       |
 6172|       |               // Alias value: look up anchor and replay
 6173|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6174|   274k|               return;
 6175|   343k|            }
 6176|   395k|            case '!': {
  ------------------
  |  Branch (6176:13): [True: 395k, False: 1.86M]
  ------------------
 6177|       |               // Tag - parse it and dispatch based on tag type
 6178|   395k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6179|   395k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6179:20): [True: 313, False: 394k]
  ------------------
 6180|    313|                  ctx.error = error_code::syntax_error;
 6181|    313|                  return;
 6182|    313|               }
 6183|   394k|               yaml::skip_inline_ws(it, end);
 6184|   394k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6184:20): [True: 393k, False: 1.72k]
  |  Branch (6184:33): [True: 23.6k, False: 369k]
  ------------------
 6185|  23.6k|                  yaml::skip_comment(it, end);
 6186|  23.6k|               }
 6187|   394k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6187:20): [True: 392k, False: 2.61k]
  |  Branch (6187:34): [True: 210k, False: 181k]
  |  Branch (6187:49): [True: 26.4k, False: 155k]
  ------------------
 6188|   236k|                  auto content = it;
 6189|   236k|                  yaml::skip_newline(content, end);
 6190|   236k|                  yaml::skip_to_content(content, end);
 6191|       |
 6192|   236k|                  bool consume_following_content = false;
 6193|   236k|                  auto content_token = content;
 6194|   236k|                  if (content != end) {
  ------------------
  |  Branch (6194:23): [True: 232k, False: 4.07k]
  ------------------
 6195|   232k|                     auto indent_probe = content;
 6196|   232k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6197|   232k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6197:26): [True: 6, False: 232k]
  ------------------
 6198|      6|                        return;
 6199|   232k|                     content_token = indent_probe;
 6200|       |
 6201|       |                     // A tag at the end of a sequence/map entry has an empty value
 6202|       |                     // unless the next non-empty content is nested under the current node.
 6203|   232k|                     bool tagged_indentless_sequence = false;
 6204|   232k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6204:26): [True: 142k, False: 90.2k]
  |  Branch (6204:56): [True: 142k, False: 0]
  |  Branch (6204:79): [True: 141k, False: 1.24k]
  ------------------
 6205|   141k|                        const auto after_dash = indent_probe + 1;
 6206|   141k|                        if (after_dash == end ||
  ------------------
  |  Branch (6206:29): [True: 412, False: 140k]
  ------------------
 6207|   140k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6207:29): [True: 140k, False: 693]
  ------------------
 6208|   140k|                           tagged_indentless_sequence =
 6209|   140k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6209:31): [True: 1.70k, False: 138k]
  ------------------
 6210|   138k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6210:32): [True: 124k, False: 14.6k]
  |  Branch (6210:60): [True: 124k, False: 175]
  ------------------
 6211|   140k|                        }
 6212|   141k|                     }
 6213|       |
 6214|   232k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6214:50): [True: 4.84k, False: 228k]
  ------------------
 6215|   228k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6215:50): [True: 22.8k, False: 205k]
  |  Branch (6215:93): [True: 125k, False: 79.3k]
  ------------------
 6216|   232k|                  }
 6217|       |
 6218|   236k|                  if (consume_following_content) {
  ------------------
  |  Branch (6218:23): [True: 153k, False: 83.4k]
  ------------------
 6219|   153k|                     it = content_token;
 6220|   153k|                  }
 6221|  83.4k|                  else {
 6222|  83.4k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6222:26): [True: 9.44k, False: 73.9k]
  ------------------
 6223|  9.44k|                        if constexpr (counts::n_str > 0) {
 6224|  9.44k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6225|  9.44k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6226|  9.44k|                           value = StrType{};
 6227|  9.44k|                           return;
 6228|  9.44k|                        }
 6229|  9.44k|                     }
 6230|  83.4k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6230:26): [True: 732, False: 82.7k]
  ------------------
 6231|    732|                        if constexpr (counts::n_null > 0) {
 6232|    732|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6233|    732|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6234|    732|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6234:32): [True: 0, False: 732]
  ------------------
 6235|    732|                           return;
 6236|    732|                        }
 6237|    732|                     }
 6238|  83.4k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6238:26): [True: 71.2k, False: 12.2k]
  ------------------
 6239|  71.2k|                        if constexpr (counts::n_null > 0) {
 6240|  71.2k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6241|  71.2k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6242|  71.2k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6242:32): [True: 0, False: 71.2k]
  ------------------
 6243|  71.2k|                           return;
 6244|  71.2k|                        }
 6245|  71.2k|                     }
 6246|  83.4k|                  }
 6247|   236k|               }
 6248|   394k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6249|       |                  // In block context, a comma immediately after a tag token is malformed
 6250|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6251|   394k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6251:23): [True: 310k, False: 83.9k]
  |  Branch (6251:36): [True: 48, False: 310k]
  ------------------
 6252|     48|                     ctx.error = error_code::syntax_error;
 6253|     48|                     return;
 6254|     48|                  }
 6255|   394k|                  if constexpr (counts::n_object > 0) {
 6256|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6257|   394k|                     const bool starts_block_sequence_entry =
 6258|   394k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6258:26): [True: 310k, False: 83.9k]
  |  Branch (6258:39): [True: 145k, False: 164k]
  ------------------
 6259|   145k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6259:26): [True: 1.08k, False: 144k]
  |  Branch (6259:45): [True: 142k, False: 2.48k]
  ------------------
 6260|   394k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6260:26): [True: 170k, False: 224k]
  |  Branch (6260:58): [True: 44.5k, False: 125k]
  ------------------
 6261|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6262|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6263|  44.5k|                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6264|  44.5k|                        return;
 6265|  44.5k|                     }
 6266|   394k|                  }
 6267|   394k|               }
 6268|   394k|               if (it == end) {
  ------------------
  |  Branch (6268:20): [True: 2.61k, False: 392k]
  ------------------
 6269|  2.61k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6269:23): [True: 792, False: 1.82k]
  ------------------
 6270|    792|                     if constexpr (counts::n_str > 0) {
 6271|    792|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6272|    792|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6273|    792|                        value = StrType{};
 6274|    792|                        return;
 6275|    792|                     }
 6276|    792|                  }
 6277|  2.61k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6277:23): [True: 1.79k, False: 821]
  ------------------
 6278|  1.79k|                     if constexpr (counts::n_null > 0) {
 6279|  1.79k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6280|  1.79k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6281|  1.79k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6281:29): [True: 0, False: 1.79k]
  ------------------
 6282|  1.79k|                        return;
 6283|  1.79k|                     }
 6284|  1.79k|                  }
 6285|      0|                  ctx.error = error_code::unexpected_end;
 6286|  2.61k|                  return;
 6287|  2.61k|               }
 6288|   392k|               switch (tag) {
 6289|  2.78k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6289:16): [True: 2.78k, False: 389k]
  ------------------
 6290|  2.78k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6291|  2.78k|                  return;
 6292|  2.87k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6292:16): [True: 2.87k, False: 389k]
  ------------------
 6293|  3.28k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6293:16): [True: 411, False: 391k]
  ------------------
 6294|  3.28k|                  if constexpr (counts::n_num > 0) {
 6295|  3.28k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6296|  3.28k|                     return;
 6297|       |                  }
 6298|       |                  else { // else used to fix MSVC unreachable code warning
 6299|       |                     ctx.error = error_code::syntax_error;
 6300|       |                     return;
 6301|       |                  }
 6302|  31.9k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6302:16): [True: 28.6k, False: 363k]
  ------------------
 6303|  31.9k|                  if constexpr (counts::n_bool > 0) {
 6304|  31.9k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6305|  31.9k|                     return;
 6306|       |                  }
 6307|       |                  else { // else used to fix MSVC unreachable code warning
 6308|       |                     ctx.error = error_code::syntax_error;
 6309|       |                     return;
 6310|       |                  }
 6311|  32.3k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6311:16): [True: 397, False: 391k]
  ------------------
 6312|  32.3k|                  if constexpr (counts::n_null > 0) {
 6313|  32.3k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6314|  32.3k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6315|  32.3k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6315:26): [True: 0, False: 32.3k]
  ------------------
 6316|  32.3k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6317|  32.3k|                     return;
 6318|       |                  }
 6319|       |                  else { // else used to fix MSVC unreachable code warning
 6320|       |                     ctx.error = error_code::syntax_error;
 6321|       |                     return;
 6322|       |                  }
 6323|  45.0k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6323:16): [True: 12.7k, False: 379k]
  ------------------
 6324|  45.0k|                  if constexpr (counts::n_object > 0) {
 6325|  45.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6326|  45.0k|                                                                                                     end);
 6327|  45.0k|                     return;
 6328|       |                  }
 6329|       |                  else { // else used to fix MSVC unreachable code warning
 6330|       |                     ctx.error = error_code::syntax_error;
 6331|       |                     return;
 6332|       |                  }
 6333|   200k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6333:16): [True: 155k, False: 237k]
  ------------------
 6334|   200k|                  if constexpr (counts::n_array > 0) {
 6335|   200k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6336|   200k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6337|   200k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6337:29): [True: 155k, False: 45.0k]
  |  Branch (6337:42): [True: 140k, False: 14.5k]
  ------------------
 6338|   140k|                           ctx.allow_indentless_sequence = true;
 6339|   140k|                        }
 6340|   200k|                     }
 6341|   200k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6342|   200k|                                                                                                    end);
 6343|   200k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6344|   200k|                     return;
 6345|       |                  }
 6346|       |                  else { // else used to fix MSVC unreachable code warning
 6347|       |                     ctx.error = error_code::syntax_error;
 6348|       |                     return;
 6349|       |                  }
 6350|   263k|               default: {
  ------------------
  |  Branch (6350:16): [True: 63.1k, False: 329k]
  ------------------
 6351|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6352|       |                  // Preserve collection kinds, otherwise treat as string content.
 6353|   263k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6353:23): [True: 63.1k, False: 200k]
  |  Branch (6353:36): [True: 18.7k, False: 44.4k]
  ------------------
 6354|  18.7k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6355|  18.7k|                     return;
 6356|  18.7k|                  }
 6357|       |
 6358|   244k|                  if constexpr (counts::n_array > 0) {
 6359|   244k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6359:26): [True: 44.4k, False: 200k]
  |  Branch (6359:39): [True: 1.04k, False: 43.3k]
  ------------------
 6360|  1.04k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6361|  1.04k|                                                                                                       end);
 6362|  1.04k|                        return;
 6363|  1.04k|                     }
 6364|   244k|                  }
 6365|   244k|                  if constexpr (counts::n_object > 0) {
 6366|   244k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6366:26): [True: 43.3k, False: 201k]
  |  Branch (6366:39): [True: 1.47k, False: 41.9k]
  ------------------
 6367|  1.47k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6368|  1.47k|                                                                                                        end);
 6369|  1.47k|                        return;
 6370|  1.47k|                     }
 6371|   244k|                  }
 6372|       |
 6373|   244k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6374|   244k|                     if constexpr (counts::n_array > 0) {
 6375|   244k|                        const bool starts_block_sequence_entry =
 6376|   244k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6376:29): [True: 41.9k, False: 202k]
  |  Branch (6376:42): [True: 3.26k, False: 38.6k]
  ------------------
 6377|  3.26k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6377:29): [True: 680, False: 2.58k]
  |  Branch (6377:48): [True: 2.05k, False: 525]
  ------------------
 6378|   244k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6378:29): [True: 2.73k, False: 242k]
  ------------------
 6379|  2.73k|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6380|  2.73k|                                                                                                          it, end);
 6381|  2.73k|                           return;
 6382|  2.73k|                        }
 6383|   244k|                     }
 6384|   244k|                     if constexpr (counts::n_object > 0) {
 6385|   244k|                        const bool starts_explicit_mapping_indicator =
 6386|   244k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6386:29): [True: 39.1k, False: 205k]
  |  Branch (6386:43): [True: 3.90k, False: 35.2k]
  |  Branch (6386:57): [True: 1.19k, False: 34.0k]
  ------------------
 6387|  5.10k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6387:29): [True: 825, False: 4.27k]
  |  Branch (6387:48): [True: 2.87k, False: 1.39k]
  ------------------
 6388|   244k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6388:29): [True: 3.70k, False: 241k]
  ------------------
 6389|  3.70k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6390|  3.70k|                                                                                                           it, end);
 6391|  3.70k|                           return;
 6392|  3.70k|                        }
 6393|   241k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6393:29): [True: 0, False: 241k]
  ------------------
 6394|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6395|      0|                                                                                                           it, end);
 6396|      0|                           return;
 6397|      0|                        }
 6398|   241k|                     }
 6399|   244k|                  }
 6400|       |
 6401|   244k|                  if constexpr (counts::n_str > 0) {
 6402|   244k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6403|   244k|                     return;
 6404|   244k|                  }
 6405|       |
 6406|       |                  // Fall back if no string alternative exists.
 6407|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6408|   244k|                  return;
 6409|   263k|               }
 6410|   392k|               }
 6411|      0|               return;
 6412|   392k|            }
 6413|  60.0k|            case '{':
  ------------------
  |  Branch (6413:13): [True: 60.0k, False: 2.20M]
  ------------------
 6414|  60.0k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6415|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6416|  60.0k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6416:23): [True: 26.6k, False: 33.4k]
  |  Branch (6416:51): [True: 2.71k, False: 23.9k]
  ------------------
 6417|  2.71k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6418|  2.71k|                                                                                                     end);
 6419|  2.71k|                     return;
 6420|  2.71k|                  }
 6421|  60.0k|               }
 6422|       |               // Flow mapping - object type
 6423|  57.3k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6424|  60.0k|               return;
 6425|  92.3k|            case '[':
  ------------------
  |  Branch (6425:13): [True: 92.3k, False: 2.17M]
  ------------------
 6426|  92.3k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6427|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6428|  92.3k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6428:23): [True: 58.1k, False: 34.1k]
  |  Branch (6428:51): [True: 1.44k, False: 56.6k]
  ------------------
 6429|  1.44k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6430|  1.44k|                                                                                                     end);
 6431|  1.44k|                     return;
 6432|  1.44k|                  }
 6433|  92.3k|               }
 6434|       |               // Flow sequence - array type
 6435|  90.8k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6436|  92.3k|               return;
 6437|   241k|            case '?':
  ------------------
  |  Branch (6437:13): [True: 241k, False: 2.02M]
  ------------------
 6438|       |               // Explicit mapping key indicator ("? key")
 6439|   241k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6439:20): [True: 241k, False: 813]
  |  Branch (6439:39): [True: 23, False: 241k]
  ------------------
 6440|     23|                  ctx.error = error_code::syntax_error;
 6441|     23|                  return;
 6442|     23|               }
 6443|   241k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6443:20): [True: 241k, False: 813]
  |  Branch (6443:40): [True: 92.7k, False: 148k]
  |  Branch (6443:56): [True: 92.0k, False: 56.3k]
  |  Branch (6443:73): [True: 42.5k, False: 13.7k]
  ------------------
 6444|   227k|                  if constexpr (counts::n_object > 0) {
 6445|   227k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6446|   227k|                                                                                                     end);
 6447|   227k|                     return;
 6448|   227k|                  }
 6449|   227k|               }
 6450|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6451|   241k|               return;
 6452|     37|            case '%':
  ------------------
  |  Branch (6452:13): [True: 37, False: 2.26M]
  ------------------
 6453|       |               // Reserved directive indicator is not a plain scalar start.
 6454|     37|               ctx.error = error_code::syntax_error;
 6455|     37|               return;
 6456|  5.52k|            case '"':
  ------------------
  |  Branch (6456:13): [True: 5.52k, False: 2.25M]
  ------------------
 6457|  8.08k|            case '\'':
  ------------------
  |  Branch (6457:13): [True: 2.55k, False: 2.26M]
  ------------------
 6458|       |               // Could be a quoted string OR a quoted key in a block mapping
 6459|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6460|  8.08k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6461|  8.08k|               return;
 6462|  33.2k|            case 't':
  ------------------
  |  Branch (6462:13): [True: 33.2k, False: 2.22M]
  ------------------
 6463|  47.9k|            case 'T':
  ------------------
  |  Branch (6463:13): [True: 14.6k, False: 2.24M]
  ------------------
 6464|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6465|  47.9k|               if constexpr (counts::n_bool > 0) {
 6466|  47.9k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6466:23): [True: 46.6k, False: 1.27k]
  |  Branch (6466:44): [True: 40.1k, False: 6.44k]
  |  Branch (6466:60): [True: 37.4k, False: 2.75k]
  |  Branch (6466:76): [True: 34.3k, False: 3.10k]
  ------------------
 6467|  36.0k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6467:44): [True: 3.50k, False: 8.80k]
  |  Branch (6467:60): [True: 2.47k, False: 1.02k]
  |  Branch (6467:76): [True: 1.72k, False: 747]
  ------------------
 6468|       |                     // Check what follows the word "true"
 6469|  36.0k|                     const auto after_true = it + 4;
 6470|  36.0k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6471|       |
 6472|  36.0k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6472:26): [True: 34.8k, False: 1.23k]
  ------------------
 6473|  34.8k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6473:29): [True: 871, False: 33.9k]
  ------------------
 6474|    871|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|    871|                           return;
 6476|    871|                        }
 6477|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6478|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6479|  33.9k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6479:29): [True: 25.1k, False: 8.83k]
  |  Branch (6479:47): [True: 12.1k, False: 12.9k]
  ------------------
 6480|  12.1k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6480:30): [True: 8.24k, False: 3.89k]
  |  Branch (6480:47): [True: 1.43k, False: 2.46k]
  |  Branch (6480:63): [True: 808, False: 1.65k]
  |  Branch (6480:80): [True: 841, False: 816]
  |  Branch (6480:97): [True: 816, False: 0]
  ------------------
 6481|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6482|  12.1k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6483|  12.1k|                           return;
 6484|  12.1k|                        }
 6485|  21.8k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6486|  21.8k|                                                                                                      end);
 6487|  21.8k|                        return;
 6488|  33.9k|                     }
 6489|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6490|  36.0k|                  }
 6491|  47.9k|               }
 6492|  13.0k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6493|  47.9k|               return;
 6494|  28.6k|            case 'f':
  ------------------
  |  Branch (6494:13): [True: 28.6k, False: 2.23M]
  ------------------
 6495|  43.4k|            case 'F':
  ------------------
  |  Branch (6495:13): [True: 14.7k, False: 2.24M]
  ------------------
 6496|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6497|  43.4k|               if constexpr (counts::n_bool > 0) {
 6498|  43.4k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6498:23): [True: 42.6k, False: 808]
  |  Branch (6498:44): [True: 27.9k, False: 14.6k]
  |  Branch (6498:60): [True: 26.7k, False: 1.20k]
  |  Branch (6498:76): [True: 21.2k, False: 5.43k]
  |  Branch (6498:92): [True: 19.4k, False: 1.78k]
  ------------------
 6499|  23.1k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6499:44): [True: 6.31k, False: 16.8k]
  |  Branch (6499:60): [True: 4.92k, False: 1.38k]
  |  Branch (6499:76): [True: 3.62k, False: 1.30k]
  |  Branch (6499:92): [True: 2.79k, False: 830]
  ------------------
 6500|       |                     // Check what follows the word "false"
 6501|  22.2k|                     const auto after_false = it + 5;
 6502|  22.2k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6503|       |
 6504|  22.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6504:26): [True: 20.1k, False: 2.11k]
  ------------------
 6505|  20.1k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6505:29): [True: 989, False: 19.1k]
  ------------------
 6506|    989|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|    989|                           return;
 6508|    989|                        }
 6509|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6510|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6511|  19.1k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6511:29): [True: 18.7k, False: 443]
  |  Branch (6511:47): [True: 6.57k, False: 12.1k]
  ------------------
 6512|  6.57k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6512:30): [True: 782, False: 5.79k]
  |  Branch (6512:47): [True: 897, False: 4.89k]
  |  Branch (6512:63): [True: 1.59k, False: 3.29k]
  |  Branch (6512:80): [True: 801, False: 2.49k]
  |  Branch (6512:97): [True: 2.49k, False: 0]
  ------------------
 6513|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6514|  6.57k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6515|  6.57k|                           return;
 6516|  6.57k|                        }
 6517|  12.6k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6518|  12.6k|                                                                                                      end);
 6519|  12.6k|                        return;
 6520|  19.1k|                     }
 6521|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6522|  22.2k|                  }
 6523|  43.4k|               }
 6524|  23.2k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6525|  43.4k|               return;
 6526|  13.2k|            case 'n':
  ------------------
  |  Branch (6526:13): [True: 13.2k, False: 2.24M]
  ------------------
 6527|  33.7k|            case 'N':
  ------------------
  |  Branch (6527:13): [True: 20.5k, False: 2.24M]
  ------------------
 6528|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6529|  33.7k|               if constexpr (counts::n_null > 0) {
 6530|  33.7k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6530:23): [True: 32.8k, False: 947]
  |  Branch (6530:44): [True: 15.4k, False: 17.4k]
  |  Branch (6530:60): [True: 13.8k, False: 1.61k]
  |  Branch (6530:76): [True: 13.1k, False: 707]
  ------------------
 6531|  26.2k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6531:44): [True: 14.9k, False: 4.76k]
  |  Branch (6531:60): [True: 13.8k, False: 1.08k]
  |  Branch (6531:76): [True: 13.1k, False: 740]
  ------------------
 6532|       |                     // Check what follows the word "null"
 6533|  26.2k|                     const auto after_null = it + 4;
 6534|  26.2k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6535|       |
 6536|  26.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6536:26): [True: 21.0k, False: 5.17k]
  ------------------
 6537|  21.0k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6537:29): [True: 759, False: 20.3k]
  ------------------
 6538|    759|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|    759|                           return;
 6540|    759|                        }
 6541|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6542|       |                        // "null: value" should parse as {null: value}, not as the null type
 6543|  20.3k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6543:29): [True: 19.6k, False: 683]
  |  Branch (6543:47): [True: 5.32k, False: 14.2k]
  ------------------
 6544|  5.32k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6544:30): [True: 826, False: 4.50k]
  |  Branch (6544:47): [True: 952, False: 3.55k]
  |  Branch (6544:63): [True: 1.36k, False: 2.18k]
  |  Branch (6544:80): [True: 1.21k, False: 972]
  |  Branch (6544:97): [True: 972, False: 0]
  ------------------
 6545|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6546|  5.32k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6547|  5.32k|                           return;
 6548|  5.32k|                        }
 6549|  14.9k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6550|  14.9k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6551|  14.9k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6551:29): [True: 0, False: 14.9k]
  ------------------
 6552|  14.9k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6553|  14.9k|                        return;
 6554|  20.3k|                     }
 6555|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6556|  26.2k|                  }
 6557|  33.7k|               }
 6558|  12.7k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6559|  33.7k|               return;
 6560|  3.08k|            case '~':
  ------------------
  |  Branch (6560:13): [True: 3.08k, False: 2.25M]
  ------------------
 6561|       |               // Null indicator
 6562|  3.08k|               if constexpr (counts::n_null > 0) {
 6563|  3.08k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6564|  3.08k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6565|  3.08k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6565:23): [True: 0, False: 3.08k]
  ------------------
 6566|  3.08k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6567|  3.08k|                  return;
 6568|  3.08k|               }
 6569|      0|               break; // Fall through to try other types
 6570|   136k|            case '-':
  ------------------
  |  Branch (6570:13): [True: 136k, False: 2.12M]
  ------------------
 6571|       |               // Could be negative number or block sequence indicator
 6572|   136k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6572:20): [True: 1.98k, False: 134k]
  |  Branch (6572:41): [True: 113k, False: 21.0k]
  ------------------
 6573|       |                  // Block sequence indicator "- "
 6574|   115k|                  if constexpr (counts::n_array > 0) {
 6575|   115k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6576|   115k|                                                                                                    end);
 6577|   115k|                     return;
 6578|   115k|                  }
 6579|   115k|               }
 6580|   136k|               if constexpr (counts::n_num > 0) {
 6581|   136k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6581:23): [True: 21.0k, False: 115k]
  |  Branch (6581:43): [True: 1.87k, False: 19.2k]
  |  Branch (6581:94): [True: 2.24k, False: 16.9k]
  ------------------
 6582|  4.11k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6583|  4.11k|                     return;
 6584|  4.11k|                  }
 6585|   136k|               }
 6586|   132k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6587|   136k|               return;
 6588|  8.24k|            case '+':
  ------------------
  |  Branch (6588:13): [True: 8.24k, False: 2.25M]
  ------------------
 6589|  28.1k|            case '.':
  ------------------
  |  Branch (6589:13): [True: 19.9k, False: 2.24M]
  ------------------
 6590|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6591|       |               // Try parsing as number speculatively, fall back to string on failure
 6592|  28.1k|               if constexpr (counts::n_num > 0) {
 6593|  28.1k|                  auto start_it = it;
 6594|  28.1k|                  auto temp_ctx = ctx.make_speculative();
 6595|  28.1k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6596|  28.1k|                                                                                               end);
 6597|  28.1k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6598|  28.1k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6599|  28.1k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6599:23): [True: 8.83k, False: 19.3k]
  ------------------
 6600|  8.83k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6601|  8.83k|                     return; // Successfully parsed as number
 6602|  8.83k|                  }
 6603|  19.3k|                  it = start_it; // Restore and fall through to string
 6604|  19.3k|               }
 6605|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6606|  28.1k|               return;
 6607|   518k|            default:
  ------------------
  |  Branch (6607:13): [True: 518k, False: 1.74M]
  ------------------
 6608|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6609|   518k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6609:20): [True: 354k, False: 164k]
  |  Branch (6609:32): [True: 104k, False: 249k]
  ------------------
 6610|       |                  // Try block mapping first (e.g., "123key: value")
 6611|   104k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6611:23): [True: 28.2k, False: 76.5k]
  ------------------
 6612|  28.2k|                     return;
 6613|  28.2k|                  }
 6614|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6615|  76.5k|                  if constexpr (counts::n_num > 0) {
 6616|  76.5k|                     auto start_it = it;
 6617|  76.5k|                     auto temp_ctx = ctx.make_speculative();
 6618|  76.5k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6619|  76.5k|                                                                                                  end);
 6620|  76.5k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6621|  76.5k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6622|  76.5k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6622:26): [True: 5.82k, False: 70.7k]
  ------------------
 6623|  5.82k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6624|  5.82k|                        return; // Successfully parsed as number
 6625|  5.82k|                     }
 6626|  70.7k|                     it = start_it; // Restore and fall through to string
 6627|  70.7k|                  }
 6628|       |                  // Fall through to string
 6629|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6630|  76.5k|                  return;
 6631|   104k|               }
 6632|       |               // Plain scalar - try block mapping, then string
 6633|   413k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6634|   413k|               return;
 6635|  2.26M|            }
 6636|  2.26M|         }
 6637|       |
 6638|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6639|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6640|       |
 6641|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6642|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6643|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6644|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6645|  2.26M|         error_code expansion_error{};
 6646|  2.26M|         std::string_view expansion_message{};
 6647|       |
 6648|  2.26M|         auto try_parse = [&]<size_t I>() -> bool {
 6649|  2.26M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6650|  2.26M|            auto start = it;
 6651|       |
 6652|  2.26M|            V v{};
 6653|  2.26M|            auto temp_ctx = ctx.make_speculative();
 6654|  2.26M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6655|  2.26M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6656|  2.26M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6657|       |
 6658|  2.26M|            if (!bool(temp_ctx.error)) {
 6659|  2.26M|               value = std::move(v);
 6660|  2.26M|               ctx.anchors = std::move(temp_ctx.anchors);
 6661|  2.26M|               return true;
 6662|  2.26M|            }
 6663|       |
 6664|  2.26M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6665|  2.26M|               expansion_error = temp_ctx.error;
 6666|  2.26M|               expansion_message = temp_ctx.custom_error_message;
 6667|  2.26M|            }
 6668|  2.26M|            it = start;
 6669|  2.26M|            return false;
 6670|  2.26M|         };
 6671|       |
 6672|  2.26M|         bool parsed = false;
 6673|  2.26M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6674|  2.26M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6675|  2.26M|         }(std::make_index_sequence<N>{});
 6676|       |
 6677|  2.26M|         if (!parsed) {
  ------------------
  |  Branch (6677:14): [True: 0, False: 2.26M]
  ------------------
 6678|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6678:17): [True: 0, False: 0]
  ------------------
 6679|      0|               ctx.error = expansion_error;
 6680|      0|               ctx.custom_error_message = expansion_message;
 6681|      0|            }
 6682|      0|            else {
 6683|      0|               ctx.error = error_code::no_matching_variant_type;
 6684|      0|            }
 6685|      0|         }
 6686|  2.26M|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   860k|      {
 5284|   860k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   860k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   860k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   860k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   860k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 860k, False: 0]
  ------------------
 5294|   860k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   860k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4593|   867k|      {
 4594|   867k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4594:14): [True: 0, False: 867k]
  ------------------
 4595|      0|            return;
 4596|       |
 4597|   867k|         yaml::node_preamble_state preamble{};
 4598|   867k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4598:14): [True: 9.13k, False: 858k]
  ------------------
 4599|   867k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4600|  9.13k|            return;
 4601|       |
 4602|   858k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4603|   858k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4604|       |
 4605|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4606|       |         // value of a key that existed before the read and adds new keys, while
 4607|       |         // pre-existing keys the document does not mention are preserved (like a
 4608|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4609|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4610|       |         // mappings disallow duplicate keys and the conformance suite expects
 4611|       |         // first-wins, which falls out of emplace into an empty map. Any
 4612|       |         // pre-existing entry the document leaves untouched is restored on scope
 4613|       |         // exit (including error paths). When the target starts empty (the common
 4614|       |         // case) this is a no-op with negligible cost.
 4615|   858k|         std::remove_cvref_t<T> preexisting_entries;
 4616|   858k|         if (!value.empty()) {
  ------------------
  |  Branch (4616:14): [True: 0, False: 858k]
  ------------------
 4617|      0|            preexisting_entries = std::move(value);
 4618|      0|            value.clear();
 4619|      0|         }
 4620|   858k|         struct merge_restore_guard
 4621|   858k|         {
 4622|   858k|            std::remove_cvref_t<T>& target;
 4623|   858k|            std::remove_cvref_t<T>& saved;
 4624|   858k|            ~merge_restore_guard()
 4625|   858k|            {
 4626|       |               // emplace is a no-op for keys the document already wrote, so only
 4627|       |               // untouched pre-existing entries are put back.
 4628|   858k|               for (auto& entry : saved) {
 4629|   858k|                  target.emplace(entry.first, std::move(entry.second));
 4630|   858k|               }
 4631|   858k|            }
 4632|   858k|         } merge_restore{value, preexisting_entries};
 4633|       |
 4634|   858k|         const bool treat_as_block_mapping =
 4635|   858k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4635:13): [True: 858k, Folded]
  |  Branch (4635:48): [True: 71.9k, False: 786k]
  |  Branch (4635:62): [True: 1.23k, False: 70.7k]
  ------------------
 4636|       |
 4637|   858k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4637:14): [True: 71.9k, False: 786k]
  |  Branch (4637:28): [True: 70.7k, False: 1.23k]
  ------------------
 4638|       |            // Flow mapping
 4639|  70.7k|            ++it;
 4640|       |            // Skip whitespace and newlines after opening brace
 4641|  70.7k|            yaml::skip_ws_and_newlines(it, end);
 4642|       |
 4643|  70.7k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4643:17): [True: 69.0k, False: 1.66k]
  |  Branch (4643:30): [True: 11.5k, False: 57.5k]
  ------------------
 4644|  11.5k|               ++it;
 4645|  11.5k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4646|  11.5k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4646:20): [True: 57, False: 11.4k]
  ------------------
 4647|     57|                  return;
 4648|  11.4k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4649|  11.4k|               return;
 4650|  11.5k|            }
 4651|       |
 4652|   188k|            while (it != end) {
  ------------------
  |  Branch (4652:20): [True: 183k, False: 5.17k]
  ------------------
 4653|       |               // Skip whitespace and newlines at start of each iteration
 4654|   183k|               yaml::skip_ws_and_newlines(it, end);
 4655|       |
 4656|   183k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4656:20): [True: 183k, False: 0]
  |  Branch (4656:33): [True: 9.82k, False: 173k]
  ------------------
 4657|  9.82k|                  ++it;
 4658|  9.82k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4659|  9.82k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4659:23): [True: 42, False: 9.78k]
  ------------------
 4660|     42|                     return;
 4661|  9.78k|                  break;
 4662|  9.82k|               }
 4663|       |
 4664|   173k|               bool explicit_flow_key = false;
 4665|   173k|               auto explicit_probe = it;
 4666|   173k|               yaml::skip_inline_ws(explicit_probe, end);
 4667|   173k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4667:20): [True: 173k, False: 0]
  |  Branch (4667:45): [True: 6.86k, False: 167k]
  ------------------
 4668|  6.86k|                  const auto after_q = explicit_probe + 1;
 4669|  6.86k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4669:23): [True: 11, False: 6.84k]
  |  Branch (4669:41): [True: 2.90k, False: 3.94k]
  ------------------
 4670|  4.83k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4670:23): [True: 1.09k, False: 2.85k]
  |  Branch (4670:42): [True: 832, False: 2.02k]
  ------------------
 4671|  4.83k|                     explicit_flow_key = true;
 4672|  4.83k|                     it = explicit_probe + 1;
 4673|  4.83k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4674|  4.83k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4674:26): [True: 6, False: 4.83k]
  ------------------
 4675|      6|                        return;
 4676|  4.83k|                  }
 4677|  6.86k|               }
 4678|       |               // Parse key
 4679|   173k|               key_t key{};
 4680|   173k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4681|   173k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4681:23): [True: 4.83k, False: 169k]
  |  Branch (4681:44): [True: 4.79k, False: 33]
  |  Branch (4681:58): [True: 793, False: 4.00k]
  |  Branch (4681:72): [True: 1.72k, False: 2.27k]
  |  Branch (4681:86): [True: 1.10k, False: 1.17k]
  ------------------
 4682|  3.62k|                     key.clear();
 4683|  3.62k|                  }
 4684|   170k|                  else {
 4685|   170k|                     auto key_probe = it;
 4686|   170k|                     yaml::skip_inline_ws(key_probe, end);
 4687|       |
 4688|       |                     // Use full node parsing only for structurally complex flow keys.
 4689|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4690|   170k|                     bool parse_complex_flow_key = false;
 4691|   170k|                     if (key_probe != end) {
  ------------------
  |  Branch (4691:26): [True: 170k, False: 33]
  ------------------
 4692|   170k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4692:29): [True: 1.80k, False: 168k]
  |  Branch (4692:50): [True: 7.84k, False: 160k]
  ------------------
 4693|  9.64k|                           parse_complex_flow_key = true;
 4694|  9.64k|                        }
 4695|   160k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4695:34): [True: 18.1k, False: 142k]
  ------------------
 4696|  18.1k|                           ++key_probe;
 4697|  18.1k|                           yaml::parse_anchor_name(key_probe, end);
 4698|  18.1k|                           yaml::skip_inline_ws(key_probe, end);
 4699|  18.1k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4699:32): [True: 17.9k, False: 148]
  |  Branch (4699:53): [True: 1.28k, False: 16.7k]
  |  Branch (4699:74): [True: 1.49k, False: 15.2k]
  ------------------
 4700|  2.78k|                              parse_complex_flow_key = true;
 4701|  2.78k|                           }
 4702|  18.1k|                        }
 4703|   170k|                     }
 4704|       |
 4705|   170k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4705:26): [True: 12.4k, False: 157k]
  ------------------
 4706|  12.4k|                        glz::generic key_node{};
 4707|  12.4k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4708|  12.4k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4708:29): [True: 2.80k, False: 9.62k]
  ------------------
 4709|  2.80k|                           return;
 4710|  9.62k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4710:29): [True: 9, False: 9.61k]
  ------------------
 4711|      9|                           return;
 4712|  9.62k|                     }
 4713|   157k|                     else {
 4714|   157k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4714:29): [True: 5.17k, False: 152k]
  ------------------
 4715|  5.17k|                           return;
 4716|  5.17k|                        }
 4717|   157k|                     }
 4718|   170k|                  }
 4719|       |               }
 4720|       |               else {
 4721|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4722|       |                     ctx.error = error_code::syntax_error;
 4723|       |                     return;
 4724|       |                  }
 4725|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4726|       |                  if (bool(ctx.error)) [[unlikely]]
 4727|       |                     return;
 4728|       |               }
 4729|       |
 4730|       |               // Separation between flow key and ':' may include comments/newlines.
 4731|       |               // In flow context, newlines are allowed between key and ':'.
 4732|   165k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4733|   173k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4733:20): [True: 25, False: 173k]
  ------------------
 4734|     25|                  return;
 4735|       |
 4736|   173k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4737|   173k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4738|   173k|                     val = {};
 4739|   173k|                     return true;
 4740|   173k|                  }
 4741|   173k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4742|   173k|                     val = glz::generic{};
 4743|   173k|                     return true;
 4744|   173k|                  }
 4745|   173k|                  else {
 4746|   173k|                     static constexpr std::string_view null_value{"null"};
 4747|   173k|                     auto null_it = null_value.data();
 4748|   173k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4749|   173k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4750|   173k|                     return !bool(ctx.error);
 4751|   173k|                  }
 4752|   173k|               };
 4753|       |
 4754|   173k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4754:20): [True: 164k, False: 8.97k]
  |  Branch (4754:34): [True: 95.5k, False: 69.3k]
  |  Branch (4754:48): [True: 16.6k, False: 52.6k]
  ------------------
 4755|   112k|                  val_t val{};
 4756|   112k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4756:23): [True: 0, False: 112k]
  ------------------
 4757|      0|                     return;
 4758|       |
 4759|   112k|                  value.emplace(std::move(key), std::move(val));
 4760|       |
 4761|   112k|                  if (*it == '}') {
  ------------------
  |  Branch (4761:23): [True: 16.6k, False: 95.5k]
  ------------------
 4762|  16.6k|                     ++it;
 4763|  16.6k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4764|  16.6k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4764:26): [True: 85, False: 16.5k]
  ------------------
 4765|     85|                        return;
 4766|  16.5k|                     break;
 4767|  16.6k|                  }
 4768|       |
 4769|  95.5k|                  ++it; // skip comma
 4770|  95.5k|                  yaml::skip_ws_and_newlines(it, end);
 4771|  95.5k|                  continue;
 4772|   112k|               }
 4773|       |
 4774|  61.6k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4774:20): [True: 8.97k, False: 52.6k]
  |  Branch (4774:33): [True: 822, False: 51.8k]
  ------------------
 4775|  1.80k|                  ctx.error = error_code::syntax_error;
 4776|  1.80k|                  return;
 4777|  1.80k|               }
 4778|  59.8k|               ++it;
 4779|       |
 4780|  59.8k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4781|  59.8k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4781:20): [True: 11, False: 59.8k]
  ------------------
 4782|     11|                  return;
 4783|       |
 4784|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4785|  59.8k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4785:20): [True: 51.7k, False: 8.04k]
  |  Branch (4785:34): [True: 9.93k, False: 41.8k]
  |  Branch (4785:48): [True: 9.88k, False: 31.9k]
  ------------------
 4786|  19.8k|                  val_t val{};
 4787|  19.8k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4787:23): [True: 0, False: 19.8k]
  ------------------
 4788|      0|                     return;
 4789|       |
 4790|  19.8k|                  value.emplace(std::move(key), std::move(val));
 4791|       |
 4792|  19.8k|                  if (*it == '}') {
  ------------------
  |  Branch (4792:23): [True: 9.88k, False: 9.93k]
  ------------------
 4793|  9.88k|                     ++it;
 4794|  9.88k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4795|  9.88k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4795:26): [True: 16, False: 9.86k]
  ------------------
 4796|     16|                        return;
 4797|  9.86k|                     break;
 4798|  9.88k|                  }
 4799|       |
 4800|  9.93k|                  ++it; // skip comma
 4801|  9.93k|                  yaml::skip_ws_and_newlines(it, end);
 4802|  9.93k|                  continue;
 4803|  19.8k|               }
 4804|       |
 4805|       |               // Parse value
 4806|  40.0k|               val_t val{};
 4807|  40.0k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4808|  40.0k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 1.31k, False: 38.6k]
  ------------------
 4809|  1.31k|                  return;
 4810|       |
 4811|  38.6k|               value.emplace(std::move(key), std::move(val));
 4812|       |
 4813|  38.6k|               yaml::skip_inline_ws(it, end);
 4814|       |
 4815|  38.6k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4815:20): [True: 30.4k, False: 8.19k]
  |  Branch (4815:33): [True: 5.06k, False: 25.4k]
  ------------------
 4816|  5.06k|                  ++it;
 4817|  5.06k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4818|  5.06k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4818:23): [True: 64, False: 5.00k]
  ------------------
 4819|     64|                     return;
 4820|  5.00k|                  break;
 4821|  5.06k|               }
 4822|  33.6k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4822:25): [True: 25.4k, False: 8.19k]
  |  Branch (4822:38): [True: 21.2k, False: 4.18k]
  ------------------
 4823|  21.2k|                  ++it;
 4824|       |                  // Skip whitespace and newlines after comma
 4825|  21.2k|                  yaml::skip_ws_and_newlines(it, end);
 4826|  21.2k|               }
 4827|  12.3k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4827:25): [True: 4.18k, False: 8.19k]
  |  Branch (4827:39): [True: 1.23k, False: 2.95k]
  |  Branch (4827:54): [True: 2.74k, False: 209]
  ------------------
 4828|       |                  // Newlines may precede either the closing brace or the
 4829|       |                  // separator comma for the next entry.
 4830|  3.97k|                  yaml::skip_ws_and_newlines(it, end);
 4831|  3.97k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4831:23): [True: 3.89k, False: 78]
  |  Branch (4831:36): [True: 805, False: 3.09k]
  ------------------
 4832|    805|                     ++it;
 4833|    805|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4834|    805|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4834:26): [True: 6, False: 799]
  ------------------
 4835|      6|                        return;
 4836|    799|                     break;
 4837|    805|                  }
 4838|  3.17k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4838:23): [True: 3.09k, False: 78]
  |  Branch (4838:36): [True: 2.98k, False: 106]
  ------------------
 4839|  2.98k|                     ++it;
 4840|  2.98k|                     yaml::skip_ws_and_newlines(it, end);
 4841|  2.98k|                     continue;
 4842|  2.98k|                  }
 4843|    184|                  ctx.error = error_code::syntax_error;
 4844|    184|                  return;
 4845|  3.17k|               }
 4846|  8.40k|               else {
 4847|  8.40k|                  ctx.error = error_code::syntax_error;
 4848|  8.40k|                  return;
 4849|  8.40k|               }
 4850|  38.6k|            }
 4851|  59.1k|         }
 4852|   787k|         else {
 4853|       |            // Block mapping - use shared loop with map-specific callback
 4854|   787k|            yaml::parse_block_mapping_loop<Opts>(
 4855|   787k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4856|   787k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|   787k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4858|   787k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   787k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   787k|                           if (ctx.stream_begin) {
 4866|   787k|                              auto is_line_content_start = [&](auto pos) {
 4867|   787k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   787k|                              };
 4869|       |
 4870|   787k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   787k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   787k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   787k|                                 return line != end && *line == ':';
 4874|   787k|                              };
 4875|       |
 4876|   787k|                              if (!is_line_content_start(it) &&
 4877|   787k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4878|   787k|                                  !line_has_explicit_value_indicator(it)) {
 4879|   787k|                                 ctx.error = error_code::syntax_error;
 4880|   787k|                                 return false;
 4881|   787k|                              }
 4882|   787k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   787k|                           }
 4884|   787k|                        }
 4885|       |
 4886|   787k|                        if (*it == '-' &&
 4887|   787k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4888|   787k|                            !line_starts_with_explicit_value_indicator) {
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|   787k|                           ctx.error = error_code::syntax_error;
 4891|   787k|                           return false;
 4892|   787k|                        }
 4893|       |
 4894|   787k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4895|   787k|                           return false;
 4896|   787k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   787k|                        ctx.pop_indent();
 4898|   787k|                     }
 4899|   787k|                     else {
 4900|   787k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|   787k|                        if (nested_indent >= 0) {
 4902|   787k|                           yaml::skip_to_content(it, end);
 4903|   787k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4904|   787k|                              ctx.error = error_code::syntax_error;
 4905|   787k|                              return false;
 4906|   787k|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|   787k|                           const int32_t value_indent =
 4910|   787k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4911|   787k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4912|   787k|                              return false;
 4913|   787k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|   787k|                           ctx.pop_indent();
 4915|   787k|                        }
 4916|   787k|                     }
 4917|   787k|                     return !bool(ctx.error);
 4918|   787k|                  };
 4919|       |
 4920|       |                  // Explicit key entry form:
 4921|       |                  // ? key
 4922|       |                  // : value
 4923|   787k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4924|   787k|                     ctx.error = error_code::syntax_error;
 4925|   787k|                     return false;
 4926|   787k|                  }
 4927|   787k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4928|   787k|                     ++it; // skip '?'
 4929|   787k|                     yaml::skip_inline_ws(it, end);
 4930|       |
 4931|   787k|                     const int32_t explicit_value_indicator_indent =
 4932|   787k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4933|       |
 4934|   787k|                     key_t key{};
 4935|   787k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4936|   787k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   787k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   787k|                        };
 4939|       |
 4940|   787k|                        auto key_it = it;
 4941|   787k|                        yaml::skip_inline_ws(key_it, end);
 4942|       |
 4943|   787k|                        auto content = key_it;
 4944|   787k|                        yaml::skip_to_content(content, end);
 4945|   787k|                        bool handled_anchor_only_empty_key = false;
 4946|       |
 4947|       |                        // Anchor on an empty explicit key node:
 4948|       |                        //   ? &a
 4949|       |                        //   : value
 4950|   787k|                        if (content != end && *content == '&') {
 4951|   787k|                           auto anchor_probe = content + 1;
 4952|   787k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4953|   787k|                           if (!anchor_name.empty()) {
 4954|   787k|                              auto after_anchor = anchor_probe;
 4955|   787k|                              yaml::skip_inline_ws(after_anchor, end);
 4956|       |
 4957|   787k|                              auto value_indicator = after_anchor;
 4958|   787k|                              if (value_indicator != end && *value_indicator == ':') {
 4959|   787k|                                 key.clear();
 4960|   787k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4961|   787k|                                 it = value_indicator;
 4962|   787k|                                 handled_anchor_only_empty_key = true;
 4963|   787k|                              }
 4964|   787k|                              else {
 4965|   787k|                                 if (value_indicator != end && *value_indicator == '#') {
 4966|   787k|                                    yaml::skip_comment(value_indicator, end);
 4967|   787k|                                 }
 4968|   787k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4969|   787k|                                    yaml::skip_newline(value_indicator, end);
 4970|   787k|                                    auto value_line = value_indicator;
 4971|   787k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4972|   787k|                                    if (bool(ctx.error)) [[unlikely]]
 4973|   787k|                                       return false;
 4974|   787k|                                    if (value_line != end && *value_line == ':' &&
 4975|   787k|                                        value_indent == explicit_value_indicator_indent) {
 4976|   787k|                                       key.clear();
 4977|   787k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4978|   787k|                                       it = value_line;
 4979|   787k|                                       handled_anchor_only_empty_key = true;
 4980|   787k|                                    }
 4981|   787k|                                    else if (value_line != end && *value_line == ':') {
 4982|       |                                       // In explicit-key form ("? &a"), a following ':'
 4983|       |                                       // starts the outer value indicator only at the same
 4984|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4985|   787k|                                       ctx.error = error_code::syntax_error;
 4986|   787k|                                       return false;
 4987|   787k|                                    }
 4988|   787k|                                 }
 4989|   787k|                              }
 4990|   787k|                           }
 4991|   787k|                        }
 4992|       |
 4993|   787k|                        const bool key_content_spans_lines = [&] {
 4994|   787k|                           auto scan = key_it;
 4995|   787k|                           while (scan != content && scan != end) {
 4996|   787k|                              if (*scan == '\n' || *scan == '\r') return true;
 4997|   787k|                              ++scan;
 4998|   787k|                           }
 4999|   787k|                           return false;
 5000|   787k|                        }();
 5001|       |
 5002|   787k|                        if (handled_anchor_only_empty_key) {
 5003|       |                           // 'it' already points to the explicit value indicator ':'
 5004|   787k|                        }
 5005|   787k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5006|   787k|                           key.clear();
 5007|   787k|                           it = content;
 5008|   787k|                        }
 5009|   787k|                        else {
 5010|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5011|       |                           // Parse the key node structurally (not via plain-key scanning)
 5012|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5013|       |                           // as complex keys, not split into implicit key/value pairs.
 5014|   787k|                           auto key_node_it = content;
 5015|   787k|                           auto key_node_end = end;
 5016|   787k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5017|       |                              // In explicit-key form, a following standalone ':'
 5018|       |                              // line (same or lower indentation) belongs to the
 5019|       |                              // outer mapping value, not the key node itself.
 5020|   787k|                              auto scan = content;
 5021|   787k|                              while (scan != end) {
 5022|   787k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5023|   787k|                                    ++scan;
 5024|   787k|                                 }
 5025|   787k|                                 if (scan == end) {
 5026|   787k|                                    break;
 5027|   787k|                                 }
 5028|       |
 5029|   787k|                                 yaml::skip_newline(scan, end);
 5030|   787k|                                 auto line_start = scan;
 5031|       |
 5032|   787k|                                 int32_t indicator_indent = 0;
 5033|   787k|                                 while (scan != end && *scan == ' ') {
 5034|   787k|                                    ++indicator_indent;
 5035|   787k|                                    ++scan;
 5036|   787k|                                 }
 5037|       |
 5038|   787k|                                 if (scan != end && *scan == ':') {
 5039|   787k|                                    const auto after_colon = scan + 1;
 5040|   787k|                                    if ((after_colon == end ||
 5041|   787k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5042|   787k|                                        indicator_indent <= line_indent) {
 5043|   787k|                                       key_node_end = line_start;
 5044|   787k|                                       break;
 5045|   787k|                                    }
 5046|   787k|                                 }
 5047|   787k|                              }
 5048|   787k|                           }
 5049|       |
 5050|   787k|                           glz::generic key_node{};
 5051|   787k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5052|   787k|                           ctx.explicit_mapping_key_context = true;
 5053|   787k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5054|   787k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5055|   787k|                           if (bool(ctx.error)) [[unlikely]]
 5056|   787k|                              return false;
 5057|   787k|                           it = key_node_it;
 5058|   787k|                           if (!to_string_key(key_node)) [[unlikely]]
 5059|   787k|                              return false;
 5060|   787k|                        }
 5061|   787k|                     }
 5062|   787k|                     else {
 5063|   787k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5064|   787k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5065|   787k|                           if (bool(ctx.error)) [[unlikely]]
 5066|   787k|                              return false;
 5067|   787k|                        }
 5068|   787k|                     }
 5069|       |
 5070|   787k|                     yaml::skip_inline_ws(it, end);
 5071|   787k|                     yaml::skip_comment(it, end);
 5072|       |
 5073|       |                     // Value indicator may appear on the next line at the same indent.
 5074|   787k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5075|   787k|                        auto probe = it;
 5076|   787k|                        bool found_value_indicator = false;
 5077|       |
 5078|   787k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5079|   787k|                           yaml::skip_newline(probe, end);
 5080|       |
 5081|   787k|                           auto value_line = probe;
 5082|   787k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5083|   787k|                           if (bool(ctx.error)) [[unlikely]]
 5084|   787k|                              return false;
 5085|       |
 5086|   787k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5087|   787k|                              probe = value_line;
 5088|   787k|                              continue; // blank line
 5089|   787k|                           }
 5090|   787k|                           if (*value_line == '#') {
 5091|   787k|                              yaml::skip_comment(value_line, end);
 5092|   787k|                              probe = value_line;
 5093|   787k|                              continue; // comment-only line
 5094|   787k|                           }
 5095|   787k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5096|   787k|                              it = value_line;
 5097|   787k|                              found_value_indicator = true;
 5098|   787k|                           }
 5099|   787k|                           break;
 5100|   787k|                        }
 5101|       |
 5102|   787k|                        if (found_value_indicator) {
 5103|   787k|                           yaml::skip_inline_ws(it, end);
 5104|   787k|                        }
 5105|   787k|                     }
 5106|       |
 5107|   787k|                     val_t val{};
 5108|   787k|                     if (it != end && *it == ':') {
 5109|   787k|                        ++it;
 5110|   787k|                        if (it != end && *it == '\t') {
 5111|   787k|                           ctx.error = error_code::syntax_error;
 5112|   787k|                           return false;
 5113|   787k|                        }
 5114|   787k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5115|   787k|                           auto probe = it;
 5116|   787k|                           yaml::skip_newline(probe, end);
 5117|   787k|                           while (probe != end && *probe == ' ') ++probe;
 5118|   787k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5119|   787k|                              ctx.error = error_code::syntax_error;
 5120|   787k|                              return false;
 5121|   787k|                           }
 5122|   787k|                        }
 5123|   787k|                        yaml::skip_inline_ws(it, end);
 5124|   787k|                        if (!parse_map_value(val)) [[unlikely]]
 5125|   787k|                           return false;
 5126|   787k|                     }
 5127|       |
 5128|   787k|                     value.emplace(std::move(key), std::move(val));
 5129|   787k|                     return true;
 5130|   787k|                  }
 5131|       |
 5132|   787k|                  key_t key{};
 5133|   787k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5134|   787k|                     auto key_probe = it;
 5135|   787k|                     yaml::skip_inline_ws(key_probe, end);
 5136|   787k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5137|   787k|                     if (complex_flow_key) {
 5138|   787k|                        glz::generic key_node{};
 5139|   787k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5140|   787k|                        if (bool(ctx.error)) [[unlikely]]
 5141|   787k|                           return false;
 5142|   787k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5143|   787k|                           return false;
 5144|   787k|                     }
 5145|   787k|                     else {
 5146|   787k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5147|   787k|                           return false;
 5148|   787k|                        }
 5149|   787k|                     }
 5150|   787k|                  }
 5151|   787k|                  else {
 5152|   787k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5153|   787k|                     if (bool(ctx.error)) [[unlikely]]
 5154|   787k|                        return false;
 5155|   787k|                  }
 5156|       |
 5157|   787k|                  yaml::skip_inline_ws(it, end);
 5158|       |
 5159|   787k|                  if (it == end || *it != ':') {
 5160|   787k|                     ctx.error = error_code::syntax_error;
 5161|   787k|                     return false;
 5162|   787k|                  }
 5163|   787k|                  ++it;
 5164|   787k|                  yaml::skip_inline_ws(it, end);
 5165|       |
 5166|   787k|                  val_t val{};
 5167|   787k|                  if (!parse_map_value(val)) [[unlikely]]
 5168|   787k|                     return false;
 5169|       |
 5170|   787k|                  value.emplace(std::move(key), std::move(val));
 5171|   787k|                  return true;
 5172|   787k|               });
 5173|   787k|         }
 5174|       |
 5175|   834k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5176|   834k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   867k|      {
  466|   867k|         skip_inline_ws(it, end);
  467|       |
  468|   867k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 5, False: 867k]
  ------------------
  469|      5|            if constexpr (!AllowEmptyInput) {
  470|      5|               ctx.error = error_code::unexpected_end;
  471|      5|            }
  472|      5|            return true;
  473|      5|         }
  474|       |
  475|   867k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   867k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 867k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   867k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 867k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   867k|         skip_inline_ws(it, end);
  486|       |
  487|   867k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 12, False: 867k]
  ------------------
  488|     12|            if constexpr (!AllowEmptyInput) {
  489|     12|               ctx.error = error_code::unexpected_end;
  490|     12|            }
  491|     12|            return true;
  492|     12|         }
  493|       |
  494|   867k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 9.10k, False: 858k]
  ------------------
  495|  9.10k|            return true;
  496|  9.10k|         }
  497|       |
  498|   858k|         return false;
  499|   867k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESN_:
 4599|   867k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   867k|      {
  409|   867k|         state.has_anchor = false;
  410|   867k|         state.anchor_name.clear();
  411|   867k|         state.anchor_start = nullptr;
  412|   867k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   867k|         if constexpr (Policy.allow_alias) {
  415|   867k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   867k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 840k, False: 26.3k]
  ------------------
  417|   840k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 9.04k, False: 831k]
  ------------------
  418|   840k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   867k|         }
  424|       |
  425|   867k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 858k, False: 9.04k]
  |  Branch (425:27): [True: 56.7k, False: 801k]
  ------------------
  426|  56.7k|            ++it;
  427|  56.7k|            auto name = parse_anchor_name(it, end);
  428|  56.7k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 46, False: 56.7k]
  ------------------
  429|     46|               ctx.error = error_code::syntax_error;
  430|     46|               return true;
  431|     46|            }
  432|  56.7k|            skip_inline_ws(it, end);
  433|  56.7k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 14, False: 56.6k]
  ------------------
  434|     14|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     14|                  ctx.error = error_code::unexpected_end;
  436|     14|               }
  437|     14|               return true;
  438|     14|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  56.6k|            state.has_anchor = true;
  446|  56.6k|            state.anchor_name = std::string(name);
  447|  56.6k|            state.anchor_start = &*it;
  448|  56.6k|         }
  449|       |
  450|   867k|         return false;
  451|   867k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   840k|      {
  301|   840k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 840k]
  |  Branch (301:27): [True: 831k, False: 9.04k]
  ------------------
  302|       |
  303|  9.04k|         ++it; // skip '*'
  304|  9.04k|         auto name = parse_anchor_name(it, end);
  305|  9.04k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 22, False: 9.02k]
  ------------------
  306|     22|            ctx.error = error_code::syntax_error;
  307|     22|            return true;
  308|     22|         }
  309|       |
  310|  9.02k|         auto anchor_it = ctx.anchors.find(name);
  311|  9.02k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 101, False: 8.92k]
  ------------------
  312|    101|            ctx.error = error_code::syntax_error; // undefined alias
  313|    101|            return true;
  314|    101|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  8.92k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  8.92k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.34k, False: 6.58k]
  ------------------
  322|  2.34k|            return true;
  323|  2.34k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  6.58k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 43, False: 6.54k]
  ------------------
  329|     43|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     43|            return true;
  331|     43|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  6.54k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  6.54k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 6.53k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  6.53k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 6.53k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  6.53k|         auto replay_it = span.begin;
  348|  6.53k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  6.53k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  6.53k|         ctx.indent_stack.clear();
  353|  6.53k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 4.39k, False: 2.14k]
  ------------------
  354|  4.39k|            ctx.push_indent(span.base_indent - 1);
  355|  4.39k|         }
  356|       |
  357|  6.53k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  6.53k|         using V = std::remove_cvref_t<T>;
  360|  6.53k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  6.53k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  6.53k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  6.53k|         return true;
  367|  6.53k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  6.01M|      {
  275|  6.01M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  6.01M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  6.01M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  6.01M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_:
 5725|  8.15M|      {
 5726|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5727|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5728|  8.15M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5729|  8.15M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5730|  8.15M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5731|  8.15M|                       "the internally tagged shape, so it is rejected here instead.");
 5732|  8.15M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5732:14): [True: 0, False: 8.15M]
  ------------------
 5733|      0|            return;
 5734|       |
 5735|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5736|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5737|       |         // indent stack does not cover.
 5738|  8.15M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5739|  8.15M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5739:14): [True: 90, False: 8.15M]
  ------------------
 5740|     90|            return;
 5741|       |
 5742|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5743|       |         // For nested values, only skip inline whitespace to preserve block structure
 5744|  8.15M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5744:14): [True: 6.59M, False: 1.55M]
  ------------------
 5745|  6.59M|            yaml::skip_ws_newlines_comments(it, end);
 5746|  6.59M|         }
 5747|  1.55M|         else {
 5748|  1.55M|            yaml::skip_inline_ws(it, end);
 5749|  1.55M|         }
 5750|       |
 5751|  8.15M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5751:14): [True: 395, False: 8.14M]
  ------------------
 5752|    395|            ctx.error = error_code::unexpected_end;
 5753|    395|            return;
 5754|    395|         }
 5755|       |
 5756|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5757|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5758|       |         // same variant definitions round-trip across both formats.
 5759|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5760|       |            using V = std::remove_cvref_t<T>;
 5761|       |            const bool value_is_mapping =
 5762|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5763|       |            if (value_is_mapping) {
 5764|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5765|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5766|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5767|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5768|       |               auto tag_ctx = ctx.make_speculative();
 5769|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5770|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5771|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5772|       |               if (index < ids_v<V>.size()) {
 5773|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5774|       |                  emplace_runtime_variant(value, index);
 5775|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5776|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5777|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5778|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5779|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5780|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5781|       |                     return;
 5782|       |                  }
 5783|       |                  std::visit(
 5784|       |                     [&](auto&& alt) {
 5785|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5786|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5787|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5788|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5789|       |                        }
 5790|       |                        else if constexpr (custom_read<Alt>) {
 5791|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5792|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5793|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5794|       |                           // entry, then hand the remaining mapping to the custom handler.
 5795|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5796|       |                              ctx.error = error_code::feature_not_supported;
 5797|       |                              ctx.custom_error_message =
 5798|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5799|       |                           }
 5800|       |                           else {
 5801|       |                              ctx.scratch.clear();
 5802|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5803|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5804|       |                                    ctx.error = error_code::feature_not_supported;
 5805|       |                                    ctx.custom_error_message =
 5806|       |                                       "the tag must be the first key for a custom variant alternative";
 5807|       |                                 }
 5808|       |                                 else {
 5809|       |                                    yaml::skip_inline_ws(it, end);
 5810|       |                                    if (it == end || *it != ':') {
 5811|       |                                       ctx.error = error_code::syntax_error;
 5812|       |                                    }
 5813|       |                                    else {
 5814|       |                                       ++it;
 5815|       |                                       yaml::skip_inline_ws(it, end);
 5816|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5817|       |                                       if (!bool(ctx.error)) {
 5818|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5819|       |                                          // was the whole mapping: leave the alternative default.
 5820|       |                                          auto probe = it;
 5821|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5822|       |                                          if (probe == end) {
 5823|       |                                             it = probe;
 5824|       |                                          }
 5825|       |                                          else {
 5826|       |                                             // Publish the mapping's column so the custom handler's block
 5827|       |                                             // mapping (which would otherwise discover its own indent) reads
 5828|       |                                             // the remaining entries at the variant's indent and dedents
 5829|       |                                             // correctly in every context (root, sequence, nested).
 5830|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5831|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5832|       |                                             ctx.forced_block_mapping_indent = -1;
 5833|       |                                          }
 5834|       |                                       }
 5835|       |                                    }
 5836|       |                                 }
 5837|       |                              }
 5838|       |                           }
 5839|       |                        }
 5840|       |                        else {
 5841|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5842|       |                           // the value, but the mapping must still be consumed.
 5843|       |                           walk_tagged_mapping<Opts>(
 5844|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5845|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5846|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5847|       |                              });
 5848|       |                        }
 5849|       |                     },
 5850|       |                     value);
 5851|       |                  ctx.pop_indent();
 5852|       |                  return;
 5853|       |               }
 5854|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5855|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5856|       |               // otherwise the deduction path reports no_matching_variant_type.
 5857|       |            }
 5858|       |         }
 5859|       |
 5860|  8.14M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5861|  8.14M|            using V = std::remove_cvref_t<T>;
 5862|  8.14M|            using counts = yaml_variant_type_count<V>;
 5863|  8.14M|            const char c = *it;
 5864|  8.14M|            auto is_plain_scalar_boundary = [](const char ch) {
 5865|  8.14M|               switch (ch) {
 5866|  8.14M|               case ' ':
 5867|  8.14M|               case '\t':
 5868|  8.14M|               case '\n':
 5869|  8.14M|               case '\r':
 5870|  8.14M|               case ',':
 5871|  8.14M|               case ']':
 5872|  8.14M|               case '}':
 5873|  8.14M|                  return true;
 5874|  8.14M|               default:
 5875|  8.14M|                  return false;
 5876|  8.14M|               }
 5877|  8.14M|            };
 5878|       |
 5879|  8.14M|            auto has_indented_block_continuation = [&](auto word_end) {
 5880|  8.14M|               if constexpr (yaml::check_flow_context(Opts)) {
 5881|  8.14M|                  return false;
 5882|  8.14M|               }
 5883|  8.14M|               if (ctx.current_indent() < 0) {
 5884|  8.14M|                  return false;
 5885|  8.14M|               }
 5886|  8.14M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5887|  8.14M|                  return false;
 5888|  8.14M|               }
 5889|       |
 5890|  8.14M|               auto look = word_end;
 5891|  8.14M|               yaml::skip_newline(look, end);
 5892|  8.14M|               while (look != end) {
 5893|  8.14M|                  int32_t line_indent = 0;
 5894|  8.14M|                  while (look != end && *look == ' ') {
 5895|  8.14M|                     ++line_indent;
 5896|  8.14M|                     ++look;
 5897|  8.14M|                  }
 5898|  8.14M|                  if (look != end && *look == '\t') {
 5899|  8.14M|                     return false;
 5900|  8.14M|                  }
 5901|  8.14M|                  if (look == end || *look == '\n' || *look == '\r') {
 5902|  8.14M|                     if (look != end) {
 5903|  8.14M|                        yaml::skip_newline(look, end);
 5904|  8.14M|                        continue;
 5905|  8.14M|                     }
 5906|  8.14M|                     return false;
 5907|  8.14M|                  }
 5908|  8.14M|                  if (*look == '#') {
 5909|  8.14M|                     yaml::skip_comment(look, end);
 5910|  8.14M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5911|  8.14M|                        yaml::skip_newline(look, end);
 5912|  8.14M|                        continue;
 5913|  8.14M|                     }
 5914|  8.14M|                     return false;
 5915|  8.14M|                  }
 5916|       |
 5917|       |                  // If the next non-empty line is an implicit mapping entry,
 5918|       |                  // don't treat it as scalar continuation for auto-deduced
 5919|       |                  // booleans/nulls.
 5920|  8.14M|                  {
 5921|  8.14M|                     auto scan = look;
 5922|  8.14M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5923|  8.14M|                        if (*scan == ':') {
 5924|  8.14M|                           auto after_colon = scan + 1;
 5925|  8.14M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5926|  8.14M|                               *after_colon == '\n' || *after_colon == '\r') {
 5927|  8.14M|                              return false;
 5928|  8.14M|                           }
 5929|  8.14M|                        }
 5930|  8.14M|                        ++scan;
 5931|  8.14M|                     }
 5932|  8.14M|                  }
 5933|       |
 5934|  8.14M|                  return line_indent > ctx.current_indent();
 5935|  8.14M|               }
 5936|  8.14M|               return false;
 5937|  8.14M|            };
 5938|  8.14M|            auto is_word_boundary = [&](const auto ptr) {
 5939|  8.14M|               if (ptr == end) {
 5940|  8.14M|                  return true;
 5941|  8.14M|               }
 5942|  8.14M|               if (*ptr == ':') {
 5943|  8.14M|                  auto next = ptr + 1;
 5944|  8.14M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5945|  8.14M|               }
 5946|  8.14M|               return is_plain_scalar_boundary(*ptr);
 5947|  8.14M|            };
 5948|       |
 5949|  8.14M|            switch (c) {
 5950|  1.61M|            case '&': {
  ------------------
  |  Branch (5950:13): [True: 1.61M, False: 6.53M]
  ------------------
 5951|       |               // Anchor before value: parse name, then re-dispatch
 5952|  1.61M|               ++it;
 5953|  1.61M|               auto aname = yaml::parse_anchor_name(it, end);
 5954|  1.61M|               if (aname.empty()) {
  ------------------
  |  Branch (5954:20): [True: 489, False: 1.61M]
  ------------------
 5955|    489|                  ctx.error = error_code::syntax_error;
 5956|    489|                  return;
 5957|    489|               }
 5958|  1.61M|               yaml::skip_inline_ws(it, end);
 5959|  1.61M|               bool anchor_on_same_line = true;
 5960|  1.61M|               bool value_is_indentless_sequence = false;
 5961|  1.61M|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5961:20): [True: 14.0k, False: 1.59M]
  |  Branch (5961:33): [True: 68.8k, False: 1.52M]
  |  Branch (5961:48): [True: 129k, False: 1.39M]
  |  Branch (5961:63): [True: 18.9k, False: 1.37M]
  ------------------
 5962|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5963|       |                  // next line (indented past current context) or if this is an empty node.
 5964|   231k|                  bool value_on_next_line = false;
 5965|   231k|                  if (it != end) {
  ------------------
  |  Branch (5965:23): [True: 217k, False: 14.0k]
  ------------------
 5966|   217k|                     auto peek = it;
 5967|       |                     // Skip comment if present
 5968|   217k|                     if (*peek == '#') {
  ------------------
  |  Branch (5968:26): [True: 18.9k, False: 198k]
  ------------------
 5969|   171k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5969:32): [True: 170k, False: 762]
  |  Branch (5969:47): [True: 163k, False: 7.19k]
  |  Branch (5969:64): [True: 152k, False: 10.9k]
  ------------------
 5970|  18.9k|                     }
 5971|       |                     // Skip newline
 5972|   217k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5972:26): [True: 216k, False: 762]
  |  Branch (5972:42): [True: 76.0k, False: 140k]
  |  Branch (5972:59): [True: 140k, False: 0]
  ------------------
 5973|   216k|                        yaml::skip_newline(peek, end);
 5974|       |                        // Skip blank lines
 5975|   397k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5975:32): [True: 390k, False: 6.67k]
  |  Branch (5975:48): [True: 90.4k, False: 300k]
  |  Branch (5975:65): [True: 90.0k, False: 210k]
  ------------------
 5976|   180k|                           yaml::skip_newline(peek, end);
 5977|   180k|                        }
 5978|       |                        // Measure indent of next content line
 5979|   216k|                        int32_t next_indent = 0;
 5980|   422k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5980:32): [True: 412k, False: 10.1k]
  |  Branch (5980:47): [True: 205k, False: 206k]
  ------------------
 5981|   205k|                           ++next_indent;
 5982|   205k|                           ++peek;
 5983|   205k|                        }
 5984|   216k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5984:29): [True: 206k, False: 10.1k]
  |  Branch (5984:44): [True: 201k, False: 5.20k]
  |  Branch (5984:61): [True: 199k, False: 1.35k]
  ------------------
 5985|   199k|                           const bool indentless_sequence =
 5986|   199k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5986:31): [True: 196k, False: 3.01k]
  |  Branch (5986:69): [True: 52.1k, False: 144k]
  ------------------
 5987|  52.1k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5987:32): [True: 1.47k, False: 50.6k]
  ------------------
 5988|  50.6k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5988:32): [True: 49.1k, False: 1.48k]
  ------------------
 5989|  50.6k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5989:32): [True: 2.93k, False: 47.7k]
  ------------------
 5990|  47.7k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5990:33): [True: 34.7k, False: 12.9k]
  |  Branch (5990:61): [True: 33.4k, False: 1.29k]
  ------------------
 5991|   199k|                           value_is_indentless_sequence = indentless_sequence;
 5992|   199k|                           const bool same_indent_property_node =
 5993|   199k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5993:31): [True: 24.1k, False: 175k]
  ------------------
 5994|  24.1k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5994:32): [True: 786, False: 23.3k]
  |  Branch (5994:48): [True: 3.65k, False: 19.7k]
  |  Branch (5994:64): [True: 429, False: 19.3k]
  |  Branch (5994:80): [True: 934, False: 18.3k]
  |  Branch (5994:96): [True: 924, False: 17.4k]
  ------------------
 5995|  17.4k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5995:32): [True: 2.36k, False: 15.0k]
  |  Branch (5995:48): [True: 1.33k, False: 13.7k]
  |  Branch (5995:65): [True: 669, False: 13.0k]
  |  Branch (5995:81): [True: 3.12k, False: 9.94k]
  ------------------
 5996|   199k|                           value_on_next_line =
 5997|   199k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5997:31): [True: 114k, False: 85.3k]
  |  Branch (5997:71): [True: 36.3k, False: 48.9k]
  |  Branch (5997:94): [True: 14.2k, False: 34.7k]
  ------------------
 5998|   199k|                        }
 5999|   216k|                     }
 6000|   217k|                  }
 6001|   231k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (6001:23): [True: 66.2k, False: 165k]
  ------------------
 6002|       |                     // Anchor on empty/null node — store empty span, leave value as default
 6003|  66.2k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 6004|  66.2k|                     return;
 6005|  66.2k|                  }
 6006|       |                  // Value is on next line — advance past newline/blank lines to the content
 6007|   165k|                  if (*it == '#') {
  ------------------
  |  Branch (6007:23): [True: 10.2k, False: 154k]
  ------------------
 6008|   119k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (6008:29): [True: 119k, False: 0]
  |  Branch (6008:42): [True: 112k, False: 6.78k]
  |  Branch (6008:57): [True: 109k, False: 3.46k]
  ------------------
 6009|  10.2k|                  }
 6010|   165k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (6010:23): [True: 165k, False: 0]
  ------------------
 6011|   265k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6011:26): [True: 265k, False: 0]
  |  Branch (6011:40): [True: 27.5k, False: 238k]
  |  Branch (6011:55): [True: 72.9k, False: 165k]
  ------------------
 6012|   100k|                     yaml::skip_newline(it, end);
 6013|   100k|                  }
 6014|   165k|                  yaml::skip_inline_ws(it, end);
 6015|   165k|                  anchor_on_same_line = false;
 6016|   165k|               }
 6017|       |
 6018|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6019|       |                  if (anchor_on_same_line && *it == '-' &&
 6020|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 6021|       |                     // "&anchor - item" is malformed in block context.
 6022|       |                     ctx.error = error_code::syntax_error;
 6023|       |                     return;
 6024|       |                  }
 6025|       |               }
 6026|       |
 6027|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 6028|       |               // But alias-as-key (&anchor *alias : value) is valid.
 6029|  1.54M|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6029:20): [True: 1.54M, False: 19]
  |  Branch (6029:33): [True: 1.60k, False: 1.54M]
  |  Branch (6029:47): [True: 301, False: 1.30k]
  ------------------
 6030|    301|                  ctx.error = error_code::syntax_error;
 6031|    301|                  return;
 6032|    301|               }
 6033|       |
 6034|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6035|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 6036|       |                     auto probe = it + 1;
 6037|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 6038|       |                     if (nested_anchor_name.empty()) {
 6039|       |                        ctx.error = error_code::syntax_error;
 6040|       |                        return;
 6041|       |                     }
 6042|       |                     yaml::skip_inline_ws(probe, end);
 6043|       |                     // Allow nested anchor usage only when it clearly starts a
 6044|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 6045|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 6046|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 6047|       |                        ctx.error = error_code::syntax_error;
 6048|       |                        return;
 6049|       |                     }
 6050|       |                  }
 6051|       |               }
 6052|       |
 6053|  1.54M|               const char* anchor_start = &*it;
 6054|  1.54M|               const int32_t anchor_indent = ctx.current_indent();
 6055|       |
 6056|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6057|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 6058|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 6059|       |                  // next line, the anchor applies to the entire next-line content.
 6060|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 6061|       |                     auto key_start = it;
 6062|       |                     if (*key_start == '!') {
 6063|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 6064|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 6065|       |                           ctx.error = error_code::syntax_error;
 6066|       |                           return;
 6067|       |                        }
 6068|       |                        yaml::skip_inline_ws(key_start, end);
 6069|       |                        if (key_start == end) {
 6070|       |                           ctx.error = error_code::unexpected_end;
 6071|       |                           return;
 6072|       |                        }
 6073|       |                        if (*key_start == '\n' || *key_start == '\r') {
 6074|       |                           ctx.error = error_code::syntax_error;
 6075|       |                           return;
 6076|       |                        }
 6077|       |
 6078|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 6079|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 6080|       |                        // key-span registration below while the untagged spelling was rejected;
 6081|       |                        // an alias node carries no other properties either way.
 6082|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 6083|       |                           ctx.error = error_code::syntax_error;
 6084|       |                           return;
 6085|       |                        }
 6086|       |                     }
 6087|       |
 6088|       |                     // Find the key span by scanning to the key-value separator
 6089|       |                     auto key_scan = key_start;
 6090|       |                     auto key_end = key_start;
 6091|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6092|       |                        // Quoted key: skip to closing quote
 6093|       |                        const char quote = *key_scan;
 6094|       |                        ++key_scan;
 6095|       |                        while (key_scan != end && *key_scan != quote) {
 6096|       |                           if (*key_scan == '\\' && quote == '"') {
 6097|       |                              ++key_scan;
 6098|       |                              if (key_scan != end) ++key_scan;
 6099|       |                           }
 6100|       |                           else {
 6101|       |                              ++key_scan;
 6102|       |                           }
 6103|       |                        }
 6104|       |                        if (key_scan == end) {
 6105|       |                           ctx.error = error_code::syntax_error;
 6106|       |                           return;
 6107|       |                        }
 6108|       |                        ++key_scan; // past closing quote
 6109|       |                        key_end = key_scan;
 6110|       |                        yaml::skip_inline_ws(key_scan, end);
 6111|       |                     }
 6112|       |                     else {
 6113|       |                        // Plain key: scan to ':'
 6114|       |                        while (key_scan != end) {
 6115|       |                           if (*key_scan == ':') {
 6116|       |                              auto next = key_scan + 1;
 6117|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6118|       |                                 break;
 6119|       |                              }
 6120|       |                           }
 6121|       |                           ++key_scan;
 6122|       |                        }
 6123|       |                        key_end = key_scan;
 6124|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6125|       |                           --key_end;
 6126|       |                        }
 6127|       |                     }
 6128|       |                     if (key_scan == end || *key_scan != ':') {
 6129|       |                        ctx.error = error_code::syntax_error;
 6130|       |                        return;
 6131|       |                     }
 6132|       |                     // Store anchor with just the key text span
 6133|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6134|       |                     it = key_start;
 6135|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6136|       |                     if constexpr (counts::n_object > 0) {
 6137|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6138|       |                                                                                                        end);
 6139|       |                     }
 6140|       |                     else {
 6141|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6142|       |                     }
 6143|       |                     return;
 6144|       |                  }
 6145|       |               }
 6146|       |
 6147|  1.54M|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6148|  1.54M|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6149|  1.54M|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6150|  1.54M|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6151|  1.54M|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6151:20): [True: 1.50M, False: 39.5k]
  ------------------
 6152|  1.50M|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6153|  1.50M|               }
 6154|  1.54M|               return;
 6155|  1.54M|            }
 6156|   503k|            case '*': {
  ------------------
  |  Branch (6156:13): [True: 503k, False: 7.64M]
  ------------------
 6157|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6158|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6160|       |                     if constexpr (counts::n_object > 0) {
 6161|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6162|       |                                                                                                        end);
 6163|       |                        return;
 6164|       |                     }
 6165|       |                     else {
 6166|       |                        ctx.error = error_code::syntax_error;
 6167|       |                        return;
 6168|       |                     }
 6169|       |                  }
 6170|       |               }
 6171|       |
 6172|       |               // Alias value: look up anchor and replay
 6173|   503k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6174|   503k|               return;
 6175|  1.54M|            }
 6176|   569k|            case '!': {
  ------------------
  |  Branch (6176:13): [True: 569k, False: 7.57M]
  ------------------
 6177|       |               // Tag - parse it and dispatch based on tag type
 6178|   569k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6179|   569k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6179:20): [True: 128, False: 569k]
  ------------------
 6180|    128|                  ctx.error = error_code::syntax_error;
 6181|    128|                  return;
 6182|    128|               }
 6183|   569k|               yaml::skip_inline_ws(it, end);
 6184|   569k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6184:20): [True: 566k, False: 3.07k]
  |  Branch (6184:33): [True: 36.7k, False: 529k]
  ------------------
 6185|  36.7k|                  yaml::skip_comment(it, end);
 6186|  36.7k|               }
 6187|   569k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6187:20): [True: 565k, False: 4.63k]
  |  Branch (6187:34): [True: 41.1k, False: 523k]
  |  Branch (6187:49): [True: 89.8k, False: 434k]
  ------------------
 6188|   130k|                  auto content = it;
 6189|   130k|                  yaml::skip_newline(content, end);
 6190|   130k|                  yaml::skip_to_content(content, end);
 6191|       |
 6192|   130k|                  bool consume_following_content = false;
 6193|   130k|                  auto content_token = content;
 6194|   130k|                  if (content != end) {
  ------------------
  |  Branch (6194:23): [True: 120k, False: 10.7k]
  ------------------
 6195|   120k|                     auto indent_probe = content;
 6196|   120k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6197|   120k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6197:26): [True: 9, False: 120k]
  ------------------
 6198|      9|                        return;
 6199|   120k|                     content_token = indent_probe;
 6200|       |
 6201|       |                     // A tag at the end of a sequence/map entry has an empty value
 6202|       |                     // unless the next non-empty content is nested under the current node.
 6203|   120k|                     bool tagged_indentless_sequence = false;
 6204|   120k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6204:26): [True: 22.3k, False: 97.8k]
  |  Branch (6204:56): [True: 22.3k, False: 0]
  |  Branch (6204:79): [True: 20.6k, False: 1.78k]
  ------------------
 6205|  20.6k|                        const auto after_dash = indent_probe + 1;
 6206|  20.6k|                        if (after_dash == end ||
  ------------------
  |  Branch (6206:29): [True: 1.16k, False: 19.4k]
  ------------------
 6207|  19.5k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6207:29): [True: 18.4k, False: 1.01k]
  ------------------
 6208|  19.5k|                           tagged_indentless_sequence =
 6209|  19.5k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6209:31): [True: 1.16k, False: 18.4k]
  ------------------
 6210|  18.4k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6210:32): [True: 11.6k, False: 6.76k]
  |  Branch (6210:60): [True: 1.34k, False: 10.3k]
  ------------------
 6211|  19.5k|                        }
 6212|  20.6k|                     }
 6213|       |
 6214|   120k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6214:50): [True: 56.4k, False: 63.8k]
  ------------------
 6215|  63.8k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6215:50): [True: 35.5k, False: 28.2k]
  |  Branch (6215:93): [True: 2.51k, False: 25.7k]
  ------------------
 6216|   120k|                  }
 6217|       |
 6218|   130k|                  if (consume_following_content) {
  ------------------
  |  Branch (6218:23): [True: 94.4k, False: 36.5k]
  ------------------
 6219|  94.4k|                     it = content_token;
 6220|  94.4k|                  }
 6221|  36.5k|                  else {
 6222|  36.5k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6222:26): [True: 1.06k, False: 35.4k]
  ------------------
 6223|  1.06k|                        if constexpr (counts::n_str > 0) {
 6224|  1.06k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6225|  1.06k|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6226|  1.06k|                           value = StrType{};
 6227|  1.06k|                           return;
 6228|  1.06k|                        }
 6229|  1.06k|                     }
 6230|  36.5k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6230:26): [True: 969, False: 35.5k]
  ------------------
 6231|    969|                        if constexpr (counts::n_null > 0) {
 6232|    969|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6233|    969|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6234|    969|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6234:32): [True: 0, False: 969]
  ------------------
 6235|    969|                           return;
 6236|    969|                        }
 6237|    969|                     }
 6238|  36.5k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6238:26): [True: 32.1k, False: 4.33k]
  ------------------
 6239|  32.1k|                        if constexpr (counts::n_null > 0) {
 6240|  32.1k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6241|  32.1k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6242|  32.1k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6242:32): [True: 0, False: 32.1k]
  ------------------
 6243|  32.1k|                           return;
 6244|  32.1k|                        }
 6245|  32.1k|                     }
 6246|  36.5k|                  }
 6247|   130k|               }
 6248|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6249|       |                  // In block context, a comma immediately after a tag token is malformed
 6250|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6251|       |                  if (it != end && *it == ',') {
 6252|       |                     ctx.error = error_code::syntax_error;
 6253|       |                     return;
 6254|       |                  }
 6255|       |                  if constexpr (counts::n_object > 0) {
 6256|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6257|       |                     const bool starts_block_sequence_entry =
 6258|       |                        (it != end && *it == '-') &&
 6259|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6260|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6261|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6262|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6263|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6264|       |                        return;
 6265|       |                     }
 6266|       |                  }
 6267|       |               }
 6268|   569k|               if (it == end) {
  ------------------
  |  Branch (6268:20): [True: 4.63k, False: 565k]
  ------------------
 6269|  4.63k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6269:23): [True: 1.08k, False: 3.55k]
  ------------------
 6270|  1.08k|                     if constexpr (counts::n_str > 0) {
 6271|  1.08k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6272|  1.08k|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6273|  1.08k|                        value = StrType{};
 6274|  1.08k|                        return;
 6275|  1.08k|                     }
 6276|  1.08k|                  }
 6277|  4.63k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6277:23): [True: 3.53k, False: 1.09k]
  ------------------
 6278|  3.53k|                     if constexpr (counts::n_null > 0) {
 6279|  3.53k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6280|  3.53k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6281|  3.53k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6281:29): [True: 0, False: 3.53k]
  ------------------
 6282|  3.53k|                        return;
 6283|  3.53k|                     }
 6284|  3.53k|                  }
 6285|      0|                  ctx.error = error_code::unexpected_end;
 6286|  4.63k|                  return;
 6287|  4.63k|               }
 6288|   565k|               switch (tag) {
 6289|  1.41k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6289:16): [True: 1.41k, False: 563k]
  ------------------
 6290|  1.41k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6291|  1.41k|                  return;
 6292|  5.97k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6292:16): [True: 5.97k, False: 559k]
  ------------------
 6293|  12.4k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6293:16): [True: 6.46k, False: 558k]
  ------------------
 6294|  12.4k|                  if constexpr (counts::n_num > 0) {
 6295|  12.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6296|  12.4k|                     return;
 6297|       |                  }
 6298|       |                  else { // else used to fix MSVC unreachable code warning
 6299|       |                     ctx.error = error_code::syntax_error;
 6300|       |                     return;
 6301|       |                  }
 6302|  57.9k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6302:16): [True: 45.5k, False: 519k]
  ------------------
 6303|  57.9k|                  if constexpr (counts::n_bool > 0) {
 6304|  57.9k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6305|  57.9k|                     return;
 6306|       |                  }
 6307|       |                  else { // else used to fix MSVC unreachable code warning
 6308|       |                     ctx.error = error_code::syntax_error;
 6309|       |                     return;
 6310|       |                  }
 6311|  59.9k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6311:16): [True: 1.96k, False: 563k]
  ------------------
 6312|  59.9k|                  if constexpr (counts::n_null > 0) {
 6313|  59.9k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6314|  59.9k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6315|  59.9k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6315:26): [True: 0, False: 59.9k]
  ------------------
 6316|  59.9k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6317|  59.9k|                     return;
 6318|       |                  }
 6319|       |                  else { // else used to fix MSVC unreachable code warning
 6320|       |                     ctx.error = error_code::syntax_error;
 6321|       |                     return;
 6322|       |                  }
 6323|   115k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6323:16): [True: 55.7k, False: 509k]
  ------------------
 6324|   115k|                  if constexpr (counts::n_object > 0) {
 6325|   115k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6326|   115k|                                                                                                     end);
 6327|   115k|                     return;
 6328|       |                  }
 6329|       |                  else { // else used to fix MSVC unreachable code warning
 6330|       |                     ctx.error = error_code::syntax_error;
 6331|       |                     return;
 6332|       |                  }
 6333|   161k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6333:16): [True: 45.5k, False: 519k]
  ------------------
 6334|   161k|                  if constexpr (counts::n_array > 0) {
 6335|   161k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6336|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                        if (it != end && *it == '-') {
 6338|       |                           ctx.allow_indentless_sequence = true;
 6339|       |                        }
 6340|       |                     }
 6341|   161k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6342|   161k|                                                                                                    end);
 6343|   161k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6344|   161k|                     return;
 6345|       |                  }
 6346|       |                  else { // else used to fix MSVC unreachable code warning
 6347|       |                     ctx.error = error_code::syntax_error;
 6348|       |                     return;
 6349|       |                  }
 6350|   529k|               default: {
  ------------------
  |  Branch (6350:16): [True: 368k, False: 196k]
  ------------------
 6351|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6352|       |                  // Preserve collection kinds, otherwise treat as string content.
 6353|   529k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6353:23): [True: 368k, False: 161k]
  |  Branch (6353:36): [True: 208k, False: 159k]
  ------------------
 6354|   208k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6355|   208k|                     return;
 6356|   208k|                  }
 6357|       |
 6358|   320k|                  if constexpr (counts::n_array > 0) {
 6359|   320k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6359:26): [True: 159k, False: 161k]
  |  Branch (6359:39): [True: 3.19k, False: 156k]
  ------------------
 6360|  3.19k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6361|  3.19k|                                                                                                       end);
 6362|  3.19k|                        return;
 6363|  3.19k|                     }
 6364|   320k|                  }
 6365|   320k|                  if constexpr (counts::n_object > 0) {
 6366|   320k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6366:26): [True: 156k, False: 164k]
  |  Branch (6366:39): [True: 3.04k, False: 153k]
  ------------------
 6367|  3.04k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6368|  3.04k|                                                                                                        end);
 6369|  3.04k|                        return;
 6370|  3.04k|                     }
 6371|   320k|                  }
 6372|       |
 6373|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6374|       |                     if constexpr (counts::n_array > 0) {
 6375|       |                        const bool starts_block_sequence_entry =
 6376|       |                           (it != end && *it == '-') &&
 6377|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6378|       |                        if (starts_block_sequence_entry) {
 6379|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6380|       |                                                                                                          it, end);
 6381|       |                           return;
 6382|       |                        }
 6383|       |                     }
 6384|       |                     if constexpr (counts::n_object > 0) {
 6385|       |                        const bool starts_explicit_mapping_indicator =
 6386|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6387|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6388|       |                        if (starts_explicit_mapping_indicator) {
 6389|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6390|       |                                                                                                           it, end);
 6391|       |                           return;
 6392|       |                        }
 6393|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6394|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6395|       |                                                                                                           it, end);
 6396|       |                           return;
 6397|       |                        }
 6398|       |                     }
 6399|       |                  }
 6400|       |
 6401|   320k|                  if constexpr (counts::n_str > 0) {
 6402|   320k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6403|   320k|                     return;
 6404|   320k|                  }
 6405|       |
 6406|       |                  // Fall back if no string alternative exists.
 6407|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6408|   320k|                  return;
 6409|   529k|               }
 6410|   565k|               }
 6411|      0|               return;
 6412|   565k|            }
 6413|  1.23M|            case '{':
  ------------------
  |  Branch (6413:13): [True: 1.23M, False: 6.91M]
  ------------------
 6414|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6415|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6416|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6417|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6418|       |                                                                                                     end);
 6419|       |                     return;
 6420|       |                  }
 6421|       |               }
 6422|       |               // Flow mapping - object type
 6423|  1.23M|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6424|  1.23M|               return;
 6425|   106k|            case '[':
  ------------------
  |  Branch (6425:13): [True: 106k, False: 8.04M]
  ------------------
 6426|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6427|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6428|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6429|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6430|       |                                                                                                     end);
 6431|       |                     return;
 6432|       |                  }
 6433|       |               }
 6434|       |               // Flow sequence - array type
 6435|   106k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6436|   106k|               return;
 6437|   354k|            case '?':
  ------------------
  |  Branch (6437:13): [True: 354k, False: 7.79M]
  ------------------
 6438|       |               // Explicit mapping key indicator ("? key")
 6439|   354k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6439:20): [True: 353k, False: 1.07k]
  |  Branch (6439:39): [True: 13, False: 353k]
  ------------------
 6440|     13|                  ctx.error = error_code::syntax_error;
 6441|     13|                  return;
 6442|     13|               }
 6443|   354k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6443:20): [True: 353k, False: 1.07k]
  |  Branch (6443:40): [True: 116k, False: 237k]
  |  Branch (6443:56): [True: 183k, False: 54.1k]
  |  Branch (6443:73): [True: 26.1k, False: 27.9k]
  ------------------
 6444|   325k|                  if constexpr (counts::n_object > 0) {
 6445|   325k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6446|   325k|                                                                                                     end);
 6447|   325k|                     return;
 6448|   325k|                  }
 6449|   325k|               }
 6450|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6451|   354k|               return;
 6452|     55|            case '%':
  ------------------
  |  Branch (6452:13): [True: 55, False: 8.14M]
  ------------------
 6453|       |               // Reserved directive indicator is not a plain scalar start.
 6454|     55|               ctx.error = error_code::syntax_error;
 6455|     55|               return;
 6456|  22.9k|            case '"':
  ------------------
  |  Branch (6456:13): [True: 22.9k, False: 8.12M]
  ------------------
 6457|  30.5k|            case '\'':
  ------------------
  |  Branch (6457:13): [True: 7.61k, False: 8.14M]
  ------------------
 6458|       |               // Could be a quoted string OR a quoted key in a block mapping
 6459|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6460|  30.5k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6461|  30.5k|               return;
 6462|  48.3k|            case 't':
  ------------------
  |  Branch (6462:13): [True: 48.3k, False: 8.10M]
  ------------------
 6463|  76.7k|            case 'T':
  ------------------
  |  Branch (6463:13): [True: 28.4k, False: 8.12M]
  ------------------
 6464|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6465|  76.7k|               if constexpr (counts::n_bool > 0) {
 6466|  76.7k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6466:23): [True: 74.9k, False: 1.84k]
  |  Branch (6466:44): [True: 45.0k, False: 29.8k]
  |  Branch (6466:60): [True: 39.9k, False: 5.15k]
  |  Branch (6466:76): [True: 30.1k, False: 9.75k]
  ------------------
 6467|  44.7k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6467:44): [True: 6.94k, False: 37.8k]
  |  Branch (6467:60): [True: 3.54k, False: 3.39k]
  |  Branch (6467:76): [True: 2.65k, False: 893]
  ------------------
 6468|       |                     // Check what follows the word "true"
 6469|  32.8k|                     const auto after_true = it + 4;
 6470|  32.8k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6471|       |
 6472|  32.8k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6472:26): [True: 29.0k, False: 3.78k]
  ------------------
 6473|  29.0k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6473:29): [True: 0, False: 29.0k]
  ------------------
 6474|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6475|      0|                           return;
 6476|      0|                        }
 6477|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6478|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6479|  29.0k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6479:29): [True: 27.7k, False: 1.35k]
  |  Branch (6479:47): [True: 16.6k, False: 11.0k]
  ------------------
 6480|  16.6k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6480:30): [True: 1.02k, False: 15.6k]
  |  Branch (6480:47): [True: 3.83k, False: 11.8k]
  |  Branch (6480:63): [True: 4.14k, False: 7.65k]
  |  Branch (6480:80): [True: 1.16k, False: 6.49k]
  |  Branch (6480:97): [True: 6.49k, False: 0]
  ------------------
 6481|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6482|  16.6k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6483|  16.6k|                           return;
 6484|  16.6k|                        }
 6485|  12.3k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6486|  12.3k|                                                                                                      end);
 6487|  12.3k|                        return;
 6488|  29.0k|                     }
 6489|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6490|  32.8k|                  }
 6491|  76.7k|               }
 6492|  47.7k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6493|  76.7k|               return;
 6494|  65.7k|            case 'f':
  ------------------
  |  Branch (6494:13): [True: 65.7k, False: 8.08M]
  ------------------
 6495|  78.7k|            case 'F':
  ------------------
  |  Branch (6495:13): [True: 12.9k, False: 8.13M]
  ------------------
 6496|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6497|  78.7k|               if constexpr (counts::n_bool > 0) {
 6498|  78.7k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6498:23): [True: 77.5k, False: 1.18k]
  |  Branch (6498:44): [True: 48.1k, False: 29.3k]
  |  Branch (6498:60): [True: 38.7k, False: 9.40k]
  |  Branch (6498:76): [True: 34.9k, False: 3.80k]
  |  Branch (6498:92): [True: 30.8k, False: 4.05k]
  ------------------
 6499|  46.6k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6499:44): [True: 5.34k, False: 41.2k]
  |  Branch (6499:60): [True: 4.38k, False: 960]
  |  Branch (6499:76): [True: 2.90k, False: 1.47k]
  |  Branch (6499:92): [True: 1.56k, False: 1.34k]
  ------------------
 6500|       |                     // Check what follows the word "false"
 6501|  32.4k|                     const auto after_false = it + 5;
 6502|  32.4k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6503|       |
 6504|  32.4k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6504:26): [True: 26.9k, False: 5.51k]
  ------------------
 6505|  26.9k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6505:29): [True: 0, False: 26.9k]
  ------------------
 6506|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6507|      0|                           return;
 6508|      0|                        }
 6509|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6510|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6511|  26.9k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6511:29): [True: 25.7k, False: 1.23k]
  |  Branch (6511:47): [True: 17.4k, False: 8.25k]
  ------------------
 6512|  17.4k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6512:30): [True: 899, False: 16.5k]
  |  Branch (6512:47): [True: 1.84k, False: 14.7k]
  |  Branch (6512:63): [True: 9.40k, False: 5.31k]
  |  Branch (6512:80): [True: 2.76k, False: 2.54k]
  |  Branch (6512:97): [True: 2.54k, False: 0]
  ------------------
 6513|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6514|  17.4k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6515|  17.4k|                           return;
 6516|  17.4k|                        }
 6517|  9.48k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6518|  9.48k|                                                                                                      end);
 6519|  9.48k|                        return;
 6520|  26.9k|                     }
 6521|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6522|  32.4k|                  }
 6523|  78.7k|               }
 6524|  51.7k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6525|  78.7k|               return;
 6526|  33.3k|            case 'n':
  ------------------
  |  Branch (6526:13): [True: 33.3k, False: 8.11M]
  ------------------
 6527|  68.1k|            case 'N':
  ------------------
  |  Branch (6527:13): [True: 34.7k, False: 8.11M]
  ------------------
 6528|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6529|  68.1k|               if constexpr (counts::n_null > 0) {
 6530|  68.1k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6530:23): [True: 66.0k, False: 2.05k]
  |  Branch (6530:44): [True: 33.9k, False: 32.0k]
  |  Branch (6530:60): [True: 29.4k, False: 4.52k]
  |  Branch (6530:76): [True: 27.3k, False: 2.08k]
  ------------------
 6531|  38.6k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6531:44): [True: 6.86k, False: 31.8k]
  |  Branch (6531:60): [True: 5.13k, False: 1.72k]
  |  Branch (6531:76): [True: 4.18k, False: 953]
  ------------------
 6532|       |                     // Check what follows the word "null"
 6533|  31.5k|                     const auto after_null = it + 4;
 6534|  31.5k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6535|       |
 6536|  31.5k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6536:26): [True: 23.2k, False: 8.30k]
  ------------------
 6537|  23.2k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6537:29): [True: 0, False: 23.2k]
  ------------------
 6538|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6539|      0|                           return;
 6540|      0|                        }
 6541|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6542|       |                        // "null: value" should parse as {null: value}, not as the null type
 6543|  23.2k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6543:29): [True: 21.5k, False: 1.71k]
  |  Branch (6543:47): [True: 8.39k, False: 13.1k]
  ------------------
 6544|  8.39k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6544:30): [True: 1.14k, False: 7.24k]
  |  Branch (6544:47): [True: 693, False: 6.55k]
  |  Branch (6544:63): [True: 4.99k, False: 1.56k]
  |  Branch (6544:80): [True: 900, False: 660]
  |  Branch (6544:97): [True: 660, False: 0]
  ------------------
 6545|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6546|  8.39k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6547|  8.39k|                           return;
 6548|  8.39k|                        }
 6549|  14.8k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6550|  14.8k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6551|  14.8k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6551:29): [True: 0, False: 14.8k]
  ------------------
 6552|  14.8k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6553|  14.8k|                        return;
 6554|  23.2k|                     }
 6555|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6556|  31.5k|                  }
 6557|  68.1k|               }
 6558|  44.8k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6559|  68.1k|               return;
 6560|  10.5k|            case '~':
  ------------------
  |  Branch (6560:13): [True: 10.5k, False: 8.13M]
  ------------------
 6561|       |               // Null indicator
 6562|  10.5k|               if constexpr (counts::n_null > 0) {
 6563|  10.5k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6564|  10.5k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6565|  10.5k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6565:23): [True: 0, False: 10.5k]
  ------------------
 6566|  10.5k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6567|  10.5k|                  return;
 6568|  10.5k|               }
 6569|      0|               break; // Fall through to try other types
 6570|   238k|            case '-':
  ------------------
  |  Branch (6570:13): [True: 238k, False: 7.91M]
  ------------------
 6571|       |               // Could be negative number or block sequence indicator
 6572|   238k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6572:20): [True: 11.9k, False: 226k]
  |  Branch (6572:41): [True: 168k, False: 57.9k]
  ------------------
 6573|       |                  // Block sequence indicator "- "
 6574|   180k|                  if constexpr (counts::n_array > 0) {
 6575|   180k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6576|   180k|                                                                                                    end);
 6577|   180k|                     return;
 6578|   180k|                  }
 6579|   180k|               }
 6580|   238k|               if constexpr (counts::n_num > 0) {
 6581|   238k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6581:23): [True: 57.9k, False: 180k]
  |  Branch (6581:43): [True: 3.74k, False: 54.1k]
  |  Branch (6581:94): [True: 4.57k, False: 49.6k]
  ------------------
 6582|  8.32k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6583|  8.32k|                     return;
 6584|  8.32k|                  }
 6585|   238k|               }
 6586|   230k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6587|   238k|               return;
 6588|  32.2k|            case '+':
  ------------------
  |  Branch (6588:13): [True: 32.2k, False: 8.11M]
  ------------------
 6589|  82.2k|            case '.':
  ------------------
  |  Branch (6589:13): [True: 49.9k, False: 8.09M]
  ------------------
 6590|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6591|       |               // Try parsing as number speculatively, fall back to string on failure
 6592|  82.2k|               if constexpr (counts::n_num > 0) {
 6593|  82.2k|                  auto start_it = it;
 6594|  82.2k|                  auto temp_ctx = ctx.make_speculative();
 6595|  82.2k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6596|  82.2k|                                                                                               end);
 6597|  82.2k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6598|  82.2k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6599|  82.2k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6599:23): [True: 9.43k, False: 72.8k]
  ------------------
 6600|  9.43k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6601|  9.43k|                     return; // Successfully parsed as number
 6602|  9.43k|                  }
 6603|  72.8k|                  it = start_it; // Restore and fall through to string
 6604|  72.8k|               }
 6605|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6606|  82.2k|               return;
 6607|  3.18M|            default:
  ------------------
  |  Branch (6607:13): [True: 3.18M, False: 4.96M]
  ------------------
 6608|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6609|  3.18M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6609:20): [True: 2.86M, False: 314k]
  |  Branch (6609:32): [True: 2.43M, False: 430k]
  ------------------
 6610|       |                  // Try block mapping first (e.g., "123key: value")
 6611|  2.43M|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6611:23): [True: 19.1k, False: 2.41M]
  ------------------
 6612|  19.1k|                     return;
 6613|  19.1k|                  }
 6614|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6615|  2.41M|                  if constexpr (counts::n_num > 0) {
 6616|  2.41M|                     auto start_it = it;
 6617|  2.41M|                     auto temp_ctx = ctx.make_speculative();
 6618|  2.41M|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6619|  2.41M|                                                                                                  end);
 6620|  2.41M|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6621|  2.41M|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6622|  2.41M|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6622:26): [True: 2.30M, False: 109k]
  ------------------
 6623|  2.30M|                        ctx.anchors = std::move(temp_ctx.anchors);
 6624|  2.30M|                        return; // Successfully parsed as number
 6625|  2.30M|                     }
 6626|   109k|                     it = start_it; // Restore and fall through to string
 6627|   109k|                  }
 6628|       |                  // Fall through to string
 6629|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6630|  2.41M|                  return;
 6631|  2.43M|               }
 6632|       |               // Plain scalar - try block mapping, then string
 6633|   744k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6634|   744k|               return;
 6635|  8.14M|            }
 6636|  8.14M|         }
 6637|       |
 6638|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6639|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6640|       |
 6641|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6642|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6643|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6644|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6645|  8.14M|         error_code expansion_error{};
 6646|  8.14M|         std::string_view expansion_message{};
 6647|       |
 6648|  8.14M|         auto try_parse = [&]<size_t I>() -> bool {
 6649|  8.14M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6650|  8.14M|            auto start = it;
 6651|       |
 6652|  8.14M|            V v{};
 6653|  8.14M|            auto temp_ctx = ctx.make_speculative();
 6654|  8.14M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6655|  8.14M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6656|  8.14M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6657|       |
 6658|  8.14M|            if (!bool(temp_ctx.error)) {
 6659|  8.14M|               value = std::move(v);
 6660|  8.14M|               ctx.anchors = std::move(temp_ctx.anchors);
 6661|  8.14M|               return true;
 6662|  8.14M|            }
 6663|       |
 6664|  8.14M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6665|  8.14M|               expansion_error = temp_ctx.error;
 6666|  8.14M|               expansion_message = temp_ctx.custom_error_message;
 6667|  8.14M|            }
 6668|  8.14M|            it = start;
 6669|  8.14M|            return false;
 6670|  8.14M|         };
 6671|       |
 6672|  8.14M|         bool parsed = false;
 6673|  8.14M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6674|  8.14M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6675|  8.14M|         }(std::make_index_sequence<N>{});
 6676|       |
 6677|  8.14M|         if (!parsed) {
  ------------------
  |  Branch (6677:14): [True: 0, False: 8.14M]
  ------------------
 6678|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6678:17): [True: 0, False: 0]
  ------------------
 6679|      0|               ctx.error = expansion_error;
 6680|      0|               ctx.custom_error_message = expansion_message;
 6681|      0|            }
 6682|      0|            else {
 6683|      0|               ctx.error = error_code::no_matching_variant_type;
 6684|      0|            }
 6685|      0|         }
 6686|  8.14M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|   712k|      {
  301|   712k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 712k]
  |  Branch (301:27): [True: 0, False: 712k]
  ------------------
  302|       |
  303|   712k|         ++it; // skip '*'
  304|   712k|         auto name = parse_anchor_name(it, end);
  305|   712k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 271, False: 712k]
  ------------------
  306|    271|            ctx.error = error_code::syntax_error;
  307|    271|            return true;
  308|    271|         }
  309|       |
  310|   712k|         auto anchor_it = ctx.anchors.find(name);
  311|   712k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 3.03k, False: 708k]
  ------------------
  312|  3.03k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  3.03k|            return true;
  314|  3.03k|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|   708k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   708k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 121k, False: 587k]
  ------------------
  322|   121k|            return true;
  323|   121k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|   587k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 44, False: 587k]
  ------------------
  329|     44|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     44|            return true;
  331|     44|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|   587k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   587k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 587k]
  ------------------
  339|      6|            return true;
  340|       |
  341|   587k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 24, False: 587k]
  ------------------
  342|     24|            ctx.error = error_code::exceeded_max_expansion;
  343|     24|            ctx.custom_error_message = "alias expansion";
  344|     24|            return true;
  345|     24|         }
  346|       |
  347|   587k|         auto replay_it = span.begin;
  348|   587k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   587k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   587k|         ctx.indent_stack.clear();
  353|   587k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 46.2k, False: 541k]
  ------------------
  354|  46.2k|            ctx.push_indent(span.base_indent - 1);
  355|  46.2k|         }
  356|       |
  357|   587k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   587k|         using V = std::remove_cvref_t<T>;
  360|   587k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   587k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   587k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   587k|         return true;
  367|   587k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   947k|      {
 5284|   947k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   947k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   947k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   947k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   947k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 947k, False: 0]
  ------------------
 5294|   947k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   947k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1960|   970k|      {
 1961|   970k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 16.5k, False: 954k]
  ------------------
 1962|  16.5k|            return;
 1963|       |
 1964|   954k|         yaml::node_preamble_state preamble{};
 1965|   954k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 27.1k, False: 927k]
  ------------------
 1966|   954k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  27.1k|            return;
 1968|       |
 1969|   927k|         std::string str;
 1970|   927k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   927k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 927k, False: 0]
  ------------------
 1973|  16.0k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 16.0k, False: 911k]
  ------------------
 1974|  16.0k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  16.0k|            break;
 1976|  6.37k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 6.37k, False: 920k]
  ------------------
 1977|  6.37k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  6.37k|            break;
 1979|  2.42k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 2.42k, False: 924k]
  ------------------
 1980|  15.2k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 12.8k, False: 914k]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  15.2k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  15.2k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 5.61k, False: 9.62k]
  ------------------
 1986|  15.2k|            break;
 1987|   889k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 889k, False: 37.7k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|       |               if (ctx.current_indent() >= 0) {
 1992|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|       |               }
 1994|       |               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|       |               }
 1998|       |            }
 1999|   889k|            else {
 2000|   889k|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|   889k|            }
 2002|   889k|            break;
 2003|   927k|         }
 2004|       |
 2005|   927k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 917k, False: 10.0k]
  ------------------
 2006|   917k|            value = std::move(str);
 2007|   917k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   917k|         }
 2009|   927k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   954k|      {
  466|   954k|         skip_inline_ws(it, end);
  467|       |
  468|   954k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 17, False: 954k]
  ------------------
  469|     17|            if constexpr (!AllowEmptyInput) {
  470|     17|               ctx.error = error_code::unexpected_end;
  471|     17|            }
  472|     17|            return true;
  473|     17|         }
  474|       |
  475|   954k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   954k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 39, False: 954k]
  ------------------
  477|     39|            ctx.error = error_code::syntax_error;
  478|     39|            return true;
  479|     39|         }
  480|   954k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 954k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   954k|         skip_inline_ws(it, end);
  486|       |
  487|   954k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 26, False: 954k]
  ------------------
  488|     26|            if constexpr (!AllowEmptyInput) {
  489|     26|               ctx.error = error_code::unexpected_end;
  490|     26|            }
  491|     26|            return true;
  492|     26|         }
  493|       |
  494|   954k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 27.0k, False: 927k]
  ------------------
  495|  27.0k|            return true;
  496|  27.0k|         }
  497|       |
  498|   927k|         return false;
  499|   954k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1966|   954k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   954k|      {
  409|   954k|         state.has_anchor = false;
  410|   954k|         state.anchor_name.clear();
  411|   954k|         state.anchor_start = nullptr;
  412|   954k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   954k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   954k|            else {
  421|   954k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 26.9k, False: 927k]
  ------------------
  422|   954k|            }
  423|   954k|         }
  424|       |
  425|   954k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 927k, False: 26.9k]
  |  Branch (425:27): [True: 24.3k, False: 902k]
  ------------------
  426|  24.3k|            ++it;
  427|  24.3k|            auto name = parse_anchor_name(it, end);
  428|  24.3k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 38, False: 24.3k]
  ------------------
  429|     38|               ctx.error = error_code::syntax_error;
  430|     38|               return true;
  431|     38|            }
  432|  24.3k|            skip_inline_ws(it, end);
  433|  24.3k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 64, False: 24.2k]
  ------------------
  434|     64|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     64|                  ctx.error = error_code::unexpected_end;
  436|     64|               }
  437|     64|               return true;
  438|     64|            }
  439|  24.2k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  24.2k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 10, False: 24.2k]
  ------------------
  441|     10|                  ctx.error = error_code::syntax_error;
  442|     10|                  return true;
  443|     10|               }
  444|  24.2k|            }
  445|  24.2k|            state.has_anchor = true;
  446|  24.2k|            state.anchor_name = std::string(name);
  447|  24.2k|            state.anchor_start = &*it;
  448|  24.2k|         }
  449|       |
  450|   954k|         return false;
  451|   954k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   954k|      {
  301|   954k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 954k]
  |  Branch (301:27): [True: 927k, False: 26.9k]
  ------------------
  302|       |
  303|  26.9k|         ++it; // skip '*'
  304|  26.9k|         auto name = parse_anchor_name(it, end);
  305|  26.9k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 36, False: 26.9k]
  ------------------
  306|     36|            ctx.error = error_code::syntax_error;
  307|     36|            return true;
  308|     36|         }
  309|       |
  310|  26.9k|         auto anchor_it = ctx.anchors.find(name);
  311|  26.9k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 115, False: 26.8k]
  ------------------
  312|    115|            ctx.error = error_code::syntax_error; // undefined alias
  313|    115|            return true;
  314|    115|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  26.8k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  26.8k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 3.25k, False: 23.5k]
  ------------------
  322|  3.25k|            return true;
  323|  3.25k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  23.5k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 20, False: 23.5k]
  ------------------
  329|     20|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     20|            return true;
  331|     20|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  23.5k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  23.5k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 5, False: 23.5k]
  ------------------
  339|      5|            return true;
  340|       |
  341|  23.5k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 21, False: 23.5k]
  ------------------
  342|     21|            ctx.error = error_code::exceeded_max_expansion;
  343|     21|            ctx.custom_error_message = "alias expansion";
  344|     21|            return true;
  345|     21|         }
  346|       |
  347|  23.5k|         auto replay_it = span.begin;
  348|  23.5k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  23.5k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  23.5k|         ctx.indent_stack.clear();
  353|  23.5k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.63k, False: 20.8k]
  ------------------
  354|  2.63k|            ctx.push_indent(span.base_indent - 1);
  355|  2.63k|         }
  356|       |
  357|  23.5k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  23.5k|         using V = std::remove_cvref_t<T>;
  360|  23.5k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  23.5k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  23.5k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  23.5k|         return true;
  367|  23.5k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|  2.52M|      {
 5284|  2.52M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|  2.52M|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|  2.52M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|  2.52M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|  2.52M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 2.52M, False: 0]
  ------------------
 5294|  2.52M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|  2.52M|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2115|  2.52M|      {
 2116|  2.52M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 2.52M]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|  2.52M|         yaml::node_preamble_state preamble{};
 2120|  2.52M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 15.9k, False: 2.51M]
  ------------------
 2121|  2.52M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  2.52M|                   return yaml::tag_valid_for_float(tag);
 2123|  2.52M|                }
 2124|  2.52M|                else {
 2125|  2.52M|                   return yaml::tag_valid_for_int(tag);
 2126|  2.52M|                }
 2127|  2.52M|             }))
 2128|  15.9k|            return;
 2129|       |
 2130|  2.51M|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|  2.51M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|  2.51M|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|  2.51M|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 53.2k, False: 2.45M]
  ------------------
 2138|  53.2k|               ++it;
 2139|  53.2k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 48.4k, False: 4.82k]
  |  Branch (2139:38): [True: 1.89k, False: 46.5k]
  |  Branch (2139:74): [True: 2.31k, False: 44.1k]
  ------------------
 2140|  44.1k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 1.66k, False: 42.5k]
  ------------------
 2141|  5.87k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  5.87k|                  it += 3;
 2143|  5.87k|                  finalize();
 2144|  5.87k|                  return;
 2145|  5.87k|               }
 2146|  47.3k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 42.5k, False: 4.82k]
  |  Branch (2146:38): [True: 1.22k, False: 41.3k]
  |  Branch (2146:74): [True: 861, False: 40.4k]
  ------------------
 2147|  40.4k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 3.04k, False: 37.3k]
  ------------------
 2148|  5.13k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  5.13k|                  it += 3;
 2150|  5.13k|                  finalize();
 2151|  5.13k|                  return;
 2152|  5.13k|               }
 2153|  42.2k|               it = start;
 2154|  42.2k|            }
 2155|       |
 2156|  2.50M|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 9.05k, False: 2.49M]
  |  Branch (2156:31): [True: 32.3k, False: 2.45M]
  ------------------
 2157|  41.3k|               const char sign = *it;
 2158|  41.3k|               ++it;
 2159|  41.3k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 39.8k, False: 1.56k]
  |  Branch (2159:33): [True: 8.05k, False: 31.7k]
  ------------------
 2160|  8.05k|                  ++it;
 2161|  8.05k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 7.36k, False: 692]
  |  Branch (2161:41): [True: 2.65k, False: 4.70k]
  |  Branch (2161:77): [True: 952, False: 3.75k]
  ------------------
 2162|  4.86k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 1.26k, False: 2.49k]
  ------------------
 2163|  4.86k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 4.00k, False: 862]
  ------------------
 2164|  4.00k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  4.00k|                     }
 2166|    862|                     else {
 2167|    862|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|    862|                     }
 2169|  4.86k|                     it += 3;
 2170|  4.86k|                     finalize();
 2171|  4.86k|                     return;
 2172|  4.86k|                  }
 2173|  8.05k|               }
 2174|  36.5k|               it = start;
 2175|  36.5k|            }
 2176|  2.50M|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|  2.49M|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  50.8M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 50.8M, False: 25.1k]
  ------------------
 2183|  50.8M|            const char c = *it;
 2184|  50.8M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 43.5k, False: 50.7M]
  |  Branch (2184:29): [True: 19.0k, False: 50.7M]
  |  Branch (2184:42): [True: 23.2k, False: 50.7M]
  |  Branch (2184:55): [True: 6.00k, False: 50.7M]
  |  Branch (2184:68): [True: 2.34M, False: 48.3M]
  |  Branch (2184:80): [True: 3.19k, False: 48.3M]
  |  Branch (2184:92): [True: 4.37k, False: 48.3M]
  |  Branch (2184:104): [True: 28.7k, False: 48.3M]
  ------------------
 2185|  2.46M|               break;
 2186|  2.46M|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  48.3M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 894k, False: 47.4M]
  ------------------
 2189|   894k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 1.41k, False: 893k]
  |  Branch (2189:39): [True: 8.56k, False: 884k]
  |  Branch (2189:59): [True: 989, False: 883k]
  |  Branch (2189:80): [True: 1.73k, False: 881k]
  |  Branch (2189:101): [True: 4.31k, False: 877k]
  ------------------
 2190|  17.0k|                  break;
 2191|  17.0k|               }
 2192|   894k|            }
 2193|  48.3M|            ++it;
 2194|  48.3M|         }
 2195|       |
 2196|  2.51M|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|  2.51M|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 3.26k, False: 2.50M]
  ------------------
 2199|  3.26k|            ctx.error = error_code::parse_number_failure;
 2200|  3.26k|            return;
 2201|  3.26k|         }
 2202|       |
 2203|       |         // Handle hex, octal, binary
 2204|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2205|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2206|       |               int base = 10;
 2207|       |               size_t offset = 0;
 2208|       |
 2209|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2210|       |                  base = 16;
 2211|       |                  offset = 2;
 2212|       |               }
 2213|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2214|       |                  base = 8;
 2215|       |                  offset = 2;
 2216|       |               }
 2217|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2218|       |                  base = 2;
 2219|       |                  offset = 2;
 2220|       |               }
 2221|       |
 2222|       |               if (base != 10) {
 2223|       |                  const auto digits = num_str.substr(offset);
 2224|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2225|       |
 2226|       |                  std::string clean_storage;
 2227|       |                  std::string_view clean_view;
 2228|       |
 2229|       |                  if (has_underscores) {
 2230|       |                     clean_storage.reserve(digits.size());
 2231|       |                     for (char c : digits) {
 2232|       |                        if (c != '_') {
 2233|       |                           clean_storage.push_back(c);
 2234|       |                        }
 2235|       |                     }
 2236|       |                     clean_view = clean_storage;
 2237|       |                  }
 2238|       |                  else {
 2239|       |                     clean_view = digits;
 2240|       |                  }
 2241|       |
 2242|       |                  auto [ptr, ec] =
 2243|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2244|       |                  if (ec != std::errc{}) {
 2245|       |                     ctx.error = error_code::parse_number_failure;
 2246|       |                  }
 2247|       |                  finalize();
 2248|       |                  return;
 2249|       |               }
 2250|       |            }
 2251|       |         }
 2252|  2.50M|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|  2.50M|            bool negative = false;
 2254|  2.50M|            std::string_view digits = num_str;
 2255|       |
 2256|  2.50M|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 2.49M, False: 15.8k]
  |  Branch (2256:37): [True: 31.4k, False: 2.46M]
  |  Branch (2256:62): [True: 5.04k, False: 2.45M]
  ------------------
 2257|  36.5k|               negative = (digits.front() == '-');
 2258|  36.5k|               digits.remove_prefix(1);
 2259|  36.5k|            }
 2260|       |
 2261|  2.50M|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 341k, False: 2.16M]
  |  Branch (2261:38): [True: 45.5k, False: 295k]
  ------------------
 2262|  45.5k|               int base = 10;
 2263|  45.5k|               size_t offset = 0;
 2264|       |
 2265|  45.5k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 5.16k, False: 40.3k]
  |  Branch (2265:40): [True: 1.73k, False: 38.6k]
  ------------------
 2266|  6.89k|                  base = 16;
 2267|  6.89k|                  offset = 2;
 2268|  6.89k|               }
 2269|  38.6k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 2.67k, False: 35.9k]
  |  Branch (2269:45): [True: 2.72k, False: 33.1k]
  ------------------
 2270|  5.40k|                  base = 8;
 2271|  5.40k|                  offset = 2;
 2272|  5.40k|               }
 2273|  33.1k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 1.34k, False: 31.8k]
  |  Branch (2273:45): [True: 1.16k, False: 30.6k]
  ------------------
 2274|  2.50k|                  base = 2;
 2275|  2.50k|                  offset = 2;
 2276|  2.50k|               }
 2277|       |
 2278|  45.5k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 14.8k, False: 30.6k]
  ------------------
 2279|  14.8k|                  auto raw_digits = digits.substr(offset);
 2280|  14.8k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  14.8k|                  std::string clean_storage;
 2283|  14.8k|                  std::string_view clean_view;
 2284|  14.8k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 3.29k, False: 11.5k]
  ------------------
 2285|  3.29k|                     clean_storage.reserve(raw_digits.size());
 2286|  14.8M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 14.8M, False: 3.29k]
  ------------------
 2287|  14.8M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 14.8M, False: 7.88k]
  ------------------
 2288|  14.8M|                           clean_storage.push_back(c);
 2289|  14.8M|                        }
 2290|  14.8M|                     }
 2291|  3.29k|                     clean_view = clean_storage;
 2292|  3.29k|                  }
 2293|  11.5k|                  else {
 2294|  11.5k|                     clean_view = raw_digits;
 2295|  11.5k|                  }
 2296|       |
 2297|  14.8k|                  uint64_t parsed_int{};
 2298|  14.8k|                  auto [ptr, ec] =
 2299|  14.8k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  14.8k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 8.43k, False: 6.37k]
  |  Branch (2300:44): [True: 2.40k, False: 3.97k]
  ------------------
 2301|  10.8k|                     ctx.error = error_code::parse_number_failure;
 2302|  10.8k|                     finalize();
 2303|  10.8k|                     return;
 2304|  10.8k|                  }
 2305|       |
 2306|  3.97k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  3.97k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 1.70k, False: 2.26k]
  ------------------
 2308|  3.97k|                  finalize();
 2309|  3.97k|                  return;
 2310|  14.8k|               }
 2311|  45.5k|            }
 2312|  2.50M|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|  2.49M|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|  2.50M|         std::string clean_storage;
 2318|  2.50M|         std::string_view clean_view;
 2319|       |
 2320|  2.50M|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 6.20k, False: 2.50M]
  ------------------
 2321|  6.20k|            clean_storage.reserve(num_str.size());
 2322|  18.5M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 18.5M, False: 6.20k]
  ------------------
 2323|  18.5M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 18.4M, False: 27.6k]
  ------------------
 2324|  18.4M|                  clean_storage.push_back(c);
 2325|  18.4M|               }
 2326|  18.5M|            }
 2327|  6.20k|            clean_view = clean_storage;
 2328|  6.20k|         }
 2329|  2.50M|         else {
 2330|  2.50M|            clean_view = num_str;
 2331|  2.50M|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|  2.50M|         auto parse_view = clean_view;
 2336|  2.50M|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 2.47M, False: 30.9k]
  |  Branch (2336:37): [True: 31.4k, False: 2.44M]
  ------------------
 2337|  31.4k|            parse_view.remove_prefix(1);
 2338|  31.4k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 18.3k, False: 13.1k]
  ------------------
 2339|  18.3k|               ctx.error = error_code::parse_number_failure;
 2340|  18.3k|               return;
 2341|  18.3k|            }
 2342|  31.4k|         }
 2343|       |
 2344|  2.49M|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|  2.49M|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2346|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2347|  2.49M|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 85.1k, False: 2.40M]
  |  Branch (2347:45): [True: 88.0k, False: 2.31M]
  ------------------
 2348|   142k|               ctx.error = error_code::parse_number_failure;
 2349|   142k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|  2.49M|         finalize();
 2360|  2.49M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERdNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EdE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  2.52M|      {
  466|  2.52M|         skip_inline_ws(it, end);
  467|       |
  468|  2.52M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 650, False: 2.52M]
  ------------------
  469|    650|            if constexpr (!AllowEmptyInput) {
  470|    650|               ctx.error = error_code::unexpected_end;
  471|    650|            }
  472|    650|            return true;
  473|    650|         }
  474|       |
  475|  2.52M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  2.52M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 488, False: 2.52M]
  ------------------
  477|    488|            ctx.error = error_code::syntax_error;
  478|    488|            return true;
  479|    488|         }
  480|  2.52M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 407, False: 2.52M]
  ------------------
  481|    407|            ctx.error = error_code::syntax_error;
  482|    407|            return true;
  483|    407|         }
  484|       |
  485|  2.52M|         skip_inline_ws(it, end);
  486|       |
  487|  2.52M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 453, False: 2.52M]
  ------------------
  488|    453|            if constexpr (!AllowEmptyInput) {
  489|    453|               ctx.error = error_code::unexpected_end;
  490|    453|            }
  491|    453|            return true;
  492|    453|         }
  493|       |
  494|  2.52M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 13.9k, False: 2.51M]
  ------------------
  495|  13.9k|            return true;
  496|  13.9k|         }
  497|       |
  498|  2.51M|         return false;
  499|  2.52M|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2120|  2.52M|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|  2.52M|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|  2.52M|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|  2.52M|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  2.52M|      {
  409|  2.52M|         state.has_anchor = false;
  410|  2.52M|         state.anchor_name.clear();
  411|  2.52M|         state.anchor_start = nullptr;
  412|  2.52M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  2.52M|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  2.52M|            else {
  421|  2.52M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 12.5k, False: 2.51M]
  ------------------
  422|  2.52M|            }
  423|  2.52M|         }
  424|       |
  425|  2.52M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 2.51M, False: 12.5k]
  |  Branch (425:27): [True: 10.4k, False: 2.50M]
  ------------------
  426|  10.4k|            ++it;
  427|  10.4k|            auto name = parse_anchor_name(it, end);
  428|  10.4k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 721, False: 9.73k]
  ------------------
  429|    721|               ctx.error = error_code::syntax_error;
  430|    721|               return true;
  431|    721|            }
  432|  9.73k|            skip_inline_ws(it, end);
  433|  9.73k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 615, False: 9.11k]
  ------------------
  434|    615|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    615|                  ctx.error = error_code::unexpected_end;
  436|    615|               }
  437|    615|               return true;
  438|    615|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  9.11k|            state.has_anchor = true;
  446|  9.11k|            state.anchor_name = std::string(name);
  447|  9.11k|            state.anchor_start = &*it;
  448|  9.11k|         }
  449|       |
  450|  2.52M|         return false;
  451|  2.52M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  2.52M|      {
  301|  2.52M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 2.52M]
  |  Branch (301:27): [True: 2.51M, False: 12.5k]
  ------------------
  302|       |
  303|  12.5k|         ++it; // skip '*'
  304|  12.5k|         auto name = parse_anchor_name(it, end);
  305|  12.5k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 747, False: 11.8k]
  ------------------
  306|    747|            ctx.error = error_code::syntax_error;
  307|    747|            return true;
  308|    747|         }
  309|       |
  310|  11.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  11.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 2.84k, False: 8.97k]
  ------------------
  312|  2.84k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  2.84k|            return true;
  314|  2.84k|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  8.97k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  8.97k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.92k, False: 7.05k]
  ------------------
  322|  1.92k|            return true;
  323|  1.92k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  7.05k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 279, False: 6.77k]
  ------------------
  329|    279|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    279|            return true;
  331|    279|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  6.77k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  6.77k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 6.77k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  6.77k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 3, False: 6.77k]
  ------------------
  342|      3|            ctx.error = error_code::exceeded_max_expansion;
  343|      3|            ctx.custom_error_message = "alias expansion";
  344|      3|            return true;
  345|      3|         }
  346|       |
  347|  6.77k|         auto replay_it = span.begin;
  348|  6.77k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  6.77k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  6.77k|         ctx.indent_stack.clear();
  353|  6.77k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.78k, False: 4.98k]
  ------------------
  354|  1.78k|            ctx.push_indent(span.base_indent - 1);
  355|  1.78k|         }
  356|       |
  357|  6.77k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  6.77k|         using V = std::remove_cvref_t<T>;
  360|  6.77k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  6.77k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  6.77k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  6.77k|         return true;
  367|  6.77k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|  2.49M|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|  67.3k|      {
 5284|  67.3k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|  67.3k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|  67.3k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|  67.3k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|  67.3k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 67.3k, False: 0]
  ------------------
 5294|  67.3k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|  67.3k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2080|  81.8k|      {
 2081|  81.8k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 81.8k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  81.8k|         yaml::node_preamble_state preamble{};
 2085|  81.8k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 16.9k, False: 64.9k]
  ------------------
 2086|  81.8k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  16.9k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  64.9k|         std::string str;
 2091|  64.9k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  64.9k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 7.99k, False: 56.9k]
  |  Branch (2093:31): [True: 1.85k, False: 55.1k]
  |  Branch (2093:48): [True: 2.51k, False: 52.6k]
  |  Branch (2093:65): [True: 876, False: 51.7k]
  |  Branch (2093:81): [True: 2.38k, False: 49.3k]
  |  Branch (2093:97): [True: 941, False: 48.4k]
  ------------------
 2094|  48.4k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 2.44k, False: 45.9k]
  |  Branch (2094:29): [True: 1.96k, False: 44.0k]
  |  Branch (2094:44): [True: 924, False: 43.0k]
  ------------------
 2095|  21.8k|            value = true;
 2096|  21.8k|         }
 2097|  43.0k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 14.2k, False: 28.8k]
  |  Branch (2097:37): [True: 2.51k, False: 26.3k]
  |  Branch (2097:55): [True: 1.60k, False: 24.7k]
  |  Branch (2097:73): [True: 831, False: 23.9k]
  |  Branch (2097:88): [True: 19.7k, False: 4.17k]
  |  Branch (2097:103): [True: 1.13k, False: 3.03k]
  ------------------
 2098|  42.5k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 833, False: 2.20k]
  |  Branch (2098:35): [True: 521, False: 1.68k]
  |  Branch (2098:51): [True: 1.20k, False: 477]
  ------------------
 2099|  42.5k|            value = false;
 2100|  42.5k|         }
 2101|    477|         else {
 2102|    477|            ctx.error = error_code::expected_true_or_false;
 2103|    477|         }
 2104|       |
 2105|  64.9k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  64.9k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj1EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  81.8k|      {
  466|  81.8k|         skip_inline_ws(it, end);
  467|       |
  468|  81.8k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 11, False: 81.8k]
  ------------------
  469|     11|            if constexpr (!AllowEmptyInput) {
  470|     11|               ctx.error = error_code::unexpected_end;
  471|     11|            }
  472|     11|            return true;
  473|     11|         }
  474|       |
  475|  81.8k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  81.8k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 21, False: 81.8k]
  ------------------
  477|     21|            ctx.error = error_code::syntax_error;
  478|     21|            return true;
  479|     21|         }
  480|  81.8k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 81.8k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  81.8k|         skip_inline_ws(it, end);
  486|       |
  487|  81.8k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 9, False: 81.8k]
  ------------------
  488|      9|            if constexpr (!AllowEmptyInput) {
  489|      9|               ctx.error = error_code::unexpected_end;
  490|      9|            }
  491|      9|            return true;
  492|      9|         }
  493|       |
  494|  81.8k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 16.8k, False: 64.9k]
  ------------------
  495|  16.8k|            return true;
  496|  16.8k|         }
  497|       |
  498|  64.9k|         return false;
  499|  81.8k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2086|  81.8k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERbNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  81.8k|      {
  409|  81.8k|         state.has_anchor = false;
  410|  81.8k|         state.anchor_name.clear();
  411|  81.8k|         state.anchor_start = nullptr;
  412|  81.8k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  81.8k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  81.8k|            else {
  421|  81.8k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 16.8k, False: 65.0k]
  ------------------
  422|  81.8k|            }
  423|  81.8k|         }
  424|       |
  425|  81.8k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 65.0k, False: 16.8k]
  |  Branch (425:27): [True: 10.3k, False: 54.7k]
  ------------------
  426|  10.3k|            ++it;
  427|  10.3k|            auto name = parse_anchor_name(it, end);
  428|  10.3k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 21, False: 10.2k]
  ------------------
  429|     21|               ctx.error = error_code::syntax_error;
  430|     21|               return true;
  431|     21|            }
  432|  10.2k|            skip_inline_ws(it, end);
  433|  10.2k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 31, False: 10.2k]
  ------------------
  434|     31|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     31|                  ctx.error = error_code::unexpected_end;
  436|     31|               }
  437|     31|               return true;
  438|     31|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  10.2k|            state.has_anchor = true;
  446|  10.2k|            state.anchor_name = std::string(name);
  447|  10.2k|            state.anchor_start = &*it;
  448|  10.2k|         }
  449|       |
  450|  81.7k|         return false;
  451|  81.8k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  81.8k|      {
  301|  81.8k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 81.8k]
  |  Branch (301:27): [True: 65.0k, False: 16.8k]
  ------------------
  302|       |
  303|  16.8k|         ++it; // skip '*'
  304|  16.8k|         auto name = parse_anchor_name(it, end);
  305|  16.8k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 29, False: 16.7k]
  ------------------
  306|     29|            ctx.error = error_code::syntax_error;
  307|     29|            return true;
  308|     29|         }
  309|       |
  310|  16.7k|         auto anchor_it = ctx.anchors.find(name);
  311|  16.7k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 102, False: 16.6k]
  ------------------
  312|    102|            ctx.error = error_code::syntax_error; // undefined alias
  313|    102|            return true;
  314|    102|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  16.6k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  16.6k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.16k, False: 14.5k]
  ------------------
  322|  2.16k|            return true;
  323|  2.16k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  14.5k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 13, False: 14.5k]
  ------------------
  329|     13|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     13|            return true;
  331|     13|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  14.5k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  14.5k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 14.4k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  14.4k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 14.4k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  14.4k|         auto replay_it = span.begin;
  348|  14.4k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  14.4k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  14.4k|         ctx.indent_stack.clear();
  353|  14.4k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 4.85k, False: 9.64k]
  ------------------
  354|  4.85k|            ctx.push_indent(span.base_indent - 1);
  355|  4.85k|         }
  356|       |
  357|  14.4k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  14.4k|         using V = std::remove_cvref_t<T>;
  360|  14.4k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  14.4k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  14.4k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  14.4k|         return true;
  367|  14.4k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2466|  27.3k|      {
 2467|  27.3k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 27.3k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  27.3k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  27.3k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 10, False: 27.3k]
  ------------------
 2473|     10|            ctx.error = error_code::unexpected_end;
 2474|     10|            return;
 2475|     10|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  27.3k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 10.5k, False: 16.8k]
  ------------------
 2479|  10.5k|            ++it;
 2480|  10.5k|            return;
 2481|  10.5k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  16.8k|         auto start = it;
 2485|  76.9k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 75.2k, False: 1.72k]
  |  Branch (2485:30): [True: 60.1k, False: 15.0k]
  ------------------
 2486|  60.1k|            ++it;
 2487|  60.1k|         }
 2488|       |
 2489|  16.8k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  16.8k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 82, False: 16.7k]
  ------------------
 2491|     82|            ctx.error = error_code::syntax_error;
 2492|     82|         }
 2493|  16.8k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_22is_yaml_variant_objectEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|  2.08M|      {
 5284|  2.08M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|  2.08M|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|  2.08M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|  2.08M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|  2.08M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 2.08M, False: 0]
  ------------------
 5294|  2.08M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|  2.08M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4593|  2.11M|      {
 4594|  2.11M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4594:14): [True: 0, False: 2.11M]
  ------------------
 4595|      0|            return;
 4596|       |
 4597|  2.11M|         yaml::node_preamble_state preamble{};
 4598|  2.11M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4598:14): [True: 38.9k, False: 2.08M]
  ------------------
 4599|  2.11M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4600|  38.9k|            return;
 4601|       |
 4602|  2.08M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4603|  2.08M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4604|       |
 4605|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4606|       |         // value of a key that existed before the read and adds new keys, while
 4607|       |         // pre-existing keys the document does not mention are preserved (like a
 4608|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4609|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4610|       |         // mappings disallow duplicate keys and the conformance suite expects
 4611|       |         // first-wins, which falls out of emplace into an empty map. Any
 4612|       |         // pre-existing entry the document leaves untouched is restored on scope
 4613|       |         // exit (including error paths). When the target starts empty (the common
 4614|       |         // case) this is a no-op with negligible cost.
 4615|  2.08M|         std::remove_cvref_t<T> preexisting_entries;
 4616|  2.08M|         if (!value.empty()) {
  ------------------
  |  Branch (4616:14): [True: 0, False: 2.08M]
  ------------------
 4617|      0|            preexisting_entries = std::move(value);
 4618|      0|            value.clear();
 4619|      0|         }
 4620|  2.08M|         struct merge_restore_guard
 4621|  2.08M|         {
 4622|  2.08M|            std::remove_cvref_t<T>& target;
 4623|  2.08M|            std::remove_cvref_t<T>& saved;
 4624|  2.08M|            ~merge_restore_guard()
 4625|  2.08M|            {
 4626|       |               // emplace is a no-op for keys the document already wrote, so only
 4627|       |               // untouched pre-existing entries are put back.
 4628|  2.08M|               for (auto& entry : saved) {
 4629|  2.08M|                  target.emplace(entry.first, std::move(entry.second));
 4630|  2.08M|               }
 4631|  2.08M|            }
 4632|  2.08M|         } merge_restore{value, preexisting_entries};
 4633|       |
 4634|  2.08M|         const bool treat_as_block_mapping =
 4635|  2.08M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4635:13): [Folded, False: 2.08M]
  |  Branch (4635:48): [True: 0, False: 0]
  |  Branch (4635:62): [True: 0, False: 0]
  ------------------
 4636|       |
 4637|  2.08M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4637:14): [True: 1.26M, False: 818k]
  |  Branch (4637:28): [True: 0, Folded]
  ------------------
 4638|       |            // Flow mapping
 4639|  1.26M|            ++it;
 4640|       |            // Skip whitespace and newlines after opening brace
 4641|  1.26M|            yaml::skip_ws_and_newlines(it, end);
 4642|       |
 4643|  1.26M|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4643:17): [True: 1.25M, False: 1.85k]
  |  Branch (4643:30): [True: 24.1k, False: 1.23M]
  ------------------
 4644|  24.1k|               ++it;
 4645|  24.1k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4646|  24.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4646:20): [True: 24, False: 24.1k]
  ------------------
 4647|     24|                  return;
 4648|  24.1k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4649|  24.1k|               return;
 4650|  24.1k|            }
 4651|       |
 4652|  4.14M|            while (it != end) {
  ------------------
  |  Branch (4652:20): [True: 4.13M, False: 7.00k]
  ------------------
 4653|       |               // Skip whitespace and newlines at start of each iteration
 4654|  4.13M|               yaml::skip_ws_and_newlines(it, end);
 4655|       |
 4656|  4.13M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4656:20): [True: 4.13M, False: 0]
  |  Branch (4656:33): [True: 32.1k, False: 4.10M]
  ------------------
 4657|  32.1k|                  ++it;
 4658|  32.1k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4659|  32.1k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4659:23): [True: 46, False: 32.1k]
  ------------------
 4660|     46|                     return;
 4661|  32.1k|                  break;
 4662|  32.1k|               }
 4663|       |
 4664|  4.10M|               bool explicit_flow_key = false;
 4665|  4.10M|               auto explicit_probe = it;
 4666|  4.10M|               yaml::skip_inline_ws(explicit_probe, end);
 4667|  4.10M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4667:20): [True: 4.10M, False: 0]
  |  Branch (4667:45): [True: 49.7k, False: 4.05M]
  ------------------
 4668|  49.7k|                  const auto after_q = explicit_probe + 1;
 4669|  49.7k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4669:23): [True: 12, False: 49.6k]
  |  Branch (4669:41): [True: 28.3k, False: 21.3k]
  ------------------
 4670|  33.4k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4670:23): [True: 3.49k, False: 17.8k]
  |  Branch (4670:42): [True: 1.59k, False: 16.2k]
  ------------------
 4671|  33.4k|                     explicit_flow_key = true;
 4672|  33.4k|                     it = explicit_probe + 1;
 4673|  33.4k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4674|  33.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4674:26): [True: 11, False: 33.4k]
  ------------------
 4675|     11|                        return;
 4676|  33.4k|                  }
 4677|  49.7k|               }
 4678|       |               // Parse key
 4679|  4.10M|               key_t key{};
 4680|  4.10M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4681|  4.10M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4681:23): [True: 33.4k, False: 4.07M]
  |  Branch (4681:44): [True: 33.4k, False: 19]
  |  Branch (4681:58): [True: 6.43k, False: 26.9k]
  |  Branch (4681:72): [True: 5.80k, False: 21.1k]
  |  Branch (4681:86): [True: 2.42k, False: 18.7k]
  ------------------
 4682|  14.6k|                     key.clear();
 4683|  14.6k|                  }
 4684|  4.08M|                  else {
 4685|  4.08M|                     auto key_probe = it;
 4686|  4.08M|                     yaml::skip_inline_ws(key_probe, end);
 4687|       |
 4688|       |                     // Use full node parsing only for structurally complex flow keys.
 4689|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4690|  4.08M|                     bool parse_complex_flow_key = false;
 4691|  4.08M|                     if (key_probe != end) {
  ------------------
  |  Branch (4691:26): [True: 4.08M, False: 19]
  ------------------
 4692|  4.08M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4692:29): [True: 9.08k, False: 4.08M]
  |  Branch (4692:50): [True: 86.4k, False: 3.99M]
  ------------------
 4693|  95.5k|                           parse_complex_flow_key = true;
 4694|  95.5k|                        }
 4695|  3.99M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4695:34): [True: 1.11M, False: 2.88M]
  ------------------
 4696|  1.11M|                           ++key_probe;
 4697|  1.11M|                           yaml::parse_anchor_name(key_probe, end);
 4698|  1.11M|                           yaml::skip_inline_ws(key_probe, end);
 4699|  1.11M|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4699:32): [True: 1.11M, False: 158]
  |  Branch (4699:53): [True: 8.14k, False: 1.10M]
  |  Branch (4699:74): [True: 599k, False: 503k]
  ------------------
 4700|   607k|                              parse_complex_flow_key = true;
 4701|   607k|                           }
 4702|  1.11M|                        }
 4703|  4.08M|                     }
 4704|       |
 4705|  4.08M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4705:26): [True: 703k, False: 3.38M]
  ------------------
 4706|   703k|                        glz::generic key_node{};
 4707|   703k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4708|   703k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4708:29): [True: 33.9k, False: 669k]
  ------------------
 4709|  33.9k|                           return;
 4710|   669k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4710:29): [True: 75, False: 669k]
  ------------------
 4711|     75|                           return;
 4712|   669k|                     }
 4713|  3.38M|                     else {
 4714|  3.38M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4714:29): [True: 17.5k, False: 3.36M]
  ------------------
 4715|  17.5k|                           return;
 4716|  17.5k|                        }
 4717|  3.38M|                     }
 4718|  4.08M|                  }
 4719|       |               }
 4720|       |               else {
 4721|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4722|       |                     ctx.error = error_code::syntax_error;
 4723|       |                     return;
 4724|       |                  }
 4725|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4726|       |                  if (bool(ctx.error)) [[unlikely]]
 4727|       |                     return;
 4728|       |               }
 4729|       |
 4730|       |               // Separation between flow key and ':' may include comments/newlines.
 4731|       |               // In flow context, newlines are allowed between key and ':'.
 4732|  4.05M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4733|  4.10M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4733:20): [True: 34, False: 4.10M]
  ------------------
 4734|     34|                  return;
 4735|       |
 4736|  4.10M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4737|  4.10M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4738|  4.10M|                     val = {};
 4739|  4.10M|                     return true;
 4740|  4.10M|                  }
 4741|  4.10M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4742|  4.10M|                     val = glz::generic{};
 4743|  4.10M|                     return true;
 4744|  4.10M|                  }
 4745|  4.10M|                  else {
 4746|  4.10M|                     static constexpr std::string_view null_value{"null"};
 4747|  4.10M|                     auto null_it = null_value.data();
 4748|  4.10M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4749|  4.10M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4750|  4.10M|                     return !bool(ctx.error);
 4751|  4.10M|                  }
 4752|  4.10M|               };
 4753|       |
 4754|  4.10M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4754:20): [True: 4.05M, False: 53.1k]
  |  Branch (4754:34): [True: 1.55M, False: 2.49M]
  |  Branch (4754:48): [True: 426k, False: 2.07M]
  ------------------
 4755|  1.97M|                  val_t val{};
 4756|  1.97M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4756:23): [True: 0, False: 1.97M]
  ------------------
 4757|      0|                     return;
 4758|       |
 4759|  1.97M|                  value.emplace(std::move(key), std::move(val));
 4760|       |
 4761|  1.97M|                  if (*it == '}') {
  ------------------
  |  Branch (4761:23): [True: 426k, False: 1.55M]
  ------------------
 4762|   426k|                     ++it;
 4763|   426k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4764|   426k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4764:26): [True: 557, False: 426k]
  ------------------
 4765|    557|                        return;
 4766|   426k|                     break;
 4767|   426k|                  }
 4768|       |
 4769|  1.55M|                  ++it; // skip comma
 4770|  1.55M|                  yaml::skip_ws_and_newlines(it, end);
 4771|  1.55M|                  continue;
 4772|  1.97M|               }
 4773|       |
 4774|  2.12M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4774:20): [True: 53.1k, False: 2.07M]
  |  Branch (4774:33): [True: 2.47k, False: 2.07M]
  ------------------
 4775|  4.12k|                  ctx.error = error_code::syntax_error;
 4776|  4.12k|                  return;
 4777|  4.12k|               }
 4778|  2.12M|               ++it;
 4779|       |
 4780|  2.12M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4781|  2.12M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4781:20): [True: 21, False: 2.12M]
  ------------------
 4782|     21|                  return;
 4783|       |
 4784|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4785|  2.12M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4785:20): [True: 2.07M, False: 51.6k]
  |  Branch (4785:34): [True: 72.7k, False: 1.99M]
  |  Branch (4785:48): [True: 24.4k, False: 1.97M]
  ------------------
 4786|  97.1k|                  val_t val{};
 4787|  97.1k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4787:23): [True: 0, False: 97.1k]
  ------------------
 4788|      0|                     return;
 4789|       |
 4790|  97.1k|                  value.emplace(std::move(key), std::move(val));
 4791|       |
 4792|  97.1k|                  if (*it == '}') {
  ------------------
  |  Branch (4792:23): [True: 24.4k, False: 72.7k]
  ------------------
 4793|  24.4k|                     ++it;
 4794|  24.4k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4795|  24.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4795:26): [True: 29, False: 24.4k]
  ------------------
 4796|     29|                        return;
 4797|  24.4k|                     break;
 4798|  24.4k|                  }
 4799|       |
 4800|  72.7k|                  ++it; // skip comma
 4801|  72.7k|                  yaml::skip_ws_and_newlines(it, end);
 4802|  72.7k|                  continue;
 4803|  97.1k|               }
 4804|       |
 4805|       |               // Parse value
 4806|  2.02M|               val_t val{};
 4807|  2.02M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4808|  2.02M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4808:20): [True: 10.2k, False: 2.01M]
  ------------------
 4809|  10.2k|                  return;
 4810|       |
 4811|  2.01M|               value.emplace(std::move(key), std::move(val));
 4812|       |
 4813|  2.01M|               yaml::skip_inline_ws(it, end);
 4814|       |
 4815|  2.01M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4815:20): [True: 1.96M, False: 52.1k]
  |  Branch (4815:33): [True: 670k, False: 1.29M]
  ------------------
 4816|   670k|                  ++it;
 4817|   670k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4818|   670k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4818:23): [True: 635, False: 669k]
  ------------------
 4819|    635|                     return;
 4820|   669k|                  break;
 4821|   670k|               }
 4822|  1.34M|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4822:25): [True: 1.29M, False: 52.1k]
  |  Branch (4822:38): [True: 1.22M, False: 64.2k]
  ------------------
 4823|  1.22M|                  ++it;
 4824|       |                  // Skip whitespace and newlines after comma
 4825|  1.22M|                  yaml::skip_ws_and_newlines(it, end);
 4826|  1.22M|               }
 4827|   116k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4827:25): [True: 64.2k, False: 52.1k]
  |  Branch (4827:39): [True: 28.5k, False: 35.6k]
  |  Branch (4827:54): [True: 34.6k, False: 985]
  ------------------
 4828|       |                  // Newlines may precede either the closing brace or the
 4829|       |                  // separator comma for the next entry.
 4830|  63.2k|                  yaml::skip_ws_and_newlines(it, end);
 4831|  63.2k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4831:23): [True: 63.1k, False: 52]
  |  Branch (4831:36): [True: 8.45k, False: 54.7k]
  ------------------
 4832|  8.45k|                     ++it;
 4833|  8.45k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4834|  8.45k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4834:26): [True: 8, False: 8.44k]
  ------------------
 4835|      8|                        return;
 4836|  8.44k|                     break;
 4837|  8.45k|                  }
 4838|  54.7k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4838:23): [True: 54.7k, False: 52]
  |  Branch (4838:36): [True: 54.4k, False: 297]
  ------------------
 4839|  54.4k|                     ++it;
 4840|  54.4k|                     yaml::skip_ws_and_newlines(it, end);
 4841|  54.4k|                     continue;
 4842|  54.4k|                  }
 4843|    349|                  ctx.error = error_code::syntax_error;
 4844|    349|                  return;
 4845|  54.7k|               }
 4846|  53.1k|               else {
 4847|  53.1k|                  ctx.error = error_code::syntax_error;
 4848|  53.1k|                  return;
 4849|  53.1k|               }
 4850|  2.01M|            }
 4851|  1.23M|         }
 4852|   818k|         else {
 4853|       |            // Block mapping - use shared loop with map-specific callback
 4854|   818k|            yaml::parse_block_mapping_loop<Opts>(
 4855|   818k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4856|   818k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|   818k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4858|   818k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   818k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   818k|                           if (ctx.stream_begin) {
 4866|   818k|                              auto is_line_content_start = [&](auto pos) {
 4867|   818k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   818k|                              };
 4869|       |
 4870|   818k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   818k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   818k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   818k|                                 return line != end && *line == ':';
 4874|   818k|                              };
 4875|       |
 4876|   818k|                              if (!is_line_content_start(it) &&
 4877|   818k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4878|   818k|                                  !line_has_explicit_value_indicator(it)) {
 4879|   818k|                                 ctx.error = error_code::syntax_error;
 4880|   818k|                                 return false;
 4881|   818k|                              }
 4882|   818k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   818k|                           }
 4884|   818k|                        }
 4885|       |
 4886|   818k|                        if (*it == '-' &&
 4887|   818k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4888|   818k|                            !line_starts_with_explicit_value_indicator) {
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|   818k|                           ctx.error = error_code::syntax_error;
 4891|   818k|                           return false;
 4892|   818k|                        }
 4893|       |
 4894|   818k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4895|   818k|                           return false;
 4896|   818k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   818k|                        ctx.pop_indent();
 4898|   818k|                     }
 4899|   818k|                     else {
 4900|   818k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|   818k|                        if (nested_indent >= 0) {
 4902|   818k|                           yaml::skip_to_content(it, end);
 4903|   818k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4904|   818k|                              ctx.error = error_code::syntax_error;
 4905|   818k|                              return false;
 4906|   818k|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|   818k|                           const int32_t value_indent =
 4910|   818k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4911|   818k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4912|   818k|                              return false;
 4913|   818k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|   818k|                           ctx.pop_indent();
 4915|   818k|                        }
 4916|   818k|                     }
 4917|   818k|                     return !bool(ctx.error);
 4918|   818k|                  };
 4919|       |
 4920|       |                  // Explicit key entry form:
 4921|       |                  // ? key
 4922|       |                  // : value
 4923|   818k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4924|   818k|                     ctx.error = error_code::syntax_error;
 4925|   818k|                     return false;
 4926|   818k|                  }
 4927|   818k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4928|   818k|                     ++it; // skip '?'
 4929|   818k|                     yaml::skip_inline_ws(it, end);
 4930|       |
 4931|   818k|                     const int32_t explicit_value_indicator_indent =
 4932|   818k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4933|       |
 4934|   818k|                     key_t key{};
 4935|   818k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4936|   818k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   818k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   818k|                        };
 4939|       |
 4940|   818k|                        auto key_it = it;
 4941|   818k|                        yaml::skip_inline_ws(key_it, end);
 4942|       |
 4943|   818k|                        auto content = key_it;
 4944|   818k|                        yaml::skip_to_content(content, end);
 4945|   818k|                        bool handled_anchor_only_empty_key = false;
 4946|       |
 4947|       |                        // Anchor on an empty explicit key node:
 4948|       |                        //   ? &a
 4949|       |                        //   : value
 4950|   818k|                        if (content != end && *content == '&') {
 4951|   818k|                           auto anchor_probe = content + 1;
 4952|   818k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4953|   818k|                           if (!anchor_name.empty()) {
 4954|   818k|                              auto after_anchor = anchor_probe;
 4955|   818k|                              yaml::skip_inline_ws(after_anchor, end);
 4956|       |
 4957|   818k|                              auto value_indicator = after_anchor;
 4958|   818k|                              if (value_indicator != end && *value_indicator == ':') {
 4959|   818k|                                 key.clear();
 4960|   818k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4961|   818k|                                 it = value_indicator;
 4962|   818k|                                 handled_anchor_only_empty_key = true;
 4963|   818k|                              }
 4964|   818k|                              else {
 4965|   818k|                                 if (value_indicator != end && *value_indicator == '#') {
 4966|   818k|                                    yaml::skip_comment(value_indicator, end);
 4967|   818k|                                 }
 4968|   818k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4969|   818k|                                    yaml::skip_newline(value_indicator, end);
 4970|   818k|                                    auto value_line = value_indicator;
 4971|   818k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4972|   818k|                                    if (bool(ctx.error)) [[unlikely]]
 4973|   818k|                                       return false;
 4974|   818k|                                    if (value_line != end && *value_line == ':' &&
 4975|   818k|                                        value_indent == explicit_value_indicator_indent) {
 4976|   818k|                                       key.clear();
 4977|   818k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4978|   818k|                                       it = value_line;
 4979|   818k|                                       handled_anchor_only_empty_key = true;
 4980|   818k|                                    }
 4981|   818k|                                    else if (value_line != end && *value_line == ':') {
 4982|       |                                       // In explicit-key form ("? &a"), a following ':'
 4983|       |                                       // starts the outer value indicator only at the same
 4984|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4985|   818k|                                       ctx.error = error_code::syntax_error;
 4986|   818k|                                       return false;
 4987|   818k|                                    }
 4988|   818k|                                 }
 4989|   818k|                              }
 4990|   818k|                           }
 4991|   818k|                        }
 4992|       |
 4993|   818k|                        const bool key_content_spans_lines = [&] {
 4994|   818k|                           auto scan = key_it;
 4995|   818k|                           while (scan != content && scan != end) {
 4996|   818k|                              if (*scan == '\n' || *scan == '\r') return true;
 4997|   818k|                              ++scan;
 4998|   818k|                           }
 4999|   818k|                           return false;
 5000|   818k|                        }();
 5001|       |
 5002|   818k|                        if (handled_anchor_only_empty_key) {
 5003|       |                           // 'it' already points to the explicit value indicator ':'
 5004|   818k|                        }
 5005|   818k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 5006|   818k|                           key.clear();
 5007|   818k|                           it = content;
 5008|   818k|                        }
 5009|   818k|                        else {
 5010|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5011|       |                           // Parse the key node structurally (not via plain-key scanning)
 5012|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5013|       |                           // as complex keys, not split into implicit key/value pairs.
 5014|   818k|                           auto key_node_it = content;
 5015|   818k|                           auto key_node_end = end;
 5016|   818k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5017|       |                              // In explicit-key form, a following standalone ':'
 5018|       |                              // line (same or lower indentation) belongs to the
 5019|       |                              // outer mapping value, not the key node itself.
 5020|   818k|                              auto scan = content;
 5021|   818k|                              while (scan != end) {
 5022|   818k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 5023|   818k|                                    ++scan;
 5024|   818k|                                 }
 5025|   818k|                                 if (scan == end) {
 5026|   818k|                                    break;
 5027|   818k|                                 }
 5028|       |
 5029|   818k|                                 yaml::skip_newline(scan, end);
 5030|   818k|                                 auto line_start = scan;
 5031|       |
 5032|   818k|                                 int32_t indicator_indent = 0;
 5033|   818k|                                 while (scan != end && *scan == ' ') {
 5034|   818k|                                    ++indicator_indent;
 5035|   818k|                                    ++scan;
 5036|   818k|                                 }
 5037|       |
 5038|   818k|                                 if (scan != end && *scan == ':') {
 5039|   818k|                                    const auto after_colon = scan + 1;
 5040|   818k|                                    if ((after_colon == end ||
 5041|   818k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 5042|   818k|                                        indicator_indent <= line_indent) {
 5043|   818k|                                       key_node_end = line_start;
 5044|   818k|                                       break;
 5045|   818k|                                    }
 5046|   818k|                                 }
 5047|   818k|                              }
 5048|   818k|                           }
 5049|       |
 5050|   818k|                           glz::generic key_node{};
 5051|   818k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5052|   818k|                           ctx.explicit_mapping_key_context = true;
 5053|   818k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5054|   818k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5055|   818k|                           if (bool(ctx.error)) [[unlikely]]
 5056|   818k|                              return false;
 5057|   818k|                           it = key_node_it;
 5058|   818k|                           if (!to_string_key(key_node)) [[unlikely]]
 5059|   818k|                              return false;
 5060|   818k|                        }
 5061|   818k|                     }
 5062|   818k|                     else {
 5063|   818k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5064|   818k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5065|   818k|                           if (bool(ctx.error)) [[unlikely]]
 5066|   818k|                              return false;
 5067|   818k|                        }
 5068|   818k|                     }
 5069|       |
 5070|   818k|                     yaml::skip_inline_ws(it, end);
 5071|   818k|                     yaml::skip_comment(it, end);
 5072|       |
 5073|       |                     // Value indicator may appear on the next line at the same indent.
 5074|   818k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 5075|   818k|                        auto probe = it;
 5076|   818k|                        bool found_value_indicator = false;
 5077|       |
 5078|   818k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5079|   818k|                           yaml::skip_newline(probe, end);
 5080|       |
 5081|   818k|                           auto value_line = probe;
 5082|   818k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5083|   818k|                           if (bool(ctx.error)) [[unlikely]]
 5084|   818k|                              return false;
 5085|       |
 5086|   818k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5087|   818k|                              probe = value_line;
 5088|   818k|                              continue; // blank line
 5089|   818k|                           }
 5090|   818k|                           if (*value_line == '#') {
 5091|   818k|                              yaml::skip_comment(value_line, end);
 5092|   818k|                              probe = value_line;
 5093|   818k|                              continue; // comment-only line
 5094|   818k|                           }
 5095|   818k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5096|   818k|                              it = value_line;
 5097|   818k|                              found_value_indicator = true;
 5098|   818k|                           }
 5099|   818k|                           break;
 5100|   818k|                        }
 5101|       |
 5102|   818k|                        if (found_value_indicator) {
 5103|   818k|                           yaml::skip_inline_ws(it, end);
 5104|   818k|                        }
 5105|   818k|                     }
 5106|       |
 5107|   818k|                     val_t val{};
 5108|   818k|                     if (it != end && *it == ':') {
 5109|   818k|                        ++it;
 5110|   818k|                        if (it != end && *it == '\t') {
 5111|   818k|                           ctx.error = error_code::syntax_error;
 5112|   818k|                           return false;
 5113|   818k|                        }
 5114|   818k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5115|   818k|                           auto probe = it;
 5116|   818k|                           yaml::skip_newline(probe, end);
 5117|   818k|                           while (probe != end && *probe == ' ') ++probe;
 5118|   818k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5119|   818k|                              ctx.error = error_code::syntax_error;
 5120|   818k|                              return false;
 5121|   818k|                           }
 5122|   818k|                        }
 5123|   818k|                        yaml::skip_inline_ws(it, end);
 5124|   818k|                        if (!parse_map_value(val)) [[unlikely]]
 5125|   818k|                           return false;
 5126|   818k|                     }
 5127|       |
 5128|   818k|                     value.emplace(std::move(key), std::move(val));
 5129|   818k|                     return true;
 5130|   818k|                  }
 5131|       |
 5132|   818k|                  key_t key{};
 5133|   818k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5134|   818k|                     auto key_probe = it;
 5135|   818k|                     yaml::skip_inline_ws(key_probe, end);
 5136|   818k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5137|   818k|                     if (complex_flow_key) {
 5138|   818k|                        glz::generic key_node{};
 5139|   818k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5140|   818k|                        if (bool(ctx.error)) [[unlikely]]
 5141|   818k|                           return false;
 5142|   818k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5143|   818k|                           return false;
 5144|   818k|                     }
 5145|   818k|                     else {
 5146|   818k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5147|   818k|                           return false;
 5148|   818k|                        }
 5149|   818k|                     }
 5150|   818k|                  }
 5151|   818k|                  else {
 5152|   818k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5153|   818k|                     if (bool(ctx.error)) [[unlikely]]
 5154|   818k|                        return false;
 5155|   818k|                  }
 5156|       |
 5157|   818k|                  yaml::skip_inline_ws(it, end);
 5158|       |
 5159|   818k|                  if (it == end || *it != ':') {
 5160|   818k|                     ctx.error = error_code::syntax_error;
 5161|   818k|                     return false;
 5162|   818k|                  }
 5163|   818k|                  ++it;
 5164|   818k|                  yaml::skip_inline_ws(it, end);
 5165|       |
 5166|   818k|                  val_t val{};
 5167|   818k|                  if (!parse_map_value(val)) [[unlikely]]
 5168|   818k|                     return false;
 5169|       |
 5170|   818k|                  value.emplace(std::move(key), std::move(val));
 5171|   818k|                  return true;
 5172|   818k|               });
 5173|   818k|         }
 5174|       |
 5175|  1.98M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5176|  1.98M|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  2.11M|      {
  466|  2.11M|         skip_inline_ws(it, end);
  467|       |
  468|  2.11M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 14, False: 2.11M]
  ------------------
  469|     14|            if constexpr (!AllowEmptyInput) {
  470|     14|               ctx.error = error_code::unexpected_end;
  471|     14|            }
  472|     14|            return true;
  473|     14|         }
  474|       |
  475|  2.11M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  2.11M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 7, False: 2.11M]
  ------------------
  477|      7|            ctx.error = error_code::syntax_error;
  478|      7|            return true;
  479|      7|         }
  480|  2.11M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 2.11M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  2.11M|         skip_inline_ws(it, end);
  486|       |
  487|  2.11M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 13, False: 2.11M]
  ------------------
  488|     13|            if constexpr (!AllowEmptyInput) {
  489|     13|               ctx.error = error_code::unexpected_end;
  490|     13|            }
  491|     13|            return true;
  492|     13|         }
  493|       |
  494|  2.11M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 38.9k, False: 2.08M]
  ------------------
  495|  38.9k|            return true;
  496|  38.9k|         }
  497|       |
  498|  2.08M|         return false;
  499|  2.11M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESN_:
 4599|  2.11M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  2.11M|      {
  409|  2.11M|         state.has_anchor = false;
  410|  2.11M|         state.anchor_name.clear();
  411|  2.11M|         state.anchor_start = nullptr;
  412|  2.11M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  2.11M|         if constexpr (Policy.allow_alias) {
  415|  2.11M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  2.11M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 2.11M, False: 1.53k]
  ------------------
  417|  2.11M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 38.8k, False: 2.07M]
  ------------------
  418|  2.11M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  2.11M|         }
  424|       |
  425|  2.11M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 2.08M, False: 38.8k]
  |  Branch (425:27): [True: 25.0k, False: 2.05M]
  ------------------
  426|  25.0k|            ++it;
  427|  25.0k|            auto name = parse_anchor_name(it, end);
  428|  25.0k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 15, False: 25.0k]
  ------------------
  429|     15|               ctx.error = error_code::syntax_error;
  430|     15|               return true;
  431|     15|            }
  432|  25.0k|            skip_inline_ws(it, end);
  433|  25.0k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 33, False: 24.9k]
  ------------------
  434|     33|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     33|                  ctx.error = error_code::unexpected_end;
  436|     33|               }
  437|     33|               return true;
  438|     33|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  24.9k|            state.has_anchor = true;
  446|  24.9k|            state.anchor_name = std::string(name);
  447|  24.9k|            state.anchor_start = &*it;
  448|  24.9k|         }
  449|       |
  450|  2.11M|         return false;
  451|  2.11M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  2.11M|      {
  301|  2.11M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 2.11M]
  |  Branch (301:27): [True: 2.07M, False: 38.8k]
  ------------------
  302|       |
  303|  38.8k|         ++it; // skip '*'
  304|  38.8k|         auto name = parse_anchor_name(it, end);
  305|  38.8k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 32, False: 38.8k]
  ------------------
  306|     32|            ctx.error = error_code::syntax_error;
  307|     32|            return true;
  308|     32|         }
  309|       |
  310|  38.8k|         auto anchor_it = ctx.anchors.find(name);
  311|  38.8k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 163, False: 38.6k]
  ------------------
  312|    163|            ctx.error = error_code::syntax_error; // undefined alias
  313|    163|            return true;
  314|    163|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  38.6k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  38.6k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 6.29k, False: 32.3k]
  ------------------
  322|  6.29k|            return true;
  323|  6.29k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  32.3k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 18, False: 32.3k]
  ------------------
  329|     18|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     18|            return true;
  331|     18|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  32.3k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  32.3k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 32.3k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  32.3k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 30, False: 32.3k]
  ------------------
  342|     30|            ctx.error = error_code::exceeded_max_expansion;
  343|     30|            ctx.custom_error_message = "alias expansion";
  344|     30|            return true;
  345|     30|         }
  346|       |
  347|  32.3k|         auto replay_it = span.begin;
  348|  32.3k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  32.3k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  32.3k|         ctx.indent_stack.clear();
  353|  32.3k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.47k, False: 29.8k]
  ------------------
  354|  2.47k|            ctx.push_indent(span.base_indent - 1);
  355|  2.47k|         }
  356|       |
  357|  32.3k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  32.3k|         using V = std::remove_cvref_t<T>;
  360|  32.3k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  32.3k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  32.3k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  32.3k|         return true;
  367|  32.3k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4736|  2.07M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4737|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4738|       |                     val = {};
 4739|       |                     return true;
 4740|       |                  }
 4741|  2.07M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4742|  2.07M|                     val = glz::generic{};
 4743|  2.07M|                     return true;
 4744|       |                  }
 4745|       |                  else {
 4746|       |                     static constexpr std::string_view null_value{"null"};
 4747|       |                     auto null_it = null_value.data();
 4748|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4749|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4750|       |                     return !bool(ctx.error);
 4751|       |                  }
 4752|  2.07M|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj1EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|   818k|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|   818k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 818k]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|   818k|         const int32_t parent_indent = ctx.current_indent();
 3722|   818k|         const bool discover_indent = (mapping_indent < 0);
 3723|   818k|         bool first_key = !discover_indent;
 3724|   818k|         bool discovered_first_key_mid_line = false;
 3725|   818k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|  1.96M|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 1.25M, False: 707k]
  ------------------
 3728|  1.25M|            auto line_start = it;
 3729|  1.25M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 1.25M]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|  1.74M|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 1.72M, False: 18.2k]
  ------------------
 3733|  1.72M|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 40.0k, False: 1.68M]
  ------------------
 3734|  40.0k|                  skip_comment(it, end);
 3735|  40.0k|                  skip_newline(it, end);
 3736|  40.0k|                  first_key = false;
 3737|  40.0k|                  line_indent = 0;
 3738|  40.0k|               }
 3739|  1.68M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 91.8k, False: 1.59M]
  |  Branch (3739:40): [True: 303k, False: 1.29M]
  ------------------
 3740|   394k|                  skip_newline(it, end);
 3741|   394k|                  first_key = false;
 3742|   394k|                  line_indent = 0;
 3743|   394k|               }
 3744|  1.29M|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 204k, False: 1.08M]
  ------------------
 3745|   204k|                  line_start = it;
 3746|   204k|                  line_indent = 0;
 3747|   984k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 975k, False: 8.52k]
  |  Branch (3747:39): [True: 780k, False: 195k]
  ------------------
 3748|   780k|                     ++line_indent;
 3749|   780k|                     ++it;
 3750|   780k|                  }
 3751|       |
 3752|   204k|                  bool saw_tab = false;
 3753|   208k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 198k, False: 9.51k]
  |  Branch (3753:40): [True: 1.10k, False: 197k]
  |  Branch (3753:54): [True: 3.09k, False: 194k]
  ------------------
 3754|  4.20k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 2.80k, False: 1.39k]
  |  Branch (3754:43): [True: 1.39k, False: 0]
  ------------------
 3755|  4.20k|                     ++it;
 3756|  4.20k|                  }
 3757|       |
 3758|   204k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 9.51k, False: 194k]
  |  Branch (3758:36): [True: 6.09k, False: 188k]
  |  Branch (3758:51): [True: 2.87k, False: 185k]
  |  Branch (3758:66): [True: 9.42k, False: 176k]
  ------------------
 3759|  27.9k|                     first_key = false;
 3760|  27.9k|                     line_indent = 0;
 3761|  27.9k|                     continue; // Blank or comment line
 3762|  27.9k|                  }
 3763|       |
 3764|   176k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 83, False: 176k]
  ------------------
 3765|     83|                     ctx.error = error_code::syntax_error;
 3766|     83|                     return;
 3767|     83|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   176k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 171k, False: 4.87k]
  |  Branch (3770:46): [True: 1.04k, False: 170k]
  ------------------
 3771|  1.04k|                     it = line_start;
 3772|  1.04k|                     return;
 3773|  1.04k|                  }
 3774|       |
 3775|   175k|                  first_key = false;
 3776|   175k|                  break; // Found content
 3777|   176k|               }
 3778|  1.08M|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 27.1k, False: 1.05M]
  ------------------
 3779|  27.1k|                  line_start = it;
 3780|  63.2k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 62.1k, False: 1.09k]
  |  Branch (3780:40): [True: 4.84k, False: 57.3k]
  |  Branch (3780:54): [True: 31.2k, False: 26.0k]
  ------------------
 3781|  27.1k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 1.09k, False: 26.0k]
  |  Branch (3781:36): [True: 3.83k, False: 22.2k]
  |  Branch (3781:51): [True: 20.9k, False: 1.33k]
  |  Branch (3781:66): [True: 1.21k, False: 115]
  ------------------
 3782|  27.0k|                     first_key = false;
 3783|  27.0k|                     line_indent = 0;
 3784|  27.0k|                     continue; // Blank or comment-only line with tab indentation
 3785|  27.0k|                  }
 3786|    115|                  ctx.error = error_code::syntax_error;
 3787|    115|                  return;
 3788|  27.1k|               }
 3789|  1.05M|               else {
 3790|  1.05M|                  line_start = it;
 3791|  1.05M|                  break; // Content at column 0
 3792|  1.05M|               }
 3793|  1.72M|            }
 3794|       |
 3795|  1.25M|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 18.2k, False: 1.23M]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|  1.23M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 4.08k, False: 1.23M]
  |  Branch (3799:45): [True: 3.54k, False: 1.22M]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|  1.22M|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 1.22M, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|  1.22M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 1.22M, False: 0]
  |  Branch (3806:39): [True: 410k, False: 816k]
  |  Branch (3806:62): [True: 55.0k, False: 355k]
  |  Branch (3806:84): [True: 41.3k, False: 13.7k]
  ------------------
 3807|  41.3k|                  it = line_start;
 3808|  41.3k|                  return;
 3809|  41.3k|               }
 3810|  1.18M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 368k, False: 816k]
  |  Branch (3810:43): [True: 1.06k, False: 367k]
  ------------------
 3811|  1.06k|                  it = line_start;
 3812|  1.06k|                  return;
 3813|  1.06k|               }
 3814|  1.18M|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|  1.18M|            bool established_mapping_indent_this_line = false;
 3818|  1.18M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 816k, False: 367k]
  ------------------
 3819|   816k|               mapping_indent = line_indent;
 3820|   816k|               established_mapping_indent_this_line = true;
 3821|   816k|               discovered_first_key_visual_indent = line_indent;
 3822|   816k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   816k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 816k, False: 0]
  |  Branch (3823:43): [True: 816k, False: 0]
  ------------------
 3824|   816k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   816k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 359, False: 816k]
  ------------------
 3826|    359|                        ctx.error = error_code::syntax_error;
 3827|    359|                        return;
 3828|    359|                     }
 3829|       |
 3830|   816k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   816k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 811k, False: 4.87k]
  |  Branch (3831:49): [True: 650k, False: 160k]
  ------------------
 3832|   650k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   650k|                     }
 3834|   816k|                  }
 3835|   816k|               }
 3836|   816k|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|  1.18M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 1.18M, False: 359]
  |  Branch (3840:36): [True: 1.18M, False: 0]
  |  Branch (3840:59): [True: 367k, False: 816k]
  ------------------
 3841|   367k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 201k, False: 166k]
  ------------------
 3842|   201k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 200k, False: 825]
  |  Branch (3842:43): [True: 90.4k, False: 109k]
  ------------------
 3843|  90.4k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 90, False: 90.3k]
  ------------------
 3844|     90|                     ctx.error = error_code::syntax_error;
 3845|     90|                     return;
 3846|     90|                  }
 3847|  90.3k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 3.89k, False: 86.4k]
  ------------------
 3848|  3.89k|                     it = line_start;
 3849|  3.89k|                     return;
 3850|  3.89k|                  }
 3851|  90.3k|               }
 3852|   110k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 1.09k, False: 109k]
  ------------------
 3853|  1.09k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 78, False: 1.01k]
  |  Branch (3853:47): [True: 6, False: 1.00k]
  ------------------
 3854|  1.00k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 1.00k, False: 0]
  |  Branch (3854:49): [True: 1.00k, False: 0]
  |  Branch (3854:72): [True: 12, False: 995]
  ------------------
 3855|     96|                  ctx.error = error_code::syntax_error;
 3856|     96|                  return;
 3857|     96|               }
 3858|   201k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|  1.18M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 1.18M]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|  1.18M|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 1.18M]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|  1.18M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 359, False: 1.18M]
  |  Branch (3876:32): [True: 0, False: 1.18M]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|  1.18M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 329k, False: 850k]
  |  Branch (3885:53): [True: 107k, False: 222k]
  |  Branch (3885:94): [True: 41.4k, False: 66.4k]
  ------------------
 3886|  41.4k|               const auto after_colon = it + 1;
 3887|  41.4k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 37.7k, False: 3.73k]
  ------------------
 3888|  41.4k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 1.16k, False: 40.3k]
  |  Branch (3888:43): [True: 37.6k, False: 2.65k]
  ------------------
 3889|  38.8k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 2.80k, False: 36.0k]
  ------------------
 3890|  2.80k|                  it = line_start;
 3891|  2.80k|                  return;
 3892|  2.80k|               }
 3893|  41.4k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|  1.17M|            int32_t effective_line_indent = line_indent;
 3897|  1.17M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 1.17M, False: 359]
  |  Branch (3897:36): [True: 816k, False: 360k]
  ------------------
 3898|   816k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 650k, False: 165k]
  ------------------
 3899|   650k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 467k, False: 183k]
  |  Branch (3899:52): [True: 275k, False: 191k]
  ------------------
 3900|       |               // The first discovered key has no indentation of its own left to measure: it may
 3901|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3902|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3903|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3904|       |               // key with an empty value takes the following sibling line for nested content
 3905|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3906|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3907|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3908|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3909|       |               // 7FWL and HMQ5 pin that case.
 3910|   374k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   374k|            }
 3912|       |
 3913|  1.17M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 35.1k, False: 1.14M]
  ------------------
 3914|  35.1k|               return;
 3915|  35.1k|            }
 3916|  1.14M|            first_key = false;
 3917|       |
 3918|  1.14M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 1.14M]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|  1.14M|            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|  1.14M|               auto flow_end = it;
 3925|  1.14M|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|  1.14M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3926:20): [True: 125, False: 1.14M]
  ------------------
 3927|    125|                  return;
 3928|  1.14M|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3928:20): [True: 963k, False: 178k]
  |  Branch (3928:40): [True: 398k, False: 565k]
  |  Branch (3928:60): [True: 15.1k, False: 549k]
  |  Branch (3928:80): [True: 130k, False: 419k]
  ------------------
 3929|   544k|                  it = flow_end;
 3930|   544k|                  return;
 3931|   544k|               }
 3932|  1.14M|            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|  1.14M|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 454k, False: 688k]
  ------------------
 3938|   454k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 112k, False: 341k]
  |  Branch (3938:34): [True: 2.73k, False: 338k]
  ------------------
 3939|   115k|                  auto peek = it;
 3940|   115k|                  skip_inline_ws(peek, end);
 3941|   115k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 108k, False: 6.57k]
  |  Branch (3941:38): [True: 102k, False: 5.88k]
  |  Branch (3941:55): [True: 98.9k, False: 4.01k]
  |  Branch (3941:72): [True: 94.4k, False: 4.47k]
  ------------------
 3942|  94.4k|                     continue; // At leading indent of new line
 3943|  94.4k|                  }
 3944|   115k|               }
 3945|   359k|               skip_inline_ws(it, end);
 3946|   359k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 353k, False: 6.57k]
  |  Branch (3946:33): [True: 19.0k, False: 334k]
  ------------------
 3947|  19.0k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  19.0k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 19.0k, False: 0]
  ------------------
 3949|  19.0k|                        const char prev = *(it - 1);
 3950|  19.0k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 7.77k, False: 11.2k]
  |  Branch (3950:44): [True: 4.25k, False: 3.52k]
  |  Branch (3950:60): [True: 2.07k, False: 2.17k]
  |  Branch (3950:76): [True: 14, False: 2.05k]
  ------------------
 3951|     14|                           ctx.error = error_code::syntax_error;
 3952|     14|                           return;
 3953|     14|                        }
 3954|  19.0k|                     }
 3955|  19.0k|                  }
 3956|  19.0k|               }
 3957|  19.0k|               skip_comment(it, end);
 3958|   359k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 352k, False: 6.91k]
  |  Branch (3958:34): [True: 76.2k, False: 276k]
  |  Branch (3958:49): [True: 117k, False: 159k]
  ------------------
 3959|   193k|                  skip_newline(it, end);
 3960|   193k|               }
 3961|   166k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 159k, False: 6.91k]
  ------------------
 3962|       |                  // The entry stopped part way along its line with something other than
 3963|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3964|       |                  // separator, say. The next pass measures indent as though this were the start
 3965|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3966|   159k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   159k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 598, False: 158k]
  ------------------
 3968|    598|                        ctx.error = error_code::syntax_error;
 3969|    598|                        return;
 3970|    598|                     }
 3971|   159k|                  }
 3972|   159k|               }
 3973|   359k|            }
 3974|  1.14M|         }
 3975|   818k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_i:
 4855|  1.17M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4856|  1.17M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|  1.17M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4858|  1.17M|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|  1.17M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|  1.17M|                           if (ctx.stream_begin) {
 4866|  1.17M|                              auto is_line_content_start = [&](auto pos) {
 4867|  1.17M|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|  1.17M|                              };
 4869|       |
 4870|  1.17M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|  1.17M|                                 const char* line = ctx.line_begin_of(pos);
 4872|  1.17M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|  1.17M|                                 return line != end && *line == ':';
 4874|  1.17M|                              };
 4875|       |
 4876|  1.17M|                              if (!is_line_content_start(it) &&
 4877|  1.17M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4878|  1.17M|                                  !line_has_explicit_value_indicator(it)) {
 4879|  1.17M|                                 ctx.error = error_code::syntax_error;
 4880|  1.17M|                                 return false;
 4881|  1.17M|                              }
 4882|  1.17M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|  1.17M|                           }
 4884|  1.17M|                        }
 4885|       |
 4886|  1.17M|                        if (*it == '-' &&
 4887|  1.17M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4888|  1.17M|                            !line_starts_with_explicit_value_indicator) {
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|  1.17M|                           ctx.error = error_code::syntax_error;
 4891|  1.17M|                           return false;
 4892|  1.17M|                        }
 4893|       |
 4894|  1.17M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4895|  1.17M|                           return false;
 4896|  1.17M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|  1.17M|                        ctx.pop_indent();
 4898|  1.17M|                     }
 4899|  1.17M|                     else {
 4900|  1.17M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|  1.17M|                        if (nested_indent >= 0) {
 4902|  1.17M|                           yaml::skip_to_content(it, end);
 4903|  1.17M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4904|  1.17M|                              ctx.error = error_code::syntax_error;
 4905|  1.17M|                              return false;
 4906|  1.17M|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|  1.17M|                           const int32_t value_indent =
 4910|  1.17M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4911|  1.17M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4912|  1.17M|                              return false;
 4913|  1.17M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|  1.17M|                           ctx.pop_indent();
 4915|  1.17M|                        }
 4916|  1.17M|                     }
 4917|  1.17M|                     return !bool(ctx.error);
 4918|  1.17M|                  };
 4919|       |
 4920|       |                  // Explicit key entry form:
 4921|       |                  // ? key
 4922|       |                  // : value
 4923|  1.17M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4923:23): [True: 464k, False: 713k]
  |  Branch (4923:37): [True: 463k, False: 743]
  |  Branch (4923:58): [True: 15, False: 463k]
  ------------------
 4924|     15|                     ctx.error = error_code::syntax_error;
 4925|     15|                     return false;
 4926|     15|                  }
 4927|  1.17M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4927:23): [True: 464k, False: 713k]
  |  Branch (4927:38): [True: 743, False: 463k]
  |  Branch (4927:57): [True: 153k, False: 309k]
  |  Branch (4927:77): [True: 210k, False: 99.2k]
  |  Branch (4927:98): [True: 80.6k, False: 18.5k]
  ------------------
 4928|   445k|                     ++it; // skip '?'
 4929|   445k|                     yaml::skip_inline_ws(it, end);
 4930|       |
 4931|   445k|                     const int32_t explicit_value_indicator_indent =
 4932|   445k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4932:25): [True: 303k, False: 141k]
  ------------------
 4933|       |
 4934|   445k|                     key_t key{};
 4935|   445k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4936|   445k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   445k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   445k|                        };
 4939|       |
 4940|   445k|                        auto key_it = it;
 4941|   445k|                        yaml::skip_inline_ws(key_it, end);
 4942|       |
 4943|   445k|                        auto content = key_it;
 4944|   445k|                        yaml::skip_to_content(content, end);
 4945|   445k|                        bool handled_anchor_only_empty_key = false;
 4946|       |
 4947|       |                        // Anchor on an empty explicit key node:
 4948|       |                        //   ? &a
 4949|       |                        //   : value
 4950|   445k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4950:29): [True: 439k, False: 6.50k]
  |  Branch (4950:47): [True: 152k, False: 286k]
  ------------------
 4951|   152k|                           auto anchor_probe = content + 1;
 4952|   152k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4953|   152k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4953:32): [True: 152k, False: 44]
  ------------------
 4954|   152k|                              auto after_anchor = anchor_probe;
 4955|   152k|                              yaml::skip_inline_ws(after_anchor, end);
 4956|       |
 4957|   152k|                              auto value_indicator = after_anchor;
 4958|   152k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4958:35): [True: 146k, False: 5.54k]
  |  Branch (4958:61): [True: 8.72k, False: 138k]
  ------------------
 4959|  8.72k|                                 key.clear();
 4960|  8.72k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4961|  8.72k|                                 it = value_indicator;
 4962|  8.72k|                                 handled_anchor_only_empty_key = true;
 4963|  8.72k|                              }
 4964|   143k|                              else {
 4965|   143k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4965:38): [True: 138k, False: 5.54k]
  |  Branch (4965:64): [True: 8.35k, False: 129k]
  ------------------
 4966|  8.35k|                                    yaml::skip_comment(value_indicator, end);
 4967|  8.35k|                                 }
 4968|   143k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4968:38): [True: 137k, False: 6.01k]
  |  Branch (4968:65): [True: 16.9k, False: 120k]
  |  Branch (4968:93): [True: 56.7k, False: 64.1k]
  ------------------
 4969|  73.6k|                                    yaml::skip_newline(value_indicator, end);
 4970|  73.6k|                                    auto value_line = value_indicator;
 4971|  73.6k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4972|  73.6k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4972:41): [True: 6, False: 73.6k]
  ------------------
 4973|      6|                                       return false;
 4974|  73.6k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4974:41): [True: 68.6k, False: 5.00k]
  |  Branch (4974:62): [True: 8.75k, False: 59.9k]
  ------------------
 4975|  8.75k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4975:41): [True: 8.75k, False: 6]
  ------------------
 4976|  8.75k|                                       key.clear();
 4977|  8.75k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4978|  8.75k|                                       it = value_line;
 4979|  8.75k|                                       handled_anchor_only_empty_key = true;
 4980|  8.75k|                                    }
 4981|  64.9k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4981:46): [True: 59.9k, False: 5.00k]
  |  Branch (4981:67): [True: 6, False: 59.9k]
  ------------------
 4982|       |                                       // In explicit-key form ("? &a"), a following ':'
 4983|       |                                       // starts the outer value indicator only at the same
 4984|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4985|      6|                                       ctx.error = error_code::syntax_error;
 4986|      6|                                       return false;
 4987|      6|                                    }
 4988|  73.6k|                                 }
 4989|   143k|                              }
 4990|   152k|                           }
 4991|   152k|                        }
 4992|       |
 4993|   445k|                        const bool key_content_spans_lines = [&] {
 4994|   445k|                           auto scan = key_it;
 4995|   445k|                           while (scan != content && scan != end) {
 4996|   445k|                              if (*scan == '\n' || *scan == '\r') return true;
 4997|   445k|                              ++scan;
 4998|   445k|                           }
 4999|   445k|                           return false;
 5000|   445k|                        }();
 5001|       |
 5002|   445k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5002:29): [True: 17.4k, False: 428k]
  ------------------
 5003|       |                           // 'it' already points to the explicit value indicator ':'
 5004|  17.4k|                        }
 5005|   428k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5005:34): [True: 6.50k, False: 421k]
  |  Branch (5005:53): [True: 13.0k, False: 408k]
  |  Branch (5005:72): [True: 9.79k, False: 3.23k]
  ------------------
 5006|  16.3k|                           key.clear();
 5007|  16.3k|                           it = content;
 5008|  16.3k|                        }
 5009|   411k|                        else {
 5010|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5011|       |                           // Parse the key node structurally (not via plain-key scanning)
 5012|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5013|       |                           // as complex keys, not split into implicit key/value pairs.
 5014|   411k|                           auto key_node_it = content;
 5015|   411k|                           auto key_node_end = end;
 5016|   411k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5017|       |                              // In explicit-key form, a following standalone ':'
 5018|       |                              // line (same or lower indentation) belongs to the
 5019|       |                              // outer mapping value, not the key node itself.
 5020|   411k|                              auto scan = content;
 5021|  3.33M|                              while (scan != end) {
  ------------------
  |  Branch (5021:38): [True: 3.27M, False: 58.2k]
  ------------------
 5022|   198M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5022:41): [True: 198M, False: 240k]
  |  Branch (5022:56): [True: 197M, False: 1.29M]
  |  Branch (5022:73): [True: 195M, False: 1.74M]
  ------------------
 5023|   195M|                                    ++scan;
 5024|   195M|                                 }
 5025|  3.27M|                                 if (scan == end) {
  ------------------
  |  Branch (5025:38): [True: 240k, False: 3.03M]
  ------------------
 5026|   240k|                                    break;
 5027|   240k|                                 }
 5028|       |
 5029|  3.03M|                                 yaml::skip_newline(scan, end);
 5030|  3.03M|                                 auto line_start = scan;
 5031|       |
 5032|  3.03M|                                 int32_t indicator_indent = 0;
 5033|  5.14M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5033:41): [True: 5.08M, False: 58.2k]
  |  Branch (5033:56): [True: 2.10M, False: 2.97M]
  ------------------
 5034|  2.10M|                                    ++indicator_indent;
 5035|  2.10M|                                    ++scan;
 5036|  2.10M|                                 }
 5037|       |
 5038|  3.03M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5038:38): [True: 2.97M, False: 58.2k]
  |  Branch (5038:53): [True: 270k, False: 2.70M]
  ------------------
 5039|   270k|                                    const auto after_colon = scan + 1;
 5040|   270k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5040:42): [True: 2.89k, False: 268k]
  ------------------
 5041|   268k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5041:42): [True: 223k, False: 44.2k]
  ------------------
 5042|   226k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5042:41): [True: 112k, False: 114k]
  ------------------
 5043|   112k|                                       key_node_end = line_start;
 5044|   112k|                                       break;
 5045|   112k|                                    }
 5046|   270k|                                 }
 5047|  3.03M|                              }
 5048|   411k|                           }
 5049|       |
 5050|   411k|                           glz::generic key_node{};
 5051|   411k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5052|   411k|                           ctx.explicit_mapping_key_context = true;
 5053|   411k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5054|   411k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5055|   411k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5055:32): [True: 5.49k, False: 406k]
  ------------------
 5056|  5.49k|                              return false;
 5057|   406k|                           it = key_node_it;
 5058|   406k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5058:32): [True: 20, False: 406k]
  ------------------
 5059|     20|                              return false;
 5060|   406k|                        }
 5061|       |                     }
 5062|       |                     else {
 5063|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5064|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5065|       |                           if (bool(ctx.error)) [[unlikely]]
 5066|       |                              return false;
 5067|       |                        }
 5068|       |                     }
 5069|       |
 5070|   440k|                     yaml::skip_inline_ws(it, end);
 5071|   445k|                     yaml::skip_comment(it, end);
 5072|       |
 5073|       |                     // Value indicator may appear on the next line at the same indent.
 5074|   445k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5074:26): [True: 383k, False: 62.0k]
  |  Branch (5074:40): [True: 24.8k, False: 358k]
  |  Branch (5074:55): [True: 77.7k, False: 280k]
  ------------------
 5075|   102k|                        auto probe = it;
 5076|   102k|                        bool found_value_indicator = false;
 5077|       |
 5078|   150k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5078:32): [True: 133k, False: 17.7k]
  |  Branch (5078:49): [True: 35.3k, False: 97.7k]
  |  Branch (5078:67): [True: 97.7k, False: 36]
  ------------------
 5079|   133k|                           yaml::skip_newline(probe, end);
 5080|       |
 5081|   133k|                           auto value_line = probe;
 5082|   133k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5083|   133k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5083:32): [True: 8, False: 133k]
  ------------------
 5084|      8|                              return false;
 5085|       |
 5086|   133k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5086:32): [True: 16.7k, False: 116k]
  |  Branch (5086:53): [True: 5.05k, False: 111k]
  |  Branch (5086:76): [True: 13.6k, False: 97.6k]
  ------------------
 5087|  35.4k|                              probe = value_line;
 5088|  35.4k|                              continue; // blank line
 5089|  35.4k|                           }
 5090|  97.6k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5090:32): [True: 12.8k, False: 84.8k]
  ------------------
 5091|  12.8k|                              yaml::skip_comment(value_line, end);
 5092|  12.8k|                              probe = value_line;
 5093|  12.8k|                              continue; // comment-only line
 5094|  12.8k|                           }
 5095|  84.8k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5095:32): [True: 41.2k, False: 43.5k]
  |  Branch (5095:54): [True: 12.3k, False: 28.8k]
  ------------------
 5096|  12.3k|                              it = value_line;
 5097|  12.3k|                              found_value_indicator = true;
 5098|  12.3k|                           }
 5099|  84.8k|                           break;
 5100|  97.6k|                        }
 5101|       |
 5102|   102k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5102:29): [True: 12.3k, False: 90.2k]
  ------------------
 5103|  12.3k|                           yaml::skip_inline_ws(it, end);
 5104|  12.3k|                        }
 5105|   102k|                     }
 5106|       |
 5107|   445k|                     val_t val{};
 5108|   445k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5108:26): [True: 383k, False: 62.0k]
  |  Branch (5108:39): [True: 144k, False: 239k]
  ------------------
 5109|   144k|                        ++it;
 5110|   144k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5110:29): [True: 139k, False: 5.29k]
  |  Branch (5110:42): [True: 6, False: 139k]
  ------------------
 5111|      6|                           ctx.error = error_code::syntax_error;
 5112|      6|                           return false;
 5113|      6|                        }
 5114|   144k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5114:29): [True: 139k, False: 5.29k]
  |  Branch (5114:43): [True: 9.96k, False: 129k]
  |  Branch (5114:58): [True: 34.8k, False: 94.1k]
  ------------------
 5115|  44.8k|                           auto probe = it;
 5116|  44.8k|                           yaml::skip_newline(probe, end);
 5117|  80.6k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5117:35): [True: 74.3k, False: 6.22k]
  |  Branch (5117:51): [True: 35.7k, False: 38.6k]
  ------------------
 5118|  44.8k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5118:32): [True: 38.6k, False: 6.22k]
  |  Branch (5118:48): [True: 17.5k, False: 21.1k]
  |  Branch (5118:65): [True: 16.9k, False: 547]
  |  Branch (5118:89): [True: 4, False: 16.9k]
  ------------------
 5119|      4|                              ctx.error = error_code::syntax_error;
 5120|      4|                              return false;
 5121|      4|                           }
 5122|  44.8k|                        }
 5123|   144k|                        yaml::skip_inline_ws(it, end);
 5124|   144k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5124:29): [True: 860, False: 143k]
  ------------------
 5125|    860|                           return false;
 5126|   144k|                     }
 5127|       |
 5128|   444k|                     value.emplace(std::move(key), std::move(val));
 5129|   444k|                     return true;
 5130|   445k|                  }
 5131|       |
 5132|   731k|                  key_t key{};
 5133|   731k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5134|   731k|                     auto key_probe = it;
 5135|   731k|                     yaml::skip_inline_ws(key_probe, end);
 5136|   731k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5136:53): [True: 731k, False: 0]
  |  Branch (5136:74): [True: 4.57k, False: 727k]
  |  Branch (5136:95): [True: 4.08k, False: 723k]
  ------------------
 5137|   731k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5137:26): [True: 8.65k, False: 723k]
  ------------------
 5138|  8.65k|                        glz::generic key_node{};
 5139|  8.65k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5140|  8.65k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5140:29): [True: 2.16k, False: 6.49k]
  ------------------
 5141|  2.16k|                           return false;
 5142|  6.49k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5142:29): [True: 4, False: 6.48k]
  ------------------
 5143|      4|                           return false;
 5144|  6.49k|                     }
 5145|   723k|                     else {
 5146|   723k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5146:29): [True: 1.99k, False: 721k]
  ------------------
 5147|  1.99k|                           return false;
 5148|  1.99k|                        }
 5149|   723k|                     }
 5150|       |                  }
 5151|       |                  else {
 5152|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5153|       |                     if (bool(ctx.error)) [[unlikely]]
 5154|       |                        return false;
 5155|       |                  }
 5156|       |
 5157|   727k|                  yaml::skip_inline_ws(it, end);
 5158|       |
 5159|   731k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5159:23): [True: 4.34k, False: 727k]
  |  Branch (5159:36): [True: 599, False: 726k]
  ------------------
 5160|    768|                     ctx.error = error_code::syntax_error;
 5161|    768|                     return false;
 5162|    768|                  }
 5163|   731k|                  ++it;
 5164|   731k|                  yaml::skip_inline_ws(it, end);
 5165|       |
 5166|   731k|                  val_t val{};
 5167|   731k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5167:23): [True: 23.7k, False: 707k]
  ------------------
 5168|  23.7k|                     return false;
 5169|       |
 5170|   707k|                  value.emplace(std::move(key), std::move(val));
 5171|   707k|                  return true;
 5172|   731k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlvE_clEv:
 4993|   445k|                        const bool key_content_spans_lines = [&] {
 4994|   445k|                           auto scan = key_it;
 4995|   491k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4995:35): [True: 348k, False: 142k]
  |  Branch (4995:54): [True: 348k, False: 0]
  ------------------
 4996|   348k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4996:35): [True: 214k, False: 134k]
  |  Branch (4996:52): [True: 88.4k, False: 45.9k]
  ------------------
 4997|  45.9k|                              ++scan;
 4998|  45.9k|                           }
 4999|   142k|                           return false;
 5000|   445k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4936|   406k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   406k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   406k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4856|   871k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|   871k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4857:26): [True: 853k, False: 17.5k]
  |  Branch (4857:39): [True: 620k, False: 233k]
  ------------------
 4858|   620k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   620k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   620k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4865:32): [True: 620k, False: 0]
  ------------------
 4866|   620k|                              auto is_line_content_start = [&](auto pos) {
 4867|   620k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   620k|                              };
 4869|       |
 4870|   620k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   620k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   620k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   620k|                                 return line != end && *line == ':';
 4874|   620k|                              };
 4875|       |
 4876|   620k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4876:35): [True: 620k, False: 0]
  ------------------
 4877|   620k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4877:35): [True: 45.0k, False: 575k]
  ------------------
 4878|  45.0k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4878:35): [True: 658, False: 44.3k]
  ------------------
 4879|    658|                                 ctx.error = error_code::syntax_error;
 4880|    658|                                 return false;
 4881|    658|                              }
 4882|   619k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   619k|                           }
 4884|   620k|                        }
 4885|       |
 4886|   620k|                        if (*it == '-' &&
  ------------------
  |  Branch (4886:29): [True: 6.76k, False: 613k]
  ------------------
 4887|  6.76k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4887:30): [True: 872, False: 5.89k]
  |  Branch (4887:49): [True: 1.27k, False: 4.61k]
  ------------------
 4888|  2.15k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4888:29): [True: 25, False: 2.12k]
  ------------------
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|     25|                           ctx.error = error_code::syntax_error;
 4891|     25|                           return false;
 4892|     25|                        }
 4893|       |
 4894|   620k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4894:29): [True: 0, False: 620k]
  ------------------
 4895|      0|                           return false;
 4896|   620k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   620k|                        ctx.pop_indent();
 4898|   620k|                     }
 4899|   250k|                     else {
 4900|   250k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|   250k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4901:29): [True: 66.4k, False: 184k]
  ------------------
 4902|  66.4k|                           yaml::skip_to_content(it, end);
 4903|  66.4k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4903:32): [True: 66.4k, False: 0]
  |  Branch (4903:45): [True: 0, False: 66.4k]
  |  Branch (4903:59): [True: 0, False: 0]
  |  Branch (4903:78): [True: 0, False: 0]
  ------------------
 4904|      0|                              ctx.error = error_code::syntax_error;
 4905|      0|                              return false;
 4906|      0|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|  66.4k|                           const int32_t value_indent =
 4910|  66.4k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4910:31): [Folded, False: 66.4k]
  ------------------
 4911|  66.4k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4911:32): [True: 0, False: 66.4k]
  ------------------
 4912|      0|                              return false;
 4913|  66.4k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|  66.4k|                           ctx.pop_indent();
 4915|  66.4k|                        }
 4916|   250k|                     }
 4917|   871k|                     return !bool(ctx.error);
 4918|   871k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISB_EEDaSN_:
 4866|   620k|                              auto is_line_content_start = [&](auto pos) {
 4867|   620k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   620k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISB_EEDaSN_:
 4870|   664k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   664k|                                 const char* line = ctx.line_begin_of(pos);
 4872|  1.17M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4872:41): [True: 1.17M, False: 0]
  |  Branch (4872:57): [True: 509k, False: 665k]
  |  Branch (4872:73): [True: 1.03k, False: 664k]
  ------------------
 4873|   664k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4873:41): [True: 664k, False: 0]
  |  Branch (4873:56): [True: 408k, False: 255k]
  ------------------
 4874|   664k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4625|  2.08M|            {
 4626|       |               // emplace is a no-op for keys the document already wrote, so only
 4627|       |               // untouched pre-existing entries are put back.
 4628|  2.08M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4628:33): [True: 0, False: 2.08M]
  ------------------
 4629|      0|                  target.emplace(entry.first, std::move(entry.second));
 4630|      0|               }
 4631|  2.08M|            }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   336k|      {
 5284|   336k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   336k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   336k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   336k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   336k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 336k, False: 0]
  ------------------
 5294|   336k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   336k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4176|   348k|      {
 4177|   348k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4177:14): [True: 0, False: 348k]
  ------------------
 4178|      0|            return;
 4179|       |
 4180|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4181|   348k|         auto peek = it;
 4182|   348k|         yaml::node_preamble_state preamble{};
 4183|   348k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4183:14): [True: 16.0k, False: 332k]
  ------------------
 4184|   348k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4185|  16.0k|            it = peek;
 4186|  16.0k|            return;
 4187|  16.0k|         }
 4188|       |
 4189|   332k|         if (*peek == '[') {
  ------------------
  |  Branch (4189:14): [True: 115k, False: 216k]
  ------------------
 4190|       |            // Flow sequence - consume whitespace and parse
 4191|   115k|            it = peek;
 4192|   115k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4193|   115k|         }
 4194|   216k|         else if (*peek == '-') {
  ------------------
  |  Branch (4194:19): [True: 216k, False: 290]
  ------------------
 4195|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4196|       |            // But if there was a tag, we need to advance past it
 4197|   216k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4197:17): [True: 1.00k, False: 215k]
  |  Branch (4197:57): [True: 6.00k, False: 209k]
  ------------------
 4198|  7.00k|               it = peek;
 4199|  7.00k|            }
 4200|   216k|            int32_t seq_indent = ctx.current_indent();
 4201|   216k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4201:17): [True: 216k, False: 655]
  |  Branch (4201:31): [True: 123k, False: 92.7k]
  ------------------
 4202|   123k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4202:29): [True: 52.4k, False: 70.8k]
  |  Branch (4202:62): [True: 50.3k, False: 2.13k]
  ------------------
 4203|   123k|                                                          : (ctx.current_indent() + 1);
 4204|   123k|            }
 4205|   216k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4206|   216k|         }
 4207|    290|         else {
 4208|    290|            ctx.error = error_code::syntax_error;
 4209|    290|         }
 4210|       |
 4211|   332k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4212|   332k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEELb0ERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_ZNS_4fromILj450ESC_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSG_SD_TkNS_10is_contextERSE_SG_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSP_RSS_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   348k|      {
  466|   348k|         skip_inline_ws(it, end);
  467|       |
  468|   348k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 16, False: 348k]
  ------------------
  469|     16|            if constexpr (!AllowEmptyInput) {
  470|     16|               ctx.error = error_code::unexpected_end;
  471|     16|            }
  472|     16|            return true;
  473|     16|         }
  474|       |
  475|   348k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   348k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 348k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   348k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 348k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   348k|         skip_inline_ws(it, end);
  486|       |
  487|   348k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 9, False: 348k]
  ------------------
  488|      9|            if constexpr (!AllowEmptyInput) {
  489|      9|               ctx.error = error_code::unexpected_end;
  490|      9|            }
  491|      9|            return true;
  492|      9|         }
  493|       |
  494|   348k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 16.0k, False: 332k]
  ------------------
  495|  16.0k|            return true;
  496|  16.0k|         }
  497|       |
  498|   332k|         return false;
  499|   348k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_ENKUlNSC_8yaml_tagEE_clESR_:
 4184|   348k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   348k|      {
  409|   348k|         state.has_anchor = false;
  410|   348k|         state.anchor_name.clear();
  411|   348k|         state.anchor_start = nullptr;
  412|   348k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   348k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   348k|            else {
  421|   348k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 15.9k, False: 332k]
  ------------------
  422|   348k|            }
  423|   348k|         }
  424|       |
  425|   348k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 332k, False: 15.9k]
  |  Branch (425:27): [True: 8.11k, False: 324k]
  ------------------
  426|  8.11k|            ++it;
  427|  8.11k|            auto name = parse_anchor_name(it, end);
  428|  8.11k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 24, False: 8.09k]
  ------------------
  429|     24|               ctx.error = error_code::syntax_error;
  430|     24|               return true;
  431|     24|            }
  432|  8.09k|            skip_inline_ws(it, end);
  433|  8.09k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 43, False: 8.04k]
  ------------------
  434|     43|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     43|                  ctx.error = error_code::unexpected_end;
  436|     43|               }
  437|     43|               return true;
  438|     43|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  8.04k|            state.has_anchor = true;
  446|  8.04k|            state.anchor_name = std::string(name);
  447|  8.04k|            state.anchor_start = &*it;
  448|  8.04k|         }
  449|       |
  450|   348k|         return false;
  451|   348k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   348k|      {
  301|   348k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 348k]
  |  Branch (301:27): [True: 332k, False: 15.9k]
  ------------------
  302|       |
  303|  15.9k|         ++it; // skip '*'
  304|  15.9k|         auto name = parse_anchor_name(it, end);
  305|  15.9k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 23, False: 15.9k]
  ------------------
  306|     23|            ctx.error = error_code::syntax_error;
  307|     23|            return true;
  308|     23|         }
  309|       |
  310|  15.9k|         auto anchor_it = ctx.anchors.find(name);
  311|  15.9k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 77, False: 15.8k]
  ------------------
  312|     77|            ctx.error = error_code::syntax_error; // undefined alias
  313|     77|            return true;
  314|     77|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  15.8k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  15.8k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 3.65k, False: 12.2k]
  ------------------
  322|  3.65k|            return true;
  323|  3.65k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  12.2k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 33, False: 12.1k]
  ------------------
  329|     33|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     33|            return true;
  331|     33|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  12.1k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  12.1k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 12.1k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  12.1k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 12.1k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  12.1k|         auto replay_it = span.begin;
  348|  12.1k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  12.1k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  12.1k|         ctx.indent_stack.clear();
  353|  12.1k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.75k, False: 9.42k]
  ------------------
  354|  2.75k|            ctx.push_indent(span.base_indent - 1);
  355|  2.75k|         }
  356|       |
  357|  12.1k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  12.1k|         using V = std::remove_cvref_t<T>;
  360|  12.1k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  12.1k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  12.1k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  12.1k|         return true;
  367|  12.1k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|   115k|      {
 2665|   115k|         using V = std::remove_cvref_t<T>;
 2666|   115k|         using value_type = typename V::value_type;
 2667|       |
 2668|   115k|         struct sequence_container_adapter
 2669|   115k|         {
 2670|   115k|            size_t index = 0;
 2671|       |
 2672|   115k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|   115k|            {
 2674|   115k|               if constexpr (!resizable<V>) {
 2675|   115k|                  return index >= container.size();
 2676|   115k|               }
 2677|   115k|               else {
 2678|   115k|                  (void)container;
 2679|   115k|                  return false;
 2680|   115k|               }
 2681|   115k|            }
 2682|       |
 2683|   115k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|   115k|            inline void append(V& container, value_type&& element) noexcept
 2686|   115k|            {
 2687|   115k|               if constexpr (emplace_backable<V>) {
 2688|   115k|                  container.emplace_back(std::move(element));
 2689|   115k|               }
 2690|   115k|               else if constexpr (emplaceable<V>) {
 2691|   115k|                  container.emplace(std::move(element));
 2692|   115k|               }
 2693|   115k|            }
 2694|   115k|         };
 2695|       |
 2696|   115k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 115k]
  |  Branch (2696:27): [True: 0, False: 115k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|   115k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|   115k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|   115k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|   115k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 49, False: 115k]
  ------------------
 2709|     49|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|   115k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 113k, False: 1.43k]
  |  Branch (2712:27): [True: 22.9k, False: 90.8k]
  ------------------
 2713|  22.9k|            ++it;
 2714|  22.9k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  22.9k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 64, False: 22.9k]
  ------------------
 2716|     64|               return;
 2717|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|       |               if (ctx.current_indent() < 0) {
 2719|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|       |               }
 2721|       |            }
 2722|  22.9k|            return;
 2723|  22.9k|         }
 2724|       |
 2725|  92.3k|         bool just_saw_comma = false;
 2726|  92.3k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  92.3k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|   158k|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 156k, False: 2.30k]
  ------------------
 2731|   156k|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|   156k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 156k]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|   156k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 156k]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|   156k|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 14.6k, False: 141k]
  ------------------
 2741|  14.6k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 14.6k, False: 0]
  ------------------
 2742|  14.6k|                     ++it;
 2743|  14.6k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  14.6k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 20, False: 14.5k]
  ------------------
 2745|     20|                        return;
 2746|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|       |                        if (ctx.current_indent() < 0) {
 2748|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|       |                        }
 2750|       |                     }
 2751|  14.5k|                     return;
 2752|  14.6k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  14.6k|               }
 2756|       |
 2757|   141k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 122, False: 141k]
  |  Branch (2757:34): [True: 30, False: 141k]
  ------------------
 2758|    152|                  ctx.error = error_code::syntax_error;
 2759|    152|                  return;
 2760|    152|               }
 2761|   141k|               just_saw_comma = false;
 2762|       |
 2763|   141k|               value_type element{};
 2764|   141k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|   141k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 26.2k, False: 115k]
  ------------------
 2767|  26.2k|                  return;
 2768|       |
 2769|   115k|               bool saw_line_break_before_separator = false;
 2770|   115k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|   115k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 60, False: 115k]
  ------------------
 2772|     60|                  return;
 2773|       |
 2774|   115k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 114k, False: 1.11k]
  |  Branch (2774:33): [True: 16.9k, False: 97.0k]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  16.9k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 33, False: 16.8k]
  ------------------
 2777|     33|                     ctx.error = error_code::syntax_error;
 2778|     33|                     return;
 2779|     33|                  }
 2780|  16.8k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  16.8k|                     glz::generic key_node = std::move(element);
 2782|  16.8k|                     ++it;
 2783|  16.8k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  16.8k|                     glz::generic mapped{};
 2786|  16.8k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  16.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 1.79k, False: 15.1k]
  ------------------
 2788|  1.79k|                        return;
 2789|       |
 2790|  15.1k|                     std::string key;
 2791|  15.1k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 4, False: 15.1k]
  ------------------
 2792|      4|                        return;
 2793|       |
 2794|  15.1k|                     glz::generic pair{};
 2795|  15.1k|                     pair[key] = std::move(mapped);
 2796|  15.1k|                     element = std::move(pair);
 2797|       |
 2798|  15.1k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  15.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 5, False: 15.0k]
  ------------------
 2800|      5|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  16.8k|               }
 2807|       |
 2808|   115k|               adapter.append(value, std::move(element));
 2809|       |
 2810|   115k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 1.16k, False: 113k]
  ------------------
 2811|  1.16k|                  ctx.error = error_code::unexpected_end;
 2812|  1.16k|                  return;
 2813|  1.16k|               }
 2814|       |
 2815|   113k|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 44.3k, False: 69.5k]
  ------------------
 2816|  44.3k|                  ++it;
 2817|  44.3k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  44.3k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 132, False: 44.2k]
  ------------------
 2819|    132|                     return;
 2820|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|       |                     if (ctx.current_indent() < 0) {
 2822|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|       |                     }
 2824|       |                  }
 2825|  44.2k|                  return;
 2826|  44.3k|               }
 2827|  69.5k|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 66.2k, False: 3.37k]
  ------------------
 2828|  66.2k|                  ++it;
 2829|  66.2k|                  just_saw_comma = true;
 2830|  66.2k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  66.2k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 30, False: 66.1k]
  ------------------
 2832|     30|                     return;
 2833|  66.2k|               }
 2834|  3.37k|               else {
 2835|  3.37k|                  ctx.error = error_code::syntax_error;
 2836|  3.37k|                  return;
 2837|  3.37k|               }
 2838|   113k|            }
 2839|       |         }
 2840|       |         else if constexpr (!resizable<V>) {
 2841|       |            // Fixed-size containers (std::array)
 2842|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2843|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2844|       |               if (bool(ctx.error)) [[unlikely]]
 2845|       |                  return;
 2846|       |
 2847|       |               if (it == end) [[unlikely]] {
 2848|       |                  ctx.error = error_code::unexpected_end;
 2849|       |                  return;
 2850|       |               }
 2851|       |
 2852|       |               if (*it == ']') {
 2853|       |                  if (just_saw_comma) {
 2854|       |                     ++it;
 2855|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2856|       |                     if (bool(ctx.error)) [[unlikely]]
 2857|       |                        return;
 2858|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2859|       |                        if (ctx.current_indent() < 0) {
 2860|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2861|       |                        }
 2862|       |                     }
 2863|       |                     return;
 2864|       |                  }
 2865|       |                  ctx.error = error_code::syntax_error;
 2866|       |                  return;
 2867|       |               }
 2868|       |
 2869|       |               if (*it == ',' || *it == '#') {
 2870|       |                  ctx.error = error_code::syntax_error;
 2871|       |                  return;
 2872|       |               }
 2873|       |               just_saw_comma = false;
 2874|       |
 2875|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2876|       |
 2877|       |               if (bool(ctx.error)) [[unlikely]]
 2878|       |                  return;
 2879|       |
 2880|       |               adapter.commit_fixed_slot();
 2881|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2882|       |               if (bool(ctx.error)) [[unlikely]]
 2883|       |                  return;
 2884|       |
 2885|       |               if (it == end) [[unlikely]] {
 2886|       |                  ctx.error = error_code::unexpected_end;
 2887|       |                  return;
 2888|       |               }
 2889|       |
 2890|       |               if (*it == ']') {
 2891|       |                  ++it;
 2892|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2893|       |                  if (bool(ctx.error)) [[unlikely]]
 2894|       |                     return;
 2895|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2896|       |                     if (ctx.current_indent() < 0) {
 2897|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2898|       |                     }
 2899|       |                  }
 2900|       |                  return;
 2901|       |               }
 2902|       |               else if (*it == ',') {
 2903|       |                  ++it;
 2904|       |                  just_saw_comma = true;
 2905|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2906|       |                  if (bool(ctx.error)) [[unlikely]]
 2907|       |                     return;
 2908|       |               }
 2909|       |               else {
 2910|       |                  ctx.error = error_code::syntax_error;
 2911|       |                  return;
 2912|       |               }
 2913|       |            }
 2914|       |
 2915|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2916|       |            // skip to the closing bracket to consume overflow elements.
 2917|       |            int bracket_depth = 1;
 2918|       |            while (it != end && bracket_depth > 0) {
 2919|       |               if (*it == '[') {
 2920|       |                  ++bracket_depth;
 2921|       |               }
 2922|       |               else if (*it == ']') {
 2923|       |                  --bracket_depth;
 2924|       |               }
 2925|       |               ++it;
 2926|       |            }
 2927|       |         }
 2928|       |         else {
 2929|       |            ctx.error = error_code::syntax_error;
 2930|       |            return;
 2931|       |         }
 2932|  92.3k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   332k|      {
 2649|   332k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   332k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   332k|               value.clear();
 2653|   332k|            }
 2654|       |         }
 2655|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2656|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2657|       |            value.clear();
 2658|       |         }
 2659|   332k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2686|   113k|            {
 2687|   113k|               if constexpr (emplace_backable<V>) {
 2688|   113k|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|   113k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|   216k|      {
 3160|   216k|         using V = std::remove_cvref_t<T>;
 3161|   216k|         using value_type = typename V::value_type;
 3162|       |
 3163|   216k|         struct sequence_container_adapter
 3164|   216k|         {
 3165|   216k|            size_t index = 0;
 3166|       |
 3167|   216k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|   216k|            {
 3169|   216k|               if constexpr (!resizable<V>) {
 3170|   216k|                  return index >= container.size();
 3171|   216k|               }
 3172|   216k|               else {
 3173|   216k|                  (void)container;
 3174|   216k|                  return false;
 3175|   216k|               }
 3176|   216k|            }
 3177|       |
 3178|   216k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|   216k|            inline void append(V& container, value_type&& element) noexcept
 3181|   216k|            {
 3182|   216k|               if constexpr (emplace_backable<V>) {
 3183|   216k|                  container.emplace_back(std::move(element));
 3184|   216k|               }
 3185|   216k|               else if constexpr (emplaceable<V>) {
 3186|   216k|                  container.emplace(std::move(element));
 3187|   216k|               }
 3188|   216k|            }
 3189|   216k|         };
 3190|       |
 3191|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3192|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3193|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3194|   216k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|   216k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|   216k|         bool first_item = true;
 3200|   216k|         bool has_pending_item_anchor = false;
 3201|   216k|         std::string pending_item_anchor_name{};
 3202|   216k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   528k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 474k, False: 54.0k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   474k|            int32_t line_indent = 0;
 3215|   474k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   474k|            auto line_start = it;
 3217|       |
 3218|   639k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 613k, False: 25.5k]
  ------------------
 3219|   613k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 21.8k, False: 591k]
  ------------------
 3220|  21.8k|                  skip_comment(it, end);
 3221|  21.8k|                  skip_newline(it, end);
 3222|  21.8k|                  line_start = it;
 3223|  21.8k|                  line_indent = 0;
 3224|  21.8k|               }
 3225|   591k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 33.6k, False: 558k]
  |  Branch (3225:40): [True: 85.6k, False: 472k]
  ------------------
 3226|   119k|                  skip_newline(it, end);
 3227|   119k|                  line_start = it;
 3228|   119k|                  line_indent = 0;
 3229|   119k|               }
 3230|   472k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 44.4k, False: 427k]
  ------------------
 3231|  44.4k|                  line_start = it;
 3232|  44.4k|                  line_indent = 0;
 3233|   668k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 662k, False: 5.24k]
  |  Branch (3233:39): [True: 623k, False: 39.2k]
  ------------------
 3234|   623k|                     ++line_indent;
 3235|   623k|                     ++it;
 3236|   623k|                  }
 3237|       |
 3238|  44.4k|                  bool saw_tab = false;
 3239|  49.3k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 43.2k, False: 6.09k]
  |  Branch (3239:40): [True: 1.59k, False: 41.6k]
  |  Branch (3239:54): [True: 3.27k, False: 38.3k]
  ------------------
 3240|  4.86k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 2.77k, False: 2.08k]
  |  Branch (3240:43): [True: 2.08k, False: 0]
  ------------------
 3241|  4.86k|                     ++it;
 3242|  4.86k|                  }
 3243|       |
 3244|  44.4k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 6.09k, False: 38.3k]
  |  Branch (3244:36): [True: 1.97k, False: 36.3k]
  |  Branch (3244:51): [True: 3.39k, False: 32.9k]
  |  Branch (3244:66): [True: 6.72k, False: 26.2k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  18.1k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 12.0k, False: 6.09k]
  |  Branch (3246:39): [True: 6.72k, False: 5.37k]
  ------------------
 3247|  6.72k|                        skip_comment(it, end);
 3248|  6.72k|                     }
 3249|  18.1k|                     line_indent = 0;
 3250|  18.1k|                     continue;
 3251|  18.1k|                  }
 3252|       |
 3253|  26.2k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 56, False: 26.2k]
  ------------------
 3254|     56|                     ctx.error = error_code::syntax_error;
 3255|     56|                     return;
 3256|     56|                  }
 3257|  26.2k|                  break; // Found content
 3258|  26.2k|               }
 3259|   427k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 5.85k, False: 422k]
  ------------------
 3260|  5.85k|                  line_start = it;
 3261|  18.6k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 17.7k, False: 893]
  |  Branch (3261:40): [True: 3.96k, False: 13.7k]
  |  Branch (3261:54): [True: 8.81k, False: 4.95k]
  ------------------
 3262|  5.85k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 893, False: 4.95k]
  |  Branch (3262:36): [True: 1.27k, False: 3.67k]
  |  Branch (3262:51): [True: 1.02k, False: 2.65k]
  |  Branch (3262:66): [True: 2.58k, False: 78]
  ------------------
 3263|  5.77k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 4.88k, False: 893]
  |  Branch (3263:39): [True: 2.58k, False: 2.30k]
  ------------------
 3264|  2.58k|                        skip_comment(it, end);
 3265|  2.58k|                     }
 3266|  5.77k|                     line_indent = 0;
 3267|  5.77k|                     continue;
 3268|  5.77k|                  }
 3269|     78|                  ctx.error = error_code::syntax_error;
 3270|     78|                  return;
 3271|  5.85k|               }
 3272|   422k|               else {
 3273|       |                  // At content (no leading space on this line)
 3274|       |                  // If first item and at '-', whitespace was consumed by caller;
 3275|       |                  // treat as having correct indentation
 3276|   422k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 216k, False: 205k]
  |  Branch (3276:37): [True: 216k, False: 654]
  ------------------
 3277|   216k|                     line_indent = sequence_indent;
 3278|   216k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   216k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 216k, False: 0]
  |  Branch (3279:49): [True: 216k, False: 0]
  ------------------
 3280|   216k|                           auto probe = it;
 3281|   216k|                           int32_t leading_ws = 0;
 3282|   216k|                           bool saw_tab = false;
 3283|   498k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 498k, False: 0]
  |  Branch (3283:64): [True: 265k, False: 233k]
  |  Branch (3283:87): [True: 17.4k, False: 216k]
  ------------------
 3284|   282k|                              --probe;
 3285|   282k|                              ++leading_ws;
 3286|   282k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 12.0k, False: 270k]
  |  Branch (3286:52): [True: 10.2k, False: 260k]
  ------------------
 3287|   282k|                           }
 3288|   216k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 0, False: 216k]
  |  Branch (3288:61): [True: 10.8k, False: 205k]
  |  Branch (3288:85): [True: 77.0k, False: 128k]
  ------------------
 3289|  87.9k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 12, False: 87.9k]
  ------------------
 3290|     12|                                 ctx.error = error_code::syntax_error;
 3291|     12|                                 return;
 3292|     12|                              }
 3293|  87.9k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|  87.9k|                           }
 3295|   216k|                        }
 3296|   216k|                     }
 3297|   216k|                  }
 3298|   216k|                  break;
 3299|   422k|               }
 3300|   613k|            }
 3301|       |
 3302|   473k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 25.5k, False: 448k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   448k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 5.84k, False: 442k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   442k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 47.4k, False: 395k]
  ------------------
 3309|  47.4k|               it = line_start;
 3310|  47.4k|               return;
 3311|  47.4k|            }
 3312|       |
 3313|   395k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 20.0k, False: 375k]
  ------------------
 3314|       |               // Standalone anchor lines before "- item" are only supported for
 3315|       |               // indentless mapping values. At top-level block sequences these are
 3316|       |               // malformed in yaml-test-suite cases.
 3317|  20.0k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 16, False: 20.0k]
  ------------------
 3318|     16|                  ctx.error = error_code::syntax_error;
 3319|     16|                  return;
 3320|     16|               }
 3321|       |
 3322|  20.0k|               ++it;
 3323|  20.0k|               auto pending_name = parse_anchor_name(it, end);
 3324|  20.0k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 18, False: 19.9k]
  ------------------
 3325|     18|                  ctx.error = error_code::syntax_error;
 3326|     18|                  return;
 3327|     18|               }
 3328|  19.9k|               skip_inline_ws(it, end);
 3329|  19.9k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 19.8k, False: 118]
  |  Branch (3329:33): [True: 1.95k, False: 17.9k]
  ------------------
 3330|  1.95k|                  skip_comment(it, end);
 3331|  1.95k|               }
 3332|       |
 3333|  19.9k|               has_pending_item_anchor = true;
 3334|  19.9k|               pending_item_anchor_name = std::string(pending_name);
 3335|  19.9k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  19.9k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 125, False: 19.8k]
  |  Branch (3337:34): [True: 11.2k, False: 8.61k]
  |  Branch (3337:49): [True: 158, False: 11.0k]
  ------------------
 3338|    283|                  ctx.error = error_code::syntax_error;
 3339|    283|                  return;
 3340|    283|               }
 3341|       |
 3342|  19.7k|               skip_newline(it, end);
 3343|  19.7k|               continue;
 3344|  19.9k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   375k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 71.1k, False: 303k]
  ------------------
 3348|  71.1k|               it = line_start;
 3349|  71.1k|               return;
 3350|  71.1k|            }
 3351|       |
 3352|       |            // Compute the actual column of this sequence dash.
 3353|       |            // This is needed by plain-scalar multiline folding to distinguish
 3354|       |            // sibling "- item" entries from deeper "- " continuation content.
 3355|   303k|            dash_col = line_indent;
 3356|   303k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   303k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 303k, False: 12]
  ------------------
 3358|   303k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   303k|               }
 3360|   303k|            }
 3361|       |
 3362|   303k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   303k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 290k, False: 13.4k]
  |  Branch (3365:30): [True: 9.81k, False: 280k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  9.81k|               it = line_start;
 3368|  9.81k|               return;
 3369|  9.81k|            }
 3370|       |
 3371|   294k|            bool saw_tab_after_dash = false;
 3372|   540k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 524k, False: 16.8k]
  |  Branch (3372:34): [True: 168k, False: 355k]
  |  Branch (3372:48): [True: 78.6k, False: 277k]
  ------------------
 3373|   246k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 2.62k, False: 244k]
  |  Branch (3373:59): [True: 77.0k, False: 167k]
  ------------------
 3374|   246k|               ++it;
 3375|   246k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   294k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 77.0k, False: 217k]
  |  Branch (3377:39): [True: 75.8k, False: 1.14k]
  |  Branch (3377:52): [True: 1.09k, False: 74.7k]
  ------------------
 3378|  1.09k|               const auto after_dash = it + 1;
 3379|  1.09k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 8, False: 1.08k]
  |  Branch (3379:41): [True: 6, False: 1.07k]
  ------------------
 3380|     14|                  ctx.error = error_code::syntax_error;
 3381|     14|                  return;
 3382|     14|               }
 3383|  1.09k|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   294k|            auto parse_element = [&](auto& element) {
 3387|   294k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   294k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   294k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   294k|                     return;
 3397|   294k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   294k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   294k|                  ctx.sequence_item_value_context = true;
 3400|   294k|                  ctx.sequence_dash_indent = dash_col;
 3401|   294k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   294k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   294k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   294k|                  ctx.pop_indent();
 3405|   294k|               }
 3406|   294k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   294k|                  skip_ws_and_comment(it, end);
 3409|   294k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   294k|                  auto nested_start = it;
 3413|   294k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   294k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   294k|                     return;
 3416|   294k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   294k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   294k|                  if (nested_indent > effective_line_indent) {
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|   294k|                     const int32_t element_indent =
 3428|   294k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   294k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   294k|                        return;
 3431|   294k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   294k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   294k|                     ctx.sequence_item_value_context = true;
 3434|   294k|                     ctx.sequence_dash_indent = dash_col;
 3435|   294k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   294k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   294k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   294k|                     ctx.pop_indent();
 3439|   294k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   294k|               }
 3442|       |
 3443|   294k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   294k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   294k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   294k|                                                                      pending_item_anchor_indent};
 3447|   294k|                  has_pending_item_anchor = false;
 3448|   294k|               }
 3449|   294k|            };
 3450|       |
 3451|   294k|            if constexpr (emplace_backable<V>) {
 3452|   294k|               auto& element = value.emplace_back();
 3453|   294k|               parse_element(element);
 3454|       |            }
 3455|       |            else if constexpr (emplaceable<V>) {
 3456|       |               value_type element{};
 3457|       |               parse_element(element);
 3458|       |               if (!bool(ctx.error)) {
 3459|       |                  adapter.append(value, std::move(element));
 3460|       |               }
 3461|       |            }
 3462|       |            else if constexpr (!resizable<V>) {
 3463|       |               parse_element(value[adapter.index]);
 3464|       |               adapter.commit_fixed_slot();
 3465|       |            }
 3466|       |            else {
 3467|       |               ctx.error = error_code::syntax_error;
 3468|       |               return;
 3469|       |            }
 3470|       |
 3471|   294k|            first_item = false;
 3472|       |
 3473|   294k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 2.42k, False: 291k]
  ------------------
 3474|  2.42k|               return;
 3475|       |
 3476|       |            // Note: after parsing nested block content, iterator may already be
 3477|       |            // at the start of the next line. The outer loop will handle it.
 3478|   294k|         }
 3479|   216k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3386|   294k|            auto parse_element = [&](auto& element) {
 3387|   294k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 277k, False: 16.8k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   294k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 277k, False: 16.8k]
  |  Branch (3390:33): [True: 168k, False: 108k]
  ------------------
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   168k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 168k]
  ------------------
 3396|      0|                     return;
 3397|   168k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   168k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   168k|                  ctx.sequence_item_value_context = true;
 3400|   168k|                  ctx.sequence_dash_indent = dash_col;
 3401|   168k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   168k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   168k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   168k|                  ctx.pop_indent();
 3405|   168k|               }
 3406|   125k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   125k|                  skip_ws_and_comment(it, end);
 3409|   125k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   125k|                  auto nested_start = it;
 3413|   125k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   125k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 9, False: 125k]
  ------------------
 3415|      9|                     return;
 3416|   125k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   125k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 14.7k, False: 110k]
  ------------------
 3422|   125k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 16.7k, False: 108k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  16.7k|                     const int32_t element_indent =
 3428|  16.7k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 16.7k]
  ------------------
 3429|  16.7k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 16.7k]
  ------------------
 3430|      0|                        return;
 3431|  16.7k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  16.7k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  16.7k|                     ctx.sequence_item_value_context = true;
 3434|  16.7k|                     ctx.sequence_dash_indent = dash_col;
 3435|  16.7k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  16.7k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  16.7k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  16.7k|                     ctx.pop_indent();
 3439|  16.7k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   125k|               }
 3442|       |
 3443|   294k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 8.71k, False: 285k]
  |  Branch (3443:47): [True: 8.20k, False: 509]
  ------------------
 3444|  8.20k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 7.01k, False: 1.19k]
  ------------------
 3445|  8.20k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  8.20k|                                                                      pending_item_anchor_indent};
 3447|  8.20k|                  has_pending_item_anchor = false;
 3448|  8.20k|               }
 3449|   294k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_RNSI_12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5503|  1.11M|   {
 5504|  1.11M|      if constexpr (yaml::check_flow_context(Opts)) {
 5505|       |         // In flow context, only treat plain content as an implicit "key: value"
 5506|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5507|  1.11M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5508|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5509|       |            // once per entry per nesting level over the whole remaining flow collection.
 5510|  1.11M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5511|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5512|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5513|       |            // flow-context plain scalar, so every one of them is an indicator.
 5514|  1.11M|            bool at_node_start = true;
 5515|  1.11M|            int depth = 0;
 5516|  1.11M|            while (pos != stop) {
 5517|  1.11M|               const char c = *pos;
 5518|  1.11M|               if (c == ' ' || c == '\t') {
 5519|  1.11M|                  ++pos;
 5520|  1.11M|                  continue;
 5521|  1.11M|               }
 5522|  1.11M|               const bool node_start = std::exchange(at_node_start, false);
 5523|       |
 5524|  1.11M|               if ((c == '"' || c == '\'') && node_start) {
 5525|  1.11M|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5526|  1.11M|                  continue;
 5527|  1.11M|               }
 5528|  1.11M|               if (c == '[' || c == '{') {
 5529|  1.11M|                  ++depth;
 5530|  1.11M|                  at_node_start = true;
 5531|  1.11M|                  ++pos;
 5532|  1.11M|                  continue;
 5533|  1.11M|               }
 5534|  1.11M|               if (c == ']' || c == '}') {
 5535|  1.11M|                  if (depth == 0) return false;
 5536|  1.11M|                  --depth;
 5537|  1.11M|                  ++pos;
 5538|  1.11M|                  continue;
 5539|  1.11M|               }
 5540|  1.11M|               if (c == ',' && depth == 0) return false;
 5541|  1.11M|               if (c == ':' && depth == 0) {
 5542|  1.11M|                  auto next = pos + 1;
 5543|  1.11M|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5544|  1.11M|               }
 5545|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5546|  1.11M|               if (c == ',' || c == ':') {
 5547|  1.11M|                  at_node_start = true;
 5548|  1.11M|                  ++pos;
 5549|  1.11M|                  continue;
 5550|  1.11M|               }
 5551|  1.11M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5552|  1.11M|                  at_node_start = true;
 5553|  1.11M|                  continue;
 5554|  1.11M|               }
 5555|  1.11M|               ++pos;
 5556|  1.11M|            }
 5557|  1.11M|            return false;
 5558|  1.11M|         };
 5559|       |
 5560|  1.11M|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5560:14): [True: 471k, False: 642k]
  |  Branch (5560:49): [True: 16.4k, False: 625k]
  ------------------
 5561|   487k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5561:17): [True: 417k, False: 70.2k]
  ------------------
 5562|   417k|               return;
 5563|   417k|            }
 5564|  70.2k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5564:17): [True: 12.4k, False: 57.8k]
  ------------------
 5565|  12.4k|               return;
 5566|  12.4k|            }
 5567|  70.2k|         }
 5568|       |
 5569|   683k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5570|   683k|         return;
 5571|  1.11M|      }
 5572|       |
 5573|  1.11M|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5573:11): [True: 0, False: 1.11M]
  ------------------
 5574|      0|         return;
 5575|      0|      }
 5576|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5577|  1.11M|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5577:11): [True: 0, False: 1.11M]
  ------------------
 5578|      0|         return;
 5579|      0|      }
 5580|  1.11M|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5581|  1.11M|   }
_ZZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_RNSI_12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_ENKUlT_E_clISO_EEDaSX_:
 5507|  1.11M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5508|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5509|       |            // once per entry per nesting level over the whole remaining flow collection.
 5510|  1.11M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5511|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5512|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5513|       |            // flow-context plain scalar, so every one of them is an indicator.
 5514|  1.11M|            bool at_node_start = true;
 5515|  1.11M|            int depth = 0;
 5516|  15.7M|            while (pos != stop) {
  ------------------
  |  Branch (5516:20): [True: 15.5M, False: 126k]
  ------------------
 5517|  15.5M|               const char c = *pos;
 5518|  15.5M|               if (c == ' ' || c == '\t') {
  ------------------
  |  Branch (5518:20): [True: 1.90M, False: 13.6M]
  |  Branch (5518:32): [True: 269k, False: 13.4M]
  ------------------
 5519|  2.17M|                  ++pos;
 5520|  2.17M|                  continue;
 5521|  2.17M|               }
 5522|  13.4M|               const bool node_start = std::exchange(at_node_start, false);
 5523|       |
 5524|  13.4M|               if ((c == '"' || c == '\'') && node_start) {
  ------------------
  |  Branch (5524:21): [True: 118k, False: 13.2M]
  |  Branch (5524:33): [True: 34.7k, False: 13.2M]
  |  Branch (5524:47): [True: 68.5k, False: 84.4k]
  ------------------
 5525|  68.5k|                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
  ------------------
  |  Branch (5525:23): [True: 20.0k, False: 48.5k]
  ------------------
 5526|  48.5k|                  continue;
 5527|  68.5k|               }
 5528|  13.3M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5528:20): [True: 289k, False: 13.0M]
  |  Branch (5528:32): [True: 151k, False: 12.8M]
  ------------------
 5529|   441k|                  ++depth;
 5530|   441k|                  at_node_start = true;
 5531|   441k|                  ++pos;
 5532|   441k|                  continue;
 5533|   441k|               }
 5534|  12.8M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5534:20): [True: 90.2k, False: 12.8M]
  |  Branch (5534:32): [True: 154k, False: 12.6M]
  ------------------
 5535|   244k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5535:23): [True: 124k, False: 120k]
  ------------------
 5536|   120k|                  --depth;
 5537|   120k|                  ++pos;
 5538|   120k|                  continue;
 5539|   244k|               }
 5540|  12.6M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5540:20): [True: 554k, False: 12.0M]
  |  Branch (5540:32): [True: 273k, False: 281k]
  ------------------
 5541|  12.3M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5541:20): [True: 810k, False: 11.5M]
  |  Branch (5541:32): [True: 569k, False: 241k]
  ------------------
 5542|   569k|                  auto next = pos + 1;
 5543|   569k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5543:26): [True: 7.84k, False: 561k]
  |  Branch (5543:41): [True: 329k, False: 231k]
  |  Branch (5543:57): [True: 30.6k, False: 201k]
  |  Branch (5543:74): [True: 30.1k, False: 170k]
  |  Branch (5543:91): [True: 73.3k, False: 97.5k]
  ------------------
 5544|   569k|               }
 5545|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5546|  11.8M|               if (c == ',' || c == ':') {
  ------------------
  |  Branch (5546:20): [True: 281k, False: 11.5M]
  |  Branch (5546:32): [True: 241k, False: 11.2M]
  ------------------
 5547|   522k|                  at_node_start = true;
 5548|   522k|                  ++pos;
 5549|   522k|                  continue;
 5550|   522k|               }
 5551|  11.2M|               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
  ------------------
  |  Branch (5551:20): [True: 1.41M, False: 9.86M]
  |  Branch (5551:34): [True: 177k, False: 1.23M]
  ------------------
 5552|   177k|                  at_node_start = true;
 5553|   177k|                  continue;
 5554|   177k|               }
 5555|  11.1M|               ++pos;
 5556|  11.1M|            }
 5557|   126k|            return false;
 5558|  1.11M|         };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISN_EEDaSZ_:
 5938|  96.8k|            auto is_word_boundary = [&](const auto ptr) {
 5939|  96.8k|               if (ptr == end) {
  ------------------
  |  Branch (5939:20): [True: 4.30k, False: 92.5k]
  ------------------
 5940|  4.30k|                  return true;
 5941|  4.30k|               }
 5942|  92.5k|               if (*ptr == ':') {
  ------------------
  |  Branch (5942:20): [True: 46.5k, False: 46.0k]
  ------------------
 5943|  46.5k|                  auto next = ptr + 1;
 5944|  46.5k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5944:26): [True: 3.07k, False: 43.4k]
  |  Branch (5944:43): [True: 6.37k, False: 37.0k]
  |  Branch (5944:59): [True: 18.5k, False: 18.5k]
  |  Branch (5944:76): [True: 4.83k, False: 13.7k]
  |  Branch (5944:93): [True: 9.69k, False: 4.00k]
  ------------------
 5945|  46.5k|               }
 5946|  46.0k|               return is_plain_scalar_boundary(*ptr);
 5947|  92.5k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5864|  46.0k|            auto is_plain_scalar_boundary = [](const char ch) {
 5865|  46.0k|               switch (ch) {
 5866|  3.05k|               case ' ':
  ------------------
  |  Branch (5866:16): [True: 3.05k, False: 42.9k]
  ------------------
 5867|  6.37k|               case '\t':
  ------------------
  |  Branch (5867:16): [True: 3.31k, False: 42.7k]
  ------------------
 5868|  8.75k|               case '\n':
  ------------------
  |  Branch (5868:16): [True: 2.38k, False: 43.6k]
  ------------------
 5869|  15.0k|               case '\r':
  ------------------
  |  Branch (5869:16): [True: 6.27k, False: 39.7k]
  ------------------
 5870|  28.5k|               case ',':
  ------------------
  |  Branch (5870:16): [True: 13.5k, False: 32.4k]
  ------------------
 5871|  30.1k|               case ']':
  ------------------
  |  Branch (5871:16): [True: 1.61k, False: 44.4k]
  ------------------
 5872|  32.4k|               case '}':
  ------------------
  |  Branch (5872:16): [True: 2.24k, False: 43.7k]
  ------------------
 5873|  32.4k|                  return true;
 5874|  13.5k|               default:
  ------------------
  |  Branch (5874:16): [True: 13.5k, False: 32.4k]
  ------------------
 5875|  13.5k|                  return false;
 5876|  46.0k|               }
 5877|  46.0k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISN_EEDaSZ_:
 5879|  79.2k|            auto has_indented_block_continuation = [&](auto word_end) {
 5880|  79.2k|               if constexpr (yaml::check_flow_context(Opts)) {
 5881|  79.2k|                  return false;
 5882|  79.2k|               }
 5883|  79.2k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5883:20): [True: 0, False: 79.2k]
  ------------------
 5884|      0|                  return false;
 5885|      0|               }
 5886|  79.2k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5886:20): [True: 79.2k, False: 0]
  |  Branch (5886:40): [True: 0, False: 0]
  |  Branch (5886:61): [True: 0, False: 0]
  ------------------
 5887|      0|                  return false;
 5888|      0|               }
 5889|       |
 5890|  79.2k|               auto look = word_end;
 5891|  79.2k|               yaml::skip_newline(look, end);
 5892|  79.2k|               while (look != end) {
  ------------------
  |  Branch (5892:23): [True: 0, False: 79.2k]
  ------------------
 5893|      0|                  int32_t line_indent = 0;
 5894|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5894:26): [True: 0, False: 0]
  |  Branch (5894:41): [True: 0, False: 0]
  ------------------
 5895|      0|                     ++line_indent;
 5896|      0|                     ++look;
 5897|      0|                  }
 5898|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5898:23): [True: 0, False: 0]
  |  Branch (5898:38): [True: 0, False: 0]
  ------------------
 5899|      0|                     return false;
 5900|      0|                  }
 5901|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5901:23): [True: 0, False: 0]
  |  Branch (5901:38): [True: 0, False: 0]
  |  Branch (5901:55): [True: 0, False: 0]
  ------------------
 5902|      0|                     if (look != end) {
  ------------------
  |  Branch (5902:26): [True: 0, False: 0]
  ------------------
 5903|      0|                        yaml::skip_newline(look, end);
 5904|      0|                        continue;
 5905|      0|                     }
 5906|      0|                     return false;
 5907|      0|                  }
 5908|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5908:23): [True: 0, False: 0]
  ------------------
 5909|      0|                     yaml::skip_comment(look, end);
 5910|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5910:26): [True: 0, False: 0]
  |  Branch (5910:42): [True: 0, False: 0]
  |  Branch (5910:59): [True: 0, False: 0]
  ------------------
 5911|      0|                        yaml::skip_newline(look, end);
 5912|      0|                        continue;
 5913|      0|                     }
 5914|      0|                     return false;
 5915|      0|                  }
 5916|       |
 5917|       |                  // If the next non-empty line is an implicit mapping entry,
 5918|       |                  // don't treat it as scalar continuation for auto-deduced
 5919|       |                  // booleans/nulls.
 5920|      0|                  {
 5921|      0|                     auto scan = look;
 5922|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5922:29): [True: 0, False: 0]
  |  Branch (5922:44): [True: 0, False: 0]
  |  Branch (5922:61): [True: 0, False: 0]
  ------------------
 5923|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5923:29): [True: 0, False: 0]
  ------------------
 5924|      0|                           auto after_colon = scan + 1;
 5925|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5925:32): [True: 0, False: 0]
  |  Branch (5925:54): [True: 0, False: 0]
  |  Branch (5925:77): [True: 0, False: 0]
  ------------------
 5926|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5926:32): [True: 0, False: 0]
  |  Branch (5926:56): [True: 0, False: 0]
  ------------------
 5927|      0|                              return false;
 5928|      0|                           }
 5929|      0|                        }
 5930|      0|                        ++scan;
 5931|      0|                     }
 5932|      0|                  }
 5933|       |
 5934|      0|                  return line_indent > ctx.current_indent();
 5935|      0|               }
 5936|  79.2k|               return false;
 5937|  79.2k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5457|  2.92M|   {
 5458|  2.92M|      using counts = yaml_variant_type_count<Variant>;
 5459|       |      if constexpr (counts::n_object == 0) {
 5460|       |         return false;
 5461|       |      }
 5462|  2.92M|      else {
 5463|       |         // Quick check: if no viable mapping separator in the current span,
 5464|       |         // avoid expensive speculative parse.
 5465|  2.92M|         const bool could_be_mapping = [&] {
 5466|  2.92M|            if constexpr (yaml::check_flow_context(Opts)) {
 5467|  2.92M|               return line_could_be_flow_mapping(it, end);
 5468|  2.92M|            }
 5469|  2.92M|            else {
 5470|  2.92M|               return yaml::line_could_be_block_mapping(it, end);
 5471|  2.92M|            }
 5472|  2.92M|         }();
 5473|  2.92M|         if (!could_be_mapping) {
  ------------------
  |  Branch (5473:14): [True: 2.45M, False: 466k]
  ------------------
 5474|  2.45M|            return false;
 5475|  2.45M|         }
 5476|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5477|   466k|         auto temp_ctx = ctx.make_speculative();
 5478|   466k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5479|   466k|                                                                                               end);
 5480|   466k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5481|   466k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5482|   466k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5482:14): [True: 436k, False: 29.2k]
  ------------------
 5483|   436k|            ctx.anchors = std::move(temp_ctx.anchors);
 5484|   436k|            return true;
 5485|   436k|         }
 5486|       |         // The line matched "key: value" pattern but parsing failed.
 5487|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5488|       |         // so propagate the error rather than silently falling back to string.
 5489|  29.2k|         ctx.error = temp_ctx.error;
 5490|  29.2k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5491|  29.2k|         return false;
 5492|   466k|      }
 5493|  2.92M|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5465|  2.92M|         const bool could_be_mapping = [&] {
 5466|  2.92M|            if constexpr (yaml::check_flow_context(Opts)) {
 5467|  2.92M|               return line_could_be_flow_mapping(it, end);
 5468|       |            }
 5469|       |            else {
 5470|       |               return yaml::line_could_be_block_mapping(it, end);
 5471|       |            }
 5472|  2.92M|         }();
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4736|   132k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4737|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4738|       |                     val = {};
 4739|       |                     return true;
 4740|       |                  }
 4741|   132k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4742|   132k|                     val = glz::generic{};
 4743|   132k|                     return true;
 4744|       |                  }
 4745|       |                  else {
 4746|       |                     static constexpr std::string_view null_value{"null"};
 4747|       |                     auto null_it = null_value.data();
 4748|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4749|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4750|       |                     return !bool(ctx.error);
 4751|       |                  }
 4752|   132k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3711|   787k|      {
 3712|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3713|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3714|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3715|   787k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 787k]
  ------------------
 3716|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3716:17): [True: 0, False: 0]
  ------------------
 3717|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3718|      0|            }
 3719|      0|            ctx.forced_block_mapping_indent = -1;
 3720|      0|         }
 3721|   787k|         const int32_t parent_indent = ctx.current_indent();
 3722|   787k|         const bool discover_indent = (mapping_indent < 0);
 3723|   787k|         bool first_key = !discover_indent;
 3724|   787k|         bool discovered_first_key_mid_line = false;
 3725|   787k|         int32_t discovered_first_key_visual_indent = 0;
 3726|       |
 3727|  2.06M|         while (it != end) {
  ------------------
  |  Branch (3727:17): [True: 1.77M, False: 286k]
  ------------------
 3728|  1.77M|            auto line_start = it;
 3729|  1.77M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3729:35): [True: 0, False: 1.77M]
  ------------------
 3730|       |
 3731|       |            // Skip blank lines and comments, measure indent
 3732|  2.24M|            while (it != end) {
  ------------------
  |  Branch (3732:20): [True: 2.21M, False: 27.7k]
  ------------------
 3733|  2.21M|               if (*it == '#') {
  ------------------
  |  Branch (3733:20): [True: 55.0k, False: 2.16M]
  ------------------
 3734|  55.0k|                  skip_comment(it, end);
 3735|  55.0k|                  skip_newline(it, end);
 3736|  55.0k|                  first_key = false;
 3737|  55.0k|                  line_indent = 0;
 3738|  55.0k|               }
 3739|  2.16M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3739:25): [True: 237k, False: 1.92M]
  |  Branch (3739:40): [True: 121k, False: 1.80M]
  ------------------
 3740|   359k|                  skip_newline(it, end);
 3741|   359k|                  first_key = false;
 3742|   359k|                  line_indent = 0;
 3743|   359k|               }
 3744|  1.80M|               else if (*it == ' ') {
  ------------------
  |  Branch (3744:25): [True: 685k, False: 1.11M]
  ------------------
 3745|   685k|                  line_start = it;
 3746|   685k|                  line_indent = 0;
 3747|  3.60M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3747:26): [True: 3.59M, False: 4.65k]
  |  Branch (3747:39): [True: 2.91M, False: 680k]
  ------------------
 3748|  2.91M|                     ++line_indent;
 3749|  2.91M|                     ++it;
 3750|  2.91M|                  }
 3751|       |
 3752|   685k|                  bool saw_tab = false;
 3753|   695k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3753:26): [True: 690k, False: 5.38k]
  |  Branch (3753:40): [True: 1.17k, False: 689k]
  |  Branch (3753:54): [True: 9.39k, False: 679k]
  ------------------
 3754|  10.5k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3754:32): [True: 6.31k, False: 4.25k]
  |  Branch (3754:43): [True: 4.25k, False: 0]
  ------------------
 3755|  10.5k|                     ++it;
 3756|  10.5k|                  }
 3757|       |
 3758|   685k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3758:23): [True: 5.38k, False: 679k]
  |  Branch (3758:36): [True: 8.99k, False: 670k]
  |  Branch (3758:51): [True: 6.28k, False: 664k]
  |  Branch (3758:66): [True: 25.3k, False: 639k]
  ------------------
 3759|  46.0k|                     first_key = false;
 3760|  46.0k|                     line_indent = 0;
 3761|  46.0k|                     continue; // Blank or comment line
 3762|  46.0k|                  }
 3763|       |
 3764|   639k|                  if (saw_tab) {
  ------------------
  |  Branch (3764:23): [True: 119, False: 638k]
  ------------------
 3765|    119|                     ctx.error = error_code::syntax_error;
 3766|    119|                     return;
 3767|    119|                  }
 3768|       |
 3769|       |                  // Early dedent check
 3770|   638k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3770:23): [True: 636k, False: 2.72k]
  |  Branch (3770:46): [True: 486, False: 635k]
  ------------------
 3771|    486|                     it = line_start;
 3772|    486|                     return;
 3773|    486|                  }
 3774|       |
 3775|   638k|                  first_key = false;
 3776|   638k|                  break; // Found content
 3777|   638k|               }
 3778|  1.11M|               else if (*it == '\t') {
  ------------------
  |  Branch (3778:25): [True: 6.61k, False: 1.10M]
  ------------------
 3779|  6.61k|                  line_start = it;
 3780|  23.5k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3780:26): [True: 22.7k, False: 807]
  |  Branch (3780:40): [True: 4.43k, False: 18.2k]
  |  Branch (3780:54): [True: 12.4k, False: 5.80k]
  ------------------
 3781|  6.61k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3781:23): [True: 807, False: 5.80k]
  |  Branch (3781:36): [True: 1.32k, False: 4.48k]
  |  Branch (3781:51): [True: 2.50k, False: 1.98k]
  |  Branch (3781:66): [True: 1.77k, False: 216]
  ------------------
 3782|  6.40k|                     first_key = false;
 3783|  6.40k|                     line_indent = 0;
 3784|  6.40k|                     continue; // Blank or comment-only line with tab indentation
 3785|  6.40k|                  }
 3786|    216|                  ctx.error = error_code::syntax_error;
 3787|    216|                  return;
 3788|  6.61k|               }
 3789|  1.10M|               else {
 3790|  1.10M|                  line_start = it;
 3791|  1.10M|                  break; // Content at column 0
 3792|  1.10M|               }
 3793|  2.21M|            }
 3794|       |
 3795|  1.77M|            if (it == end) break;
  ------------------
  |  Branch (3795:17): [True: 27.7k, False: 1.74M]
  ------------------
 3796|       |
 3797|       |            // Document boundaries terminate the current mapping in both discovered
 3798|       |            // and fixed-indent modes.
 3799|  1.74M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3799:17): [True: 3.43k, False: 1.74M]
  |  Branch (3799:45): [True: 1.92k, False: 1.74M]
  ------------------
 3800|       |
 3801|       |            // Dedent checks (skip on first key for struct case)
 3802|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3803|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3804|  1.74M|            if (!first_key) {
  ------------------
  |  Branch (3804:17): [True: 1.74M, False: 0]
  ------------------
 3805|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3806|  1.74M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3806:20): [True: 1.74M, False: 0]
  |  Branch (3806:39): [True: 956k, False: 785k]
  |  Branch (3806:62): [True: 486k, False: 469k]
  |  Branch (3806:84): [True: 370k, False: 116k]
  ------------------
 3807|   370k|                  it = line_start;
 3808|   370k|                  return;
 3809|   370k|               }
 3810|  1.37M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3810:20): [True: 586k, False: 785k]
  |  Branch (3810:43): [True: 365, False: 585k]
  ------------------
 3811|    365|                  it = line_start;
 3812|    365|                  return;
 3813|    365|               }
 3814|  1.37M|            }
 3815|       |
 3816|       |            // Establish mapping indent from first key (map case)
 3817|  1.37M|            bool established_mapping_indent_this_line = false;
 3818|  1.37M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3818:17): [True: 785k, False: 585k]
  ------------------
 3819|   785k|               mapping_indent = line_indent;
 3820|   785k|               established_mapping_indent_this_line = true;
 3821|   785k|               discovered_first_key_visual_indent = line_indent;
 3822|   785k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3823|   785k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3823:23): [True: 785k, False: 0]
  |  Branch (3823:43): [True: 771k, False: 14.4k]
  ------------------
 3824|   771k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3825|   771k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3825:26): [True: 567, False: 770k]
  ------------------
 3826|    567|                        ctx.error = error_code::syntax_error;
 3827|    567|                        return;
 3828|    567|                     }
 3829|       |
 3830|   770k|                     discovered_first_key_mid_line = prefix.has_content;
 3831|   770k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3831:26): [True: 767k, False: 2.72k]
  |  Branch (3831:49): [True: 678k, False: 89.2k]
  ------------------
 3832|   678k|                        discovered_first_key_visual_indent = prefix.column;
 3833|   678k|                     }
 3834|   770k|                  }
 3835|   785k|               }
 3836|   785k|            }
 3837|       |
 3838|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3839|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3840|  1.37M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3840:17): [True: 1.37M, False: 567]
  |  Branch (3840:36): [True: 1.37M, False: 0]
  |  Branch (3840:59): [True: 585k, False: 784k]
  ------------------
 3841|   585k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3841:17): [True: 118k, False: 467k]
  ------------------
 3842|   118k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3842:20): [True: 116k, False: 1.56k]
  |  Branch (3842:43): [True: 55.5k, False: 60.9k]
  ------------------
 3843|  55.5k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3843:23): [True: 81, False: 55.4k]
  ------------------
 3844|     81|                     ctx.error = error_code::syntax_error;
 3845|     81|                     return;
 3846|     81|                  }
 3847|  55.4k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3847:23): [True: 3.50k, False: 51.9k]
  ------------------
 3848|  3.50k|                     it = line_start;
 3849|  3.50k|                     return;
 3850|  3.50k|                  }
 3851|  55.4k|               }
 3852|  62.4k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3852:25): [True: 2.09k, False: 60.3k]
  ------------------
 3853|  2.09k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3853:26): [True: 846, False: 1.24k]
  |  Branch (3853:47): [True: 6, False: 1.23k]
  ------------------
 3854|  1.23k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3854:27): [True: 1.23k, False: 0]
  |  Branch (3854:49): [True: 1.23k, False: 0]
  |  Branch (3854:72): [True: 24, False: 1.21k]
  ------------------
 3855|    876|                  ctx.error = error_code::syntax_error;
 3856|    876|                  return;
 3857|    876|               }
 3858|   118k|            }
 3859|       |
 3860|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3861|       |            // handle '- ' which produces appropriate errors for misindented items)
 3862|  1.36M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3862:17): [True: 0, False: 1.36M]
  |  Branch (3862:37): [True: 0, False: 0]
  ------------------
 3863|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3863:18): [True: 0, False: 0]
  |  Branch (3863:37): [True: 0, False: 0]
  |  Branch (3863:57): [True: 0, False: 0]
  |  Branch (3863:78): [True: 0, False: 0]
  ------------------
 3864|      0|               it = line_start;
 3865|      0|               return;
 3866|      0|            }
 3867|       |
 3868|       |            // Skip indented comment lines
 3869|  1.36M|            if (*it == '#') {
  ------------------
  |  Branch (3869:17): [True: 0, False: 1.36M]
  ------------------
 3870|      0|               skip_comment(it, end);
 3871|      0|               first_key = false;
 3872|      0|               continue;
 3873|      0|            }
 3874|       |
 3875|       |            // Skip blank/empty lines after indent
 3876|  1.36M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3876:17): [True: 567, False: 1.36M]
  |  Branch (3876:32): [True: 0, False: 1.36M]
  ------------------
 3877|      0|               first_key = false;
 3878|      0|               continue;
 3879|      0|            }
 3880|       |
 3881|       |            // While parsing an explicit mapping key node ('? key-node'),
 3882|       |            // a subsequent standalone ':' at the same indentation starts
 3883|       |            // the outer value indicator and must terminate this key-node map.
 3884|       |            // Keep same-line ': x' on the first key-node line valid.
 3885|  1.36M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3885:17): [True: 365k, False: 1.00M]
  |  Branch (3885:53): [True: 97.5k, False: 268k]
  |  Branch (3885:94): [True: 32.6k, False: 64.9k]
  ------------------
 3886|  32.6k|               const auto after_colon = it + 1;
 3887|  32.6k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3887:64): [True: 24.6k, False: 7.98k]
  ------------------
 3888|  32.6k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3888:21): [True: 2.62k, False: 29.9k]
  |  Branch (3888:43): [True: 23.6k, False: 6.32k]
  ------------------
 3889|  26.2k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3889:20): [True: 4.59k, False: 21.6k]
  ------------------
 3890|  4.59k|                  it = line_start;
 3891|  4.59k|                  return;
 3892|  4.59k|               }
 3893|  32.6k|            }
 3894|       |
 3895|       |            // Process this mapping entry (key + colon + value)
 3896|  1.36M|            int32_t effective_line_indent = line_indent;
 3897|  1.36M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3897:17): [True: 1.36M, False: 567]
  |  Branch (3897:36): [True: 784k, False: 576k]
  ------------------
 3898|   784k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3898:17): [True: 678k, False: 106k]
  ------------------
 3899|   678k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3899:19): [True: 524k, False: 154k]
  |  Branch (3899:52): [True: 65.9k, False: 458k]
  ------------------
 3900|       |               // The first discovered key has no indentation of its own left to measure: it may
 3901|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3902|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3903|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3904|       |               // key with an empty value takes the following sibling line for nested content
 3905|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3906|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3907|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3908|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3909|       |               // 7FWL and HMQ5 pin that case.
 3910|   612k|               effective_line_indent = discovered_first_key_visual_indent;
 3911|   612k|            }
 3912|       |
 3913|  1.36M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3913:17): [True: 87.0k, False: 1.27M]
  ------------------
 3914|  87.0k|               return;
 3915|  87.0k|            }
 3916|  1.27M|            first_key = false;
 3917|       |
 3918|  1.27M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3918:17): [True: 0, False: 1.27M]
  ------------------
 3919|      0|               return;
 3920|       |
 3921|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3922|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3923|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3924|       |               auto flow_end = it;
 3925|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3926|       |               if (bool(ctx.error)) [[unlikely]]
 3927|       |                  return;
 3928|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3929|       |                  it = flow_end;
 3930|       |                  return;
 3931|       |               }
 3932|       |            }
 3933|       |
 3934|       |            // Trailing whitespace handling (peek-ahead pattern).
 3935|       |            // After parsing, iterator may be at leading indent of next line.
 3936|       |            // Don't consume it - let the outer loop handle indent measurement.
 3937|  1.27M|            if (it != end) {
  ------------------
  |  Branch (3937:17): [True: 1.05M, False: 225k]
  ------------------
 3938|  1.05M|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3938:20): [True: 518k, False: 531k]
  |  Branch (3938:34): [True: 6.38k, False: 525k]
  ------------------
 3939|   524k|                  auto peek = it;
 3940|   524k|                  skip_inline_ws(peek, end);
 3941|   524k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3941:23): [True: 523k, False: 1.19k]
  |  Branch (3941:38): [True: 515k, False: 8.53k]
  |  Branch (3941:55): [True: 501k, False: 13.1k]
  |  Branch (3941:72): [True: 496k, False: 5.79k]
  ------------------
 3942|   496k|                     continue; // At leading indent of new line
 3943|   496k|                  }
 3944|   524k|               }
 3945|   554k|               skip_inline_ws(it, end);
 3946|   554k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3946:20): [True: 553k, False: 1.19k]
  |  Branch (3946:33): [True: 27.8k, False: 525k]
  ------------------
 3947|  27.8k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3948|  27.8k|                     if (it > line_start) {
  ------------------
  |  Branch (3948:26): [True: 27.8k, False: 0]
  ------------------
 3949|  27.8k|                        const char prev = *(it - 1);
 3950|  27.8k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3950:29): [True: 10.4k, False: 17.4k]
  |  Branch (3950:44): [True: 8.24k, False: 2.18k]
  |  Branch (3950:60): [True: 4.90k, False: 3.33k]
  |  Branch (3950:76): [True: 22, False: 4.88k]
  ------------------
 3951|     22|                           ctx.error = error_code::syntax_error;
 3952|     22|                           return;
 3953|     22|                        }
 3954|  27.8k|                     }
 3955|  27.8k|                  }
 3956|  27.8k|               }
 3957|  27.8k|               skip_comment(it, end);
 3958|   554k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3958:20): [True: 552k, False: 2.18k]
  |  Branch (3958:34): [True: 205k, False: 346k]
  |  Branch (3958:49): [True: 164k, False: 181k]
  ------------------
 3959|   370k|                  skip_newline(it, end);
 3960|   370k|               }
 3961|   184k|               else if (it != end) {
  ------------------
  |  Branch (3961:25): [True: 181k, False: 2.18k]
  ------------------
 3962|       |                  // The entry stopped part way along its line with something other than
 3963|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3964|       |                  // separator, say. The next pass measures indent as though this were the start
 3965|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3966|   181k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3967|   181k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3967:26): [True: 1.28k, False: 180k]
  ------------------
 3968|  1.28k|                        ctx.error = error_code::syntax_error;
 3969|  1.28k|                        return;
 3970|  1.28k|                     }
 3971|   181k|                  }
 3972|   181k|               }
 3973|   554k|            }
 3974|  1.27M|         }
 3975|   787k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_i:
 4855|  1.36M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4856|  1.36M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|  1.36M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4858|  1.36M|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|  1.36M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|  1.36M|                           if (ctx.stream_begin) {
 4866|  1.36M|                              auto is_line_content_start = [&](auto pos) {
 4867|  1.36M|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|  1.36M|                              };
 4869|       |
 4870|  1.36M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|  1.36M|                                 const char* line = ctx.line_begin_of(pos);
 4872|  1.36M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|  1.36M|                                 return line != end && *line == ':';
 4874|  1.36M|                              };
 4875|       |
 4876|  1.36M|                              if (!is_line_content_start(it) &&
 4877|  1.36M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4878|  1.36M|                                  !line_has_explicit_value_indicator(it)) {
 4879|  1.36M|                                 ctx.error = error_code::syntax_error;
 4880|  1.36M|                                 return false;
 4881|  1.36M|                              }
 4882|  1.36M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|  1.36M|                           }
 4884|  1.36M|                        }
 4885|       |
 4886|  1.36M|                        if (*it == '-' &&
 4887|  1.36M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4888|  1.36M|                            !line_starts_with_explicit_value_indicator) {
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|  1.36M|                           ctx.error = error_code::syntax_error;
 4891|  1.36M|                           return false;
 4892|  1.36M|                        }
 4893|       |
 4894|  1.36M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4895|  1.36M|                           return false;
 4896|  1.36M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|  1.36M|                        ctx.pop_indent();
 4898|  1.36M|                     }
 4899|  1.36M|                     else {
 4900|  1.36M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|  1.36M|                        if (nested_indent >= 0) {
 4902|  1.36M|                           yaml::skip_to_content(it, end);
 4903|  1.36M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4904|  1.36M|                              ctx.error = error_code::syntax_error;
 4905|  1.36M|                              return false;
 4906|  1.36M|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|  1.36M|                           const int32_t value_indent =
 4910|  1.36M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4911|  1.36M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4912|  1.36M|                              return false;
 4913|  1.36M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|  1.36M|                           ctx.pop_indent();
 4915|  1.36M|                        }
 4916|  1.36M|                     }
 4917|  1.36M|                     return !bool(ctx.error);
 4918|  1.36M|                  };
 4919|       |
 4920|       |                  // Explicit key entry form:
 4921|       |                  // ? key
 4922|       |                  // : value
 4923|  1.36M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4923:23): [True: 333k, False: 1.02M]
  |  Branch (4923:37): [True: 331k, False: 1.15k]
  |  Branch (4923:58): [True: 15, False: 331k]
  ------------------
 4924|     15|                     ctx.error = error_code::syntax_error;
 4925|     15|                     return false;
 4926|     15|                  }
 4927|  1.36M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4927:23): [True: 333k, False: 1.02M]
  |  Branch (4927:38): [True: 1.15k, False: 331k]
  |  Branch (4927:57): [True: 130k, False: 201k]
  |  Branch (4927:77): [True: 130k, False: 70.2k]
  |  Branch (4927:98): [True: 61.5k, False: 8.74k]
  ------------------
 4928|   324k|                     ++it; // skip '?'
 4929|   324k|                     yaml::skip_inline_ws(it, end);
 4930|       |
 4931|   324k|                     const int32_t explicit_value_indicator_indent =
 4932|   324k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4932:25): [True: 114k, False: 210k]
  ------------------
 4933|       |
 4934|   324k|                     key_t key{};
 4935|   324k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4936|   324k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   324k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   324k|                        };
 4939|       |
 4940|   324k|                        auto key_it = it;
 4941|   324k|                        yaml::skip_inline_ws(key_it, end);
 4942|       |
 4943|   324k|                        auto content = key_it;
 4944|   324k|                        yaml::skip_to_content(content, end);
 4945|   324k|                        bool handled_anchor_only_empty_key = false;
 4946|       |
 4947|       |                        // Anchor on an empty explicit key node:
 4948|       |                        //   ? &a
 4949|       |                        //   : value
 4950|   324k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4950:29): [True: 316k, False: 7.44k]
  |  Branch (4950:47): [True: 73.0k, False: 243k]
  ------------------
 4951|  73.0k|                           auto anchor_probe = content + 1;
 4952|  73.0k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4953|  73.0k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4953:32): [True: 73.0k, False: 53]
  ------------------
 4954|  73.0k|                              auto after_anchor = anchor_probe;
 4955|  73.0k|                              yaml::skip_inline_ws(after_anchor, end);
 4956|       |
 4957|  73.0k|                              auto value_indicator = after_anchor;
 4958|  73.0k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4958:35): [True: 71.6k, False: 1.33k]
  |  Branch (4958:61): [True: 7.04k, False: 64.6k]
  ------------------
 4959|  7.04k|                                 key.clear();
 4960|  7.04k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4961|  7.04k|                                 it = value_indicator;
 4962|  7.04k|                                 handled_anchor_only_empty_key = true;
 4963|  7.04k|                              }
 4964|  65.9k|                              else {
 4965|  65.9k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4965:38): [True: 64.6k, False: 1.33k]
  |  Branch (4965:64): [True: 2.84k, False: 61.7k]
  ------------------
 4966|  2.84k|                                    yaml::skip_comment(value_indicator, end);
 4967|  2.84k|                                 }
 4968|  65.9k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4968:38): [True: 63.5k, False: 2.40k]
  |  Branch (4968:65): [True: 9.01k, False: 54.5k]
  |  Branch (4968:93): [True: 17.7k, False: 36.7k]
  ------------------
 4969|  26.7k|                                    yaml::skip_newline(value_indicator, end);
 4970|  26.7k|                                    auto value_line = value_indicator;
 4971|  26.7k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4972|  26.7k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4972:41): [True: 9, False: 26.7k]
  ------------------
 4973|      9|                                       return false;
 4974|  26.7k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4974:41): [True: 21.9k, False: 4.77k]
  |  Branch (4974:62): [True: 2.34k, False: 19.6k]
  ------------------
 4975|  2.34k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4975:41): [True: 2.32k, False: 19]
  ------------------
 4976|  2.32k|                                       key.clear();
 4977|  2.32k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4978|  2.32k|                                       it = value_line;
 4979|  2.32k|                                       handled_anchor_only_empty_key = true;
 4980|  2.32k|                                    }
 4981|  24.4k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4981:46): [True: 19.6k, False: 4.77k]
  |  Branch (4981:67): [True: 19, False: 19.6k]
  ------------------
 4982|       |                                       // In explicit-key form ("? &a"), a following ':'
 4983|       |                                       // starts the outer value indicator only at the same
 4984|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4985|     19|                                       ctx.error = error_code::syntax_error;
 4986|     19|                                       return false;
 4987|     19|                                    }
 4988|  26.7k|                                 }
 4989|  65.9k|                              }
 4990|  73.0k|                           }
 4991|  73.0k|                        }
 4992|       |
 4993|   324k|                        const bool key_content_spans_lines = [&] {
 4994|   324k|                           auto scan = key_it;
 4995|   324k|                           while (scan != content && scan != end) {
 4996|   324k|                              if (*scan == '\n' || *scan == '\r') return true;
 4997|   324k|                              ++scan;
 4998|   324k|                           }
 4999|   324k|                           return false;
 5000|   324k|                        }();
 5001|       |
 5002|   324k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (5002:29): [True: 9.37k, False: 314k]
  ------------------
 5003|       |                           // 'it' already points to the explicit value indicator ':'
 5004|  9.37k|                        }
 5005|   314k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (5005:34): [True: 7.44k, False: 307k]
  |  Branch (5005:53): [True: 14.7k, False: 292k]
  |  Branch (5005:72): [True: 10.0k, False: 4.72k]
  ------------------
 5006|  17.4k|                           key.clear();
 5007|  17.4k|                           it = content;
 5008|  17.4k|                        }
 5009|   297k|                        else {
 5010|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 5011|       |                           // Parse the key node structurally (not via plain-key scanning)
 5012|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 5013|       |                           // as complex keys, not split into implicit key/value pairs.
 5014|   297k|                           auto key_node_it = content;
 5015|   297k|                           auto key_node_end = end;
 5016|   297k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 5017|       |                              // In explicit-key form, a following standalone ':'
 5018|       |                              // line (same or lower indentation) belongs to the
 5019|       |                              // outer mapping value, not the key node itself.
 5020|   297k|                              auto scan = content;
 5021|  7.51M|                              while (scan != end) {
  ------------------
  |  Branch (5021:38): [True: 7.33M, False: 174k]
  ------------------
 5022|   205M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5022:41): [True: 205M, False: 64.7k]
  |  Branch (5022:56): [True: 202M, False: 3.26M]
  |  Branch (5022:73): [True: 198M, False: 4.00M]
  ------------------
 5023|   198M|                                    ++scan;
 5024|   198M|                                 }
 5025|  7.33M|                                 if (scan == end) {
  ------------------
  |  Branch (5025:38): [True: 64.7k, False: 7.27M]
  ------------------
 5026|  64.7k|                                    break;
 5027|  64.7k|                                 }
 5028|       |
 5029|  7.27M|                                 yaml::skip_newline(scan, end);
 5030|  7.27M|                                 auto line_start = scan;
 5031|       |
 5032|  7.27M|                                 int32_t indicator_indent = 0;
 5033|  11.8M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (5033:41): [True: 11.6M, False: 174k]
  |  Branch (5033:56): [True: 4.53M, False: 7.09M]
  ------------------
 5034|  4.53M|                                    ++indicator_indent;
 5035|  4.53M|                                    ++scan;
 5036|  4.53M|                                 }
 5037|       |
 5038|  7.27M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (5038:38): [True: 7.09M, False: 174k]
  |  Branch (5038:53): [True: 710k, False: 6.38M]
  ------------------
 5039|   710k|                                    const auto after_colon = scan + 1;
 5040|   710k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (5040:42): [True: 1.92k, False: 709k]
  ------------------
 5041|   709k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (5041:42): [True: 588k, False: 120k]
  ------------------
 5042|   590k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (5042:41): [True: 57.8k, False: 532k]
  ------------------
 5043|  57.8k|                                       key_node_end = line_start;
 5044|  57.8k|                                       break;
 5045|  57.8k|                                    }
 5046|   710k|                                 }
 5047|  7.27M|                              }
 5048|   297k|                           }
 5049|       |
 5050|   297k|                           glz::generic key_node{};
 5051|   297k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 5052|   297k|                           ctx.explicit_mapping_key_context = true;
 5053|   297k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 5054|   297k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 5055|   297k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5055:32): [True: 17.3k, False: 280k]
  ------------------
 5056|  17.3k|                              return false;
 5057|   280k|                           it = key_node_it;
 5058|   280k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (5058:32): [True: 66, False: 280k]
  ------------------
 5059|     66|                              return false;
 5060|   280k|                        }
 5061|       |                     }
 5062|       |                     else {
 5063|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 5064|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5065|       |                           if (bool(ctx.error)) [[unlikely]]
 5066|       |                              return false;
 5067|       |                        }
 5068|       |                     }
 5069|       |
 5070|   306k|                     yaml::skip_inline_ws(it, end);
 5071|   324k|                     yaml::skip_comment(it, end);
 5072|       |
 5073|       |                     // Value indicator may appear on the next line at the same indent.
 5074|   324k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5074:26): [True: 219k, False: 105k]
  |  Branch (5074:40): [True: 57.0k, False: 161k]
  |  Branch (5074:55): [True: 59.4k, False: 102k]
  ------------------
 5075|   116k|                        auto probe = it;
 5076|   116k|                        bool found_value_indicator = false;
 5077|       |
 5078|   243k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5078:32): [True: 199k, False: 44.1k]
  |  Branch (5078:49): [True: 76.1k, False: 122k]
  |  Branch (5078:67): [True: 122k, False: 76]
  ------------------
 5079|   198k|                           yaml::skip_newline(probe, end);
 5080|       |
 5081|   198k|                           auto value_line = probe;
 5082|   198k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5083|   198k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5083:32): [True: 16, False: 198k]
  ------------------
 5084|     16|                              return false;
 5085|       |
 5086|   198k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5086:32): [True: 43.7k, False: 155k]
  |  Branch (5086:53): [True: 6.08k, False: 149k]
  |  Branch (5086:76): [True: 58.8k, False: 90.3k]
  ------------------
 5087|   108k|                              probe = value_line;
 5088|   108k|                              continue; // blank line
 5089|   108k|                           }
 5090|  90.3k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5090:32): [True: 18.0k, False: 72.2k]
  ------------------
 5091|  18.0k|                              yaml::skip_comment(value_line, end);
 5092|  18.0k|                              probe = value_line;
 5093|  18.0k|                              continue; // comment-only line
 5094|  18.0k|                           }
 5095|  72.2k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5095:32): [True: 14.6k, False: 57.6k]
  |  Branch (5095:54): [True: 4.14k, False: 10.5k]
  ------------------
 5096|  4.14k|                              it = value_line;
 5097|  4.14k|                              found_value_indicator = true;
 5098|  4.14k|                           }
 5099|  72.2k|                           break;
 5100|  90.3k|                        }
 5101|       |
 5102|   116k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5102:29): [True: 4.14k, False: 112k]
  ------------------
 5103|  4.14k|                           yaml::skip_inline_ws(it, end);
 5104|  4.14k|                        }
 5105|   116k|                     }
 5106|       |
 5107|   324k|                     val_t val{};
 5108|   324k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5108:26): [True: 219k, False: 105k]
  |  Branch (5108:39): [True: 79.9k, False: 139k]
  ------------------
 5109|  79.9k|                        ++it;
 5110|  79.9k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5110:29): [True: 79.2k, False: 724]
  |  Branch (5110:42): [True: 15, False: 79.2k]
  ------------------
 5111|     15|                           ctx.error = error_code::syntax_error;
 5112|     15|                           return false;
 5113|     15|                        }
 5114|  79.9k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5114:29): [True: 79.2k, False: 724]
  |  Branch (5114:43): [True: 4.54k, False: 74.6k]
  |  Branch (5114:58): [True: 12.3k, False: 62.3k]
  ------------------
 5115|  16.8k|                           auto probe = it;
 5116|  16.8k|                           yaml::skip_newline(probe, end);
 5117|  44.9k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5117:35): [True: 42.1k, False: 2.89k]
  |  Branch (5117:51): [True: 28.0k, False: 14.0k]
  ------------------
 5118|  16.8k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5118:32): [True: 14.0k, False: 2.89k]
  |  Branch (5118:48): [True: 2.13k, False: 11.8k]
  |  Branch (5118:65): [True: 1.84k, False: 288]
  |  Branch (5118:89): [True: 4, False: 1.83k]
  ------------------
 5119|      4|                              ctx.error = error_code::syntax_error;
 5120|      4|                              return false;
 5121|      4|                           }
 5122|  16.8k|                        }
 5123|  79.9k|                        yaml::skip_inline_ws(it, end);
 5124|  79.9k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5124:29): [True: 1.40k, False: 78.5k]
  ------------------
 5125|  1.40k|                           return false;
 5126|  79.9k|                     }
 5127|       |
 5128|   322k|                     value.emplace(std::move(key), std::move(val));
 5129|   322k|                     return true;
 5130|   324k|                  }
 5131|       |
 5132|  1.03M|                  key_t key{};
 5133|  1.03M|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5134|  1.03M|                     auto key_probe = it;
 5135|  1.03M|                     yaml::skip_inline_ws(key_probe, end);
 5136|  1.03M|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5136:53): [True: 1.03M, False: 0]
  |  Branch (5136:74): [True: 3.81k, False: 1.03M]
  |  Branch (5136:95): [True: 2.11k, False: 1.03M]
  ------------------
 5137|  1.03M|                     if (complex_flow_key) {
  ------------------
  |  Branch (5137:26): [True: 5.93k, False: 1.03M]
  ------------------
 5138|  5.93k|                        glz::generic key_node{};
 5139|  5.93k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5140|  5.93k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5140:29): [True: 1.60k, False: 4.32k]
  ------------------
 5141|  1.60k|                           return false;
 5142|  4.32k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5142:29): [True: 4, False: 4.32k]
  ------------------
 5143|      4|                           return false;
 5144|  4.32k|                     }
 5145|  1.03M|                     else {
 5146|  1.03M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5146:29): [True: 8.23k, False: 1.02M]
  ------------------
 5147|  8.23k|                           return false;
 5148|  8.23k|                        }
 5149|  1.03M|                     }
 5150|       |                  }
 5151|       |                  else {
 5152|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5153|       |                     if (bool(ctx.error)) [[unlikely]]
 5154|       |                        return false;
 5155|       |                  }
 5156|       |
 5157|  1.02M|                  yaml::skip_inline_ws(it, end);
 5158|       |
 5159|  1.03M|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5159:23): [True: 10.6k, False: 1.02M]
  |  Branch (5159:36): [True: 2.64k, False: 1.02M]
  ------------------
 5160|  3.41k|                     ctx.error = error_code::syntax_error;
 5161|  3.41k|                     return false;
 5162|  3.41k|                  }
 5163|  1.03M|                  ++it;
 5164|  1.03M|                  yaml::skip_inline_ws(it, end);
 5165|       |
 5166|  1.03M|                  val_t val{};
 5167|  1.03M|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5167:23): [True: 54.9k, False: 979k]
  ------------------
 5168|  54.9k|                     return false;
 5169|       |
 5170|   979k|                  value.emplace(std::move(key), std::move(val));
 5171|   979k|                  return true;
 5172|  1.03M|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlvE_clEv:
 4993|   324k|                        const bool key_content_spans_lines = [&] {
 4994|   324k|                           auto scan = key_it;
 4995|   352k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4995:35): [True: 225k, False: 127k]
  |  Branch (4995:54): [True: 225k, False: 0]
  ------------------
 4996|   225k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4996:35): [True: 132k, False: 92.7k]
  |  Branch (4996:52): [True: 64.5k, False: 28.2k]
  ------------------
 4997|  28.2k|                              ++scan;
 4998|  28.2k|                           }
 4999|   127k|                           return false;
 5000|   324k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4936|   280k|                        auto to_string_key = [&](glz::generic& key_node) {
 4937|   280k|                           return yaml::materialize_key(key, key_node, ctx);
 4938|   280k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4856|  1.10M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4857|  1.10M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4857:26): [True: 1.07M, False: 25.4k]
  |  Branch (4857:39): [True: 771k, False: 306k]
  ------------------
 4858|   771k|                        bool line_starts_with_explicit_value_indicator = false;
 4859|       |
 4860|       |                        // Inline mapping values in block context cannot start with a
 4861|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4862|       |                        // Such constructs are malformed unless wrapped in flow
 4863|       |                        // delimiters ({...} / [...]) or quoted.
 4864|   771k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4865|   771k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4865:32): [True: 771k, False: 0]
  ------------------
 4866|   771k|                              auto is_line_content_start = [&](auto pos) {
 4867|   771k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   771k|                              };
 4869|       |
 4870|   771k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   771k|                                 const char* line = ctx.line_begin_of(pos);
 4872|   771k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4873|   771k|                                 return line != end && *line == ':';
 4874|   771k|                              };
 4875|       |
 4876|   771k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4876:35): [True: 771k, False: 0]
  ------------------
 4877|   771k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4877:35): [True: 97.5k, False: 674k]
  ------------------
 4878|  97.5k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4878:35): [True: 831, False: 96.6k]
  ------------------
 4879|    831|                                 ctx.error = error_code::syntax_error;
 4880|    831|                                 return false;
 4881|    831|                              }
 4882|   770k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4883|   770k|                           }
 4884|   771k|                        }
 4885|       |
 4886|   771k|                        if (*it == '-' &&
  ------------------
  |  Branch (4886:29): [True: 8.75k, False: 762k]
  ------------------
 4887|  8.75k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4887:30): [True: 946, False: 7.80k]
  |  Branch (4887:49): [True: 1.96k, False: 5.84k]
  ------------------
 4888|  2.90k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4888:29): [True: 24, False: 2.88k]
  ------------------
 4889|       |                           // "key: - item" is not valid block sequence syntax.
 4890|     24|                           ctx.error = error_code::syntax_error;
 4891|     24|                           return false;
 4892|     24|                        }
 4893|       |
 4894|   771k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4894:29): [True: 0, False: 771k]
  ------------------
 4895|      0|                           return false;
 4896|   771k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4897|   771k|                        ctx.pop_indent();
 4898|   771k|                     }
 4899|   332k|                     else {
 4900|   332k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4901|   332k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4901:29): [True: 134k, False: 198k]
  ------------------
 4902|   134k|                           yaml::skip_to_content(it, end);
 4903|   134k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4903:32): [True: 134k, False: 0]
  |  Branch (4903:45): [True: 0, False: 134k]
  |  Branch (4903:59): [True: 0, False: 0]
  |  Branch (4903:78): [True: 0, False: 0]
  ------------------
 4904|      0|                              ctx.error = error_code::syntax_error;
 4905|      0|                              return false;
 4906|      0|                           }
 4907|       |                           // A struct value reads the pushed indent as its own key column;
 4908|       |                           // every other value type reads it as the enclosing baseline.
 4909|   134k|                           const int32_t value_indent =
 4910|   134k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4910:31): [Folded, False: 134k]
  ------------------
 4911|   134k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4911:32): [True: 0, False: 134k]
  ------------------
 4912|      0|                              return false;
 4913|   134k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4914|   134k|                           ctx.pop_indent();
 4915|   134k|                        }
 4916|   332k|                     }
 4917|  1.10M|                     return !bool(ctx.error);
 4918|  1.10M|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E_clISB_EEDaSN_:
 4866|   771k|                              auto is_line_content_start = [&](auto pos) {
 4867|   771k|                                 return !ctx.line_prefix_before(pos).has_content;
 4868|   771k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_ENKUlSN_E0_clISB_EEDaSN_:
 4870|   868k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4871|   868k|                                 const char* line = ctx.line_begin_of(pos);
 4872|  3.20M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4872:41): [True: 3.20M, False: 0]
  |  Branch (4872:57): [True: 2.33M, False: 870k]
  |  Branch (4872:73): [True: 1.80k, False: 868k]
  ------------------
 4873|   868k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4873:41): [True: 868k, False: 0]
  |  Branch (4873:56): [True: 585k, False: 283k]
  ------------------
 4874|   868k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4625|   858k|            {
 4626|       |               // emplace is a no-op for keys the document already wrote, so only
 4627|       |               // untouched pre-existing entries are put back.
 4628|   858k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4628:33): [True: 0, False: 858k]
  ------------------
 4629|      0|                  target.emplace(entry.first, std::move(entry.second));
 4630|      0|               }
 4631|   858k|            }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__17variantIJDndNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbNS3_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS8_ISF_EEEENSE_ISF_EEEEENS0_12yaml_contextEPKcSN_EEbOT0_RT1_RT2_T3_:
  300|   268k|      {
  301|   268k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 268k]
  |  Branch (301:27): [True: 0, False: 268k]
  ------------------
  302|       |
  303|   268k|         ++it; // skip '*'
  304|   268k|         auto name = parse_anchor_name(it, end);
  305|   268k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 472, False: 267k]
  ------------------
  306|    472|            ctx.error = error_code::syntax_error;
  307|    472|            return true;
  308|    472|         }
  309|       |
  310|   267k|         auto anchor_it = ctx.anchors.find(name);
  311|   267k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 2.30k, False: 265k]
  ------------------
  312|  2.30k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  2.30k|            return true;
  314|  2.30k|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|   265k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   265k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.90k, False: 260k]
  ------------------
  322|  4.90k|            return true;
  323|  4.90k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|   260k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 138, False: 260k]
  ------------------
  329|    138|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    138|            return true;
  331|    138|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|   260k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   260k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 260k]
  ------------------
  339|      4|            return true;
  340|       |
  341|   260k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 18, False: 260k]
  ------------------
  342|     18|            ctx.error = error_code::exceeded_max_expansion;
  343|     18|            ctx.custom_error_message = "alias expansion";
  344|     18|            return true;
  345|     18|         }
  346|       |
  347|   260k|         auto replay_it = span.begin;
  348|   260k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   260k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   260k|         ctx.indent_stack.clear();
  353|   260k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 165k, False: 94.9k]
  ------------------
  354|   165k|            ctx.push_indent(span.base_indent - 1);
  355|   165k|         }
  356|       |
  357|   260k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   260k|         using V = std::remove_cvref_t<T>;
  360|   260k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   260k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   260k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   260k|         return true;
  367|   260k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_strEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   318k|      {
 5284|   318k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   318k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   318k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   318k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   318k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 318k, False: 0]
  ------------------
 5294|   318k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   318k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1960|   328k|      {
 1961|   328k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1961:14): [True: 26.6k, False: 301k]
  ------------------
 1962|  26.6k|            return;
 1963|       |
 1964|   301k|         yaml::node_preamble_state preamble{};
 1965|   301k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1965:14): [True: 11.4k, False: 290k]
  ------------------
 1966|   301k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1967|  11.4k|            return;
 1968|       |
 1969|   290k|         std::string str;
 1970|   290k|         const auto style = yaml::detect_scalar_style(*it);
 1971|       |
 1972|   290k|         switch (style) {
  ------------------
  |  Branch (1972:18): [True: 290k, False: 0]
  ------------------
 1973|  2.87k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1973:10): [True: 2.87k, False: 287k]
  ------------------
 1974|  2.87k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1975|  2.87k|            break;
 1976|  1.75k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1976:10): [True: 1.75k, False: 288k]
  ------------------
 1977|  1.75k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1978|  1.75k|            break;
 1979|  1.21k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1979:10): [True: 1.21k, False: 288k]
  ------------------
 1980|  5.26k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1980:10): [True: 4.04k, False: 286k]
  ------------------
 1981|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1982|       |            // one column past the key/item indicator; block scalar indentation is relative
 1983|       |            // to the parent line indent.
 1984|  5.26k|            yaml::parse_block_scalar(str, ctx, it, end,
 1985|  5.26k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1985:38): [True: 1.97k, False: 3.28k]
  ------------------
 1986|  5.26k|            break;
 1987|   280k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1987:10): [True: 280k, False: 9.88k]
  ------------------
 1988|       |            // In block context with known indent, use multiline parsing to support
 1989|       |            // plain scalars that span multiple lines (folding behavior)
 1990|   280k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1991|   280k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1991:20): [True: 236k, False: 43.3k]
  ------------------
 1992|   236k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1993|   236k|               }
 1994|  43.3k|               else {
 1995|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1996|  43.3k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1997|  43.3k|               }
 1998|       |            }
 1999|       |            else {
 2000|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 2001|       |            }
 2002|   280k|            break;
 2003|   290k|         }
 2004|       |
 2005|   290k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (2005:14): [True: 277k, False: 12.8k]
  ------------------
 2006|   277k|            value = std::move(str);
 2007|   277k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2008|   277k|         }
 2009|   290k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   301k|      {
  466|   301k|         skip_inline_ws(it, end);
  467|       |
  468|   301k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 20, False: 301k]
  ------------------
  469|     20|            if constexpr (!AllowEmptyInput) {
  470|     20|               ctx.error = error_code::unexpected_end;
  471|     20|            }
  472|     20|            return true;
  473|     20|         }
  474|       |
  475|   301k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   301k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 32, False: 301k]
  ------------------
  477|     32|            ctx.error = error_code::syntax_error;
  478|     32|            return true;
  479|     32|         }
  480|   301k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 20, False: 301k]
  ------------------
  481|     20|            ctx.error = error_code::syntax_error;
  482|     20|            return true;
  483|     20|         }
  484|       |
  485|   301k|         skip_inline_ws(it, end);
  486|       |
  487|   301k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 51, False: 301k]
  ------------------
  488|     51|            if constexpr (!AllowEmptyInput) {
  489|     51|               ctx.error = error_code::unexpected_end;
  490|     51|            }
  491|     51|            return true;
  492|     51|         }
  493|       |
  494|   301k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 11.3k, False: 290k]
  ------------------
  495|  11.3k|            return true;
  496|  11.3k|         }
  497|       |
  498|   290k|         return false;
  499|   301k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1966|   301k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   301k|      {
  409|   301k|         state.has_anchor = false;
  410|   301k|         state.anchor_name.clear();
  411|   301k|         state.anchor_start = nullptr;
  412|   301k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   301k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   301k|            else {
  421|   301k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 11.1k, False: 290k]
  ------------------
  422|   301k|            }
  423|   301k|         }
  424|       |
  425|   301k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 290k, False: 11.1k]
  |  Branch (425:27): [True: 18.5k, False: 271k]
  ------------------
  426|  18.5k|            ++it;
  427|  18.5k|            auto name = parse_anchor_name(it, end);
  428|  18.5k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 40, False: 18.4k]
  ------------------
  429|     40|               ctx.error = error_code::syntax_error;
  430|     40|               return true;
  431|     40|            }
  432|  18.4k|            skip_inline_ws(it, end);
  433|  18.4k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 90, False: 18.4k]
  ------------------
  434|     90|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     90|                  ctx.error = error_code::unexpected_end;
  436|     90|               }
  437|     90|               return true;
  438|     90|            }
  439|  18.4k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  18.4k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 12, False: 18.3k]
  ------------------
  441|     12|                  ctx.error = error_code::syntax_error;
  442|     12|                  return true;
  443|     12|               }
  444|  18.4k|            }
  445|  18.3k|            state.has_anchor = true;
  446|  18.4k|            state.anchor_name = std::string(name);
  447|  18.4k|            state.anchor_start = &*it;
  448|  18.4k|         }
  449|       |
  450|   301k|         return false;
  451|   301k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   301k|      {
  301|   301k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 301k]
  |  Branch (301:27): [True: 290k, False: 11.1k]
  ------------------
  302|       |
  303|  11.1k|         ++it; // skip '*'
  304|  11.1k|         auto name = parse_anchor_name(it, end);
  305|  11.1k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 26, False: 11.1k]
  ------------------
  306|     26|            ctx.error = error_code::syntax_error;
  307|     26|            return true;
  308|     26|         }
  309|       |
  310|  11.1k|         auto anchor_it = ctx.anchors.find(name);
  311|  11.1k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 131, False: 11.0k]
  ------------------
  312|    131|            ctx.error = error_code::syntax_error; // undefined alias
  313|    131|            return true;
  314|    131|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  11.0k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  11.0k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.08k, False: 9.94k]
  ------------------
  322|  1.08k|            return true;
  323|  1.08k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  9.94k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 40, False: 9.90k]
  ------------------
  329|     40|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     40|            return true;
  331|     40|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  9.90k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  9.90k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 9.89k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  9.89k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 9.89k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  9.89k|         auto replay_it = span.begin;
  348|  9.89k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  9.89k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  9.89k|         ctx.indent_stack.clear();
  353|  9.89k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 7.38k, False: 2.51k]
  ------------------
  354|  7.38k|            ctx.push_indent(span.base_indent - 1);
  355|  7.38k|         }
  356|       |
  357|  9.89k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  9.89k|         using V = std::remove_cvref_t<T>;
  360|  9.89k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  9.89k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  9.89k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  9.89k|         return true;
  367|  9.89k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_19is_yaml_variant_numEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   112k|      {
 5284|   112k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   112k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   112k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   112k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   112k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 112k, False: 0]
  ------------------
 5294|   112k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   112k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2115|   115k|      {
 2116|   115k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2116:14): [True: 0, False: 115k]
  ------------------
 2117|      0|            return;
 2118|       |
 2119|   115k|         yaml::node_preamble_state preamble{};
 2120|   115k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2120:14): [True: 14.0k, False: 101k]
  ------------------
 2121|   115k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   115k|                   return yaml::tag_valid_for_float(tag);
 2123|   115k|                }
 2124|   115k|                else {
 2125|   115k|                   return yaml::tag_valid_for_int(tag);
 2126|   115k|                }
 2127|   115k|             }))
 2128|  14.0k|            return;
 2129|       |
 2130|   101k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2131|       |
 2132|       |         // Check for special float values
 2133|   101k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2134|   101k|            auto start = it;
 2135|       |
 2136|       |            // Check for .inf, .nan, -.inf, etc.
 2137|   101k|            if (*it == '.') {
  ------------------
  |  Branch (2137:17): [True: 21.4k, False: 80.1k]
  ------------------
 2138|  21.4k|               ++it;
 2139|  21.4k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2139:20): [True: 19.9k, False: 1.52k]
  |  Branch (2139:38): [True: 2.10k, False: 17.8k]
  |  Branch (2139:74): [True: 784, False: 17.0k]
  ------------------
 2140|  17.0k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2140:38): [True: 846, False: 16.2k]
  ------------------
 2141|  3.73k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2142|  3.73k|                  it += 3;
 2143|  3.73k|                  finalize();
 2144|  3.73k|                  return;
 2145|  3.73k|               }
 2146|  17.7k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2146:20): [True: 16.2k, False: 1.52k]
  |  Branch (2146:38): [True: 3.46k, False: 12.7k]
  |  Branch (2146:74): [True: 681, False: 12.0k]
  ------------------
 2147|  12.0k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2147:38): [True: 780, False: 11.2k]
  ------------------
 2148|  4.92k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2149|  4.92k|                  it += 3;
 2150|  4.92k|                  finalize();
 2151|  4.92k|                  return;
 2152|  4.92k|               }
 2153|  12.8k|               it = start;
 2154|  12.8k|            }
 2155|       |
 2156|  92.9k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2156:17): [True: 4.78k, False: 88.1k]
  |  Branch (2156:31): [True: 8.76k, False: 79.4k]
  ------------------
 2157|  13.5k|               const char sign = *it;
 2158|  13.5k|               ++it;
 2159|  13.5k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2159:20): [True: 12.8k, False: 743]
  |  Branch (2159:33): [True: 5.00k, False: 7.80k]
  ------------------
 2160|  5.00k|                  ++it;
 2161|  5.00k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2161:23): [True: 4.60k, False: 403]
  |  Branch (2161:41): [True: 837, False: 3.76k]
  |  Branch (2161:77): [True: 1.80k, False: 1.96k]
  ------------------
 2162|  3.04k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2162:41): [True: 408, False: 1.55k]
  ------------------
 2163|  3.04k|                     if (sign == '-') {
  ------------------
  |  Branch (2163:26): [True: 1.64k, False: 1.40k]
  ------------------
 2164|  1.64k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2165|  1.64k|                     }
 2166|  1.40k|                     else {
 2167|  1.40k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2168|  1.40k|                     }
 2169|  3.04k|                     it += 3;
 2170|  3.04k|                     finalize();
 2171|  3.04k|                     return;
 2172|  3.04k|                  }
 2173|  5.00k|               }
 2174|  10.5k|               it = start;
 2175|  10.5k|            }
 2176|  92.9k|         }
 2177|       |
 2178|       |         // Parse as plain scalar and convert
 2179|  89.9k|         auto start = it;
 2180|       |
 2181|       |         // Find end of number - use same rules as plain scalar for colons
 2182|  57.1M|         while (it != end) {
  ------------------
  |  Branch (2182:17): [True: 57.0M, False: 22.7k]
  ------------------
 2183|  57.0M|            const char c = *it;
 2184|  57.0M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2184:17): [True: 27.7k, False: 57.0M]
  |  Branch (2184:29): [True: 3.25k, False: 57.0M]
  |  Branch (2184:42): [True: 18.5k, False: 57.0M]
  |  Branch (2184:55): [True: 3.62k, False: 57.0M]
  |  Branch (2184:68): [True: 3.54k, False: 57.0M]
  |  Branch (2184:80): [True: 1.96k, False: 57.0M]
  |  Branch (2184:92): [True: 2.92k, False: 57.0M]
  |  Branch (2184:104): [True: 6.81k, False: 57.0M]
  ------------------
 2185|  68.4k|               break;
 2186|  68.4k|            }
 2187|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2188|  57.0M|            if (c == ':') {
  ------------------
  |  Branch (2188:17): [True: 90.9k, False: 56.9M]
  ------------------
 2189|  90.9k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2189:20): [True: 963, False: 89.9k]
  |  Branch (2189:39): [True: 7.00k, False: 82.9k]
  |  Branch (2189:59): [True: 430, False: 82.5k]
  |  Branch (2189:80): [True: 1.47k, False: 81.0k]
  |  Branch (2189:101): [True: 519, False: 80.5k]
  ------------------
 2190|  10.3k|                  break;
 2191|  10.3k|               }
 2192|  90.9k|            }
 2193|  57.0M|            ++it;
 2194|  57.0M|         }
 2195|       |
 2196|   101k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2197|       |
 2198|   101k|         if (num_str.empty()) {
  ------------------
  |  Branch (2198:14): [True: 4.24k, False: 97.4k]
  ------------------
 2199|  4.24k|            ctx.error = error_code::parse_number_failure;
 2200|  4.24k|            return;
 2201|  4.24k|         }
 2202|       |
 2203|       |         // Handle hex, octal, binary
 2204|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2205|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2206|       |               int base = 10;
 2207|       |               size_t offset = 0;
 2208|       |
 2209|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2210|       |                  base = 16;
 2211|       |                  offset = 2;
 2212|       |               }
 2213|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2214|       |                  base = 8;
 2215|       |                  offset = 2;
 2216|       |               }
 2217|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2218|       |                  base = 2;
 2219|       |                  offset = 2;
 2220|       |               }
 2221|       |
 2222|       |               if (base != 10) {
 2223|       |                  const auto digits = num_str.substr(offset);
 2224|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2225|       |
 2226|       |                  std::string clean_storage;
 2227|       |                  std::string_view clean_view;
 2228|       |
 2229|       |                  if (has_underscores) {
 2230|       |                     clean_storage.reserve(digits.size());
 2231|       |                     for (char c : digits) {
 2232|       |                        if (c != '_') {
 2233|       |                           clean_storage.push_back(c);
 2234|       |                        }
 2235|       |                     }
 2236|       |                     clean_view = clean_storage;
 2237|       |                  }
 2238|       |                  else {
 2239|       |                     clean_view = digits;
 2240|       |                  }
 2241|       |
 2242|       |                  auto [ptr, ec] =
 2243|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2244|       |                  if (ec != std::errc{}) {
 2245|       |                     ctx.error = error_code::parse_number_failure;
 2246|       |                  }
 2247|       |                  finalize();
 2248|       |                  return;
 2249|       |               }
 2250|       |            }
 2251|       |         }
 2252|  97.4k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2253|  97.4k|            bool negative = false;
 2254|  97.4k|            std::string_view digits = num_str;
 2255|       |
 2256|  97.4k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2256:17): [True: 85.6k, False: 11.7k]
  |  Branch (2256:37): [True: 7.36k, False: 78.3k]
  |  Branch (2256:62): [True: 3.14k, False: 75.1k]
  ------------------
 2257|  10.5k|               negative = (digits.front() == '-');
 2258|  10.5k|               digits.remove_prefix(1);
 2259|  10.5k|            }
 2260|       |
 2261|  97.4k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2261:17): [True: 53.5k, False: 43.8k]
  |  Branch (2261:38): [True: 27.5k, False: 26.0k]
  ------------------
 2262|  27.5k|               int base = 10;
 2263|  27.5k|               size_t offset = 0;
 2264|       |
 2265|  27.5k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2265:20): [True: 5.09k, False: 22.4k]
  |  Branch (2265:40): [True: 1.00k, False: 21.4k]
  ------------------
 2266|  6.10k|                  base = 16;
 2267|  6.10k|                  offset = 2;
 2268|  6.10k|               }
 2269|  21.4k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2269:25): [True: 1.42k, False: 20.0k]
  |  Branch (2269:45): [True: 1.04k, False: 18.9k]
  ------------------
 2270|  2.46k|                  base = 8;
 2271|  2.46k|                  offset = 2;
 2272|  2.46k|               }
 2273|  18.9k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2273:25): [True: 849, False: 18.1k]
  |  Branch (2273:45): [True: 283, False: 17.8k]
  ------------------
 2274|  1.13k|                  base = 2;
 2275|  1.13k|                  offset = 2;
 2276|  1.13k|               }
 2277|       |
 2278|  27.5k|               if (base != 10) {
  ------------------
  |  Branch (2278:20): [True: 9.69k, False: 17.8k]
  ------------------
 2279|  9.69k|                  auto raw_digits = digits.substr(offset);
 2280|  9.69k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2281|       |
 2282|  9.69k|                  std::string clean_storage;
 2283|  9.69k|                  std::string_view clean_view;
 2284|  9.69k|                  if (has_underscores) {
  ------------------
  |  Branch (2284:23): [True: 3.44k, False: 6.25k]
  ------------------
 2285|  3.44k|                     clean_storage.reserve(raw_digits.size());
 2286|  6.91M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2286:34): [True: 6.91M, False: 3.44k]
  ------------------
 2287|  6.91M|                        if (c != '_') {
  ------------------
  |  Branch (2287:29): [True: 6.90M, False: 6.53k]
  ------------------
 2288|  6.90M|                           clean_storage.push_back(c);
 2289|  6.90M|                        }
 2290|  6.91M|                     }
 2291|  3.44k|                     clean_view = clean_storage;
 2292|  3.44k|                  }
 2293|  6.25k|                  else {
 2294|  6.25k|                     clean_view = raw_digits;
 2295|  6.25k|                  }
 2296|       |
 2297|  9.69k|                  uint64_t parsed_int{};
 2298|  9.69k|                  auto [ptr, ec] =
 2299|  9.69k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2300|  9.69k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2300:23): [True: 5.18k, False: 4.51k]
  |  Branch (2300:44): [True: 3.11k, False: 1.39k]
  ------------------
 2301|  8.30k|                     ctx.error = error_code::parse_number_failure;
 2302|  8.30k|                     finalize();
 2303|  8.30k|                     return;
 2304|  8.30k|                  }
 2305|       |
 2306|  1.39k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2307|  1.39k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2307:27): [True: 429, False: 966]
  ------------------
 2308|  1.39k|                  finalize();
 2309|  1.39k|                  return;
 2310|  9.69k|               }
 2311|  27.5k|            }
 2312|  97.4k|         }
 2313|       |
 2314|       |         // Standard number parsing - only allocate if underscores present
 2315|  87.7k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2316|       |
 2317|  97.4k|         std::string clean_storage;
 2318|  97.4k|         std::string_view clean_view;
 2319|       |
 2320|  97.4k|         if (has_underscores) {
  ------------------
  |  Branch (2320:14): [True: 3.24k, False: 94.1k]
  ------------------
 2321|  3.24k|            clean_storage.reserve(num_str.size());
 2322|  23.7M|            for (char c : num_str) {
  ------------------
  |  Branch (2322:25): [True: 23.7M, False: 3.24k]
  ------------------
 2323|  23.7M|               if (c != '_') {
  ------------------
  |  Branch (2323:20): [True: 23.6M, False: 11.0k]
  ------------------
 2324|  23.6M|                  clean_storage.push_back(c);
 2325|  23.6M|               }
 2326|  23.7M|            }
 2327|  3.24k|            clean_view = clean_storage;
 2328|  3.24k|         }
 2329|  94.1k|         else {
 2330|  94.1k|            clean_view = num_str;
 2331|  94.1k|         }
 2332|       |
 2333|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2334|       |         // Strip leading '+' if present
 2335|  97.4k|         auto parse_view = clean_view;
 2336|  97.4k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2336:14): [True: 75.6k, False: 21.8k]
  |  Branch (2336:37): [True: 7.35k, False: 68.2k]
  ------------------
 2337|  7.35k|            parse_view.remove_prefix(1);
 2338|  7.35k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2338:17): [True: 2.05k, False: 5.30k]
  ------------------
 2339|  2.05k|               ctx.error = error_code::parse_number_failure;
 2340|  2.05k|               return;
 2341|  2.05k|            }
 2342|  7.35k|         }
 2343|       |
 2344|  95.3k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2345|  95.3k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2346|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2347|  95.3k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2347:17): [True: 47.2k, False: 48.1k]
  |  Branch (2347:45): [True: 40.8k, False: 7.22k]
  ------------------
 2348|  66.7k|               ctx.error = error_code::parse_number_failure;
 2349|  66.7k|            }
 2350|       |         }
 2351|       |         else {
 2352|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2353|       |            // Check both for errors and that all input was consumed
 2354|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2355|       |               ctx.error = error_code::parse_number_failure;
 2356|       |            }
 2357|       |         }
 2358|       |
 2359|  95.3k|         finalize();
 2360|  95.3k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1EEELb0ERdNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EdE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   115k|      {
  466|   115k|         skip_inline_ws(it, end);
  467|       |
  468|   115k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 510, False: 115k]
  ------------------
  469|    510|            if constexpr (!AllowEmptyInput) {
  470|    510|               ctx.error = error_code::unexpected_end;
  471|    510|            }
  472|    510|            return true;
  473|    510|         }
  474|       |
  475|   115k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   115k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 929, False: 114k]
  ------------------
  477|    929|            ctx.error = error_code::syntax_error;
  478|    929|            return true;
  479|    929|         }
  480|   114k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 644, False: 113k]
  ------------------
  481|    644|            ctx.error = error_code::syntax_error;
  482|    644|            return true;
  483|    644|         }
  484|       |
  485|   113k|         skip_inline_ws(it, end);
  486|       |
  487|   113k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 492, False: 113k]
  ------------------
  488|    492|            if constexpr (!AllowEmptyInput) {
  489|    492|               ctx.error = error_code::unexpected_end;
  490|    492|            }
  491|    492|            return true;
  492|    492|         }
  493|       |
  494|   113k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 11.5k, False: 101k]
  ------------------
  495|  11.5k|            return true;
  496|  11.5k|         }
  497|       |
  498|   101k|         return false;
  499|   113k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2120|   114k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2121|   114k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2122|   114k|                   return yaml::tag_valid_for_float(tag);
 2123|       |                }
 2124|       |                else {
 2125|       |                   return yaml::tag_valid_for_int(tag);
 2126|       |                }
 2127|   114k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   113k|      {
  409|   113k|         state.has_anchor = false;
  410|   113k|         state.anchor_name.clear();
  411|   113k|         state.anchor_start = nullptr;
  412|   113k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   113k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   113k|            else {
  421|   113k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 9.78k, False: 103k]
  ------------------
  422|   113k|            }
  423|   113k|         }
  424|       |
  425|   113k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 103k, False: 9.78k]
  |  Branch (425:27): [True: 7.54k, False: 95.8k]
  ------------------
  426|  7.54k|            ++it;
  427|  7.54k|            auto name = parse_anchor_name(it, end);
  428|  7.54k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 857, False: 6.68k]
  ------------------
  429|    857|               ctx.error = error_code::syntax_error;
  430|    857|               return true;
  431|    857|            }
  432|  6.68k|            skip_inline_ws(it, end);
  433|  6.68k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 874, False: 5.81k]
  ------------------
  434|    874|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    874|                  ctx.error = error_code::unexpected_end;
  436|    874|               }
  437|    874|               return true;
  438|    874|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  5.81k|            state.has_anchor = true;
  446|  5.81k|            state.anchor_name = std::string(name);
  447|  5.81k|            state.anchor_start = &*it;
  448|  5.81k|         }
  449|       |
  450|   111k|         return false;
  451|   113k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   113k|      {
  301|   113k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 113k]
  |  Branch (301:27): [True: 103k, False: 9.78k]
  ------------------
  302|       |
  303|  9.78k|         ++it; // skip '*'
  304|  9.78k|         auto name = parse_anchor_name(it, end);
  305|  9.78k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 791, False: 8.99k]
  ------------------
  306|    791|            ctx.error = error_code::syntax_error;
  307|    791|            return true;
  308|    791|         }
  309|       |
  310|  8.99k|         auto anchor_it = ctx.anchors.find(name);
  311|  8.99k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 3.64k, False: 5.35k]
  ------------------
  312|  3.64k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  3.64k|            return true;
  314|  3.64k|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  5.35k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.35k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.31k, False: 4.03k]
  ------------------
  322|  1.31k|            return true;
  323|  1.31k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  4.03k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 412, False: 3.62k]
  ------------------
  329|    412|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    412|            return true;
  331|    412|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  3.62k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.62k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 3.62k]
  ------------------
  339|      4|            return true;
  340|       |
  341|  3.62k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.62k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  3.62k|         auto replay_it = span.begin;
  348|  3.62k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.62k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.62k|         ctx.indent_stack.clear();
  353|  3.62k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.47k, False: 2.14k]
  ------------------
  354|  1.47k|            ctx.push_indent(span.base_indent - 1);
  355|  1.47k|         }
  356|       |
  357|  3.62k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.62k|         using V = std::remove_cvref_t<T>;
  360|  3.62k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.62k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.62k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.62k|         return true;
  367|  3.62k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2130|  95.3k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_20is_yaml_variant_boolEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|  63.0k|      {
 5284|  63.0k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|  63.0k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|  63.0k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|  63.0k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|  63.0k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 63.0k, False: 0]
  ------------------
 5294|  63.0k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|  63.0k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2080|  79.1k|      {
 2081|  79.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2081:14): [True: 0, False: 79.1k]
  ------------------
 2082|      0|            return;
 2083|       |
 2084|  79.1k|         yaml::node_preamble_state preamble{};
 2085|  79.1k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2085:14): [True: 19.0k, False: 60.1k]
  ------------------
 2086|  79.1k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2087|  19.0k|            return;
 2088|       |
 2089|       |         // Parse as plain scalar first
 2090|  60.1k|         std::string str;
 2091|  60.1k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2092|       |
 2093|  60.1k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2093:14): [True: 28.3k, False: 31.7k]
  |  Branch (2093:31): [True: 7.33k, False: 24.4k]
  |  Branch (2093:48): [True: 1.81k, False: 22.6k]
  |  Branch (2093:65): [True: 735, False: 21.9k]
  |  Branch (2093:81): [True: 962, False: 20.9k]
  |  Branch (2093:97): [True: 941, False: 20.0k]
  ------------------
 2094|  42.2k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2094:14): [True: 585, False: 19.4k]
  |  Branch (2094:29): [True: 381, False: 19.0k]
  |  Branch (2094:44): [True: 1.16k, False: 17.8k]
  ------------------
 2095|  42.2k|            value = true;
 2096|  42.2k|         }
 2097|  17.8k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2097:19): [True: 4.01k, False: 13.8k]
  |  Branch (2097:37): [True: 5.86k, False: 8.00k]
  |  Branch (2097:55): [True: 2.73k, False: 5.26k]
  |  Branch (2097:73): [True: 954, False: 4.30k]
  |  Branch (2097:88): [True: 1.05k, False: 3.25k]
  |  Branch (2097:103): [True: 783, False: 2.46k]
  ------------------
 2098|  17.3k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2098:19): [True: 357, False: 2.11k]
  |  Branch (2098:35): [True: 786, False: 1.32k]
  |  Branch (2098:51): [True: 774, False: 551]
  ------------------
 2099|  17.3k|            value = false;
 2100|  17.3k|         }
 2101|    551|         else {
 2102|    551|            ctx.error = error_code::expected_true_or_false;
 2103|    551|         }
 2104|       |
 2105|  60.1k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2106|  60.1k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  79.1k|      {
  466|  79.1k|         skip_inline_ws(it, end);
  467|       |
  468|  79.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 8, False: 79.1k]
  ------------------
  469|      8|            if constexpr (!AllowEmptyInput) {
  470|      8|               ctx.error = error_code::unexpected_end;
  471|      8|            }
  472|      8|            return true;
  473|      8|         }
  474|       |
  475|  79.1k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  79.1k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 79.1k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  79.1k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 79.1k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  79.1k|         skip_inline_ws(it, end);
  486|       |
  487|  79.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 11, False: 79.1k]
  ------------------
  488|     11|            if constexpr (!AllowEmptyInput) {
  489|     11|               ctx.error = error_code::unexpected_end;
  490|     11|            }
  491|     11|            return true;
  492|     11|         }
  493|       |
  494|  79.1k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 18.9k, False: 60.1k]
  ------------------
  495|  18.9k|            return true;
  496|  18.9k|         }
  497|       |
  498|  60.1k|         return false;
  499|  79.1k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2086|  79.1k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1EEERbNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  79.1k|      {
  409|  79.1k|         state.has_anchor = false;
  410|  79.1k|         state.anchor_name.clear();
  411|  79.1k|         state.anchor_start = nullptr;
  412|  79.1k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  79.1k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|  79.1k|            else {
  421|  79.1k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 18.9k, False: 60.2k]
  ------------------
  422|  79.1k|            }
  423|  79.1k|         }
  424|       |
  425|  79.1k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 60.2k, False: 18.9k]
  |  Branch (425:27): [True: 3.62k, False: 56.5k]
  ------------------
  426|  3.62k|            ++it;
  427|  3.62k|            auto name = parse_anchor_name(it, end);
  428|  3.62k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 3.61k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  3.61k|            skip_inline_ws(it, end);
  433|  3.61k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 39, False: 3.57k]
  ------------------
  434|     39|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     39|                  ctx.error = error_code::unexpected_end;
  436|     39|               }
  437|     39|               return true;
  438|     39|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  3.57k|            state.has_anchor = true;
  446|  3.57k|            state.anchor_name = std::string(name);
  447|  3.57k|            state.anchor_start = &*it;
  448|  3.57k|         }
  449|       |
  450|  79.1k|         return false;
  451|  79.1k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  79.1k|      {
  301|  79.1k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 79.1k]
  |  Branch (301:27): [True: 60.2k, False: 18.9k]
  ------------------
  302|       |
  303|  18.9k|         ++it; // skip '*'
  304|  18.9k|         auto name = parse_anchor_name(it, end);
  305|  18.9k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 34, False: 18.9k]
  ------------------
  306|     34|            ctx.error = error_code::syntax_error;
  307|     34|            return true;
  308|     34|         }
  309|       |
  310|  18.9k|         auto anchor_it = ctx.anchors.find(name);
  311|  18.9k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 123, False: 18.7k]
  ------------------
  312|    123|            ctx.error = error_code::syntax_error; // undefined alias
  313|    123|            return true;
  314|    123|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  18.7k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  18.7k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.67k, False: 16.1k]
  ------------------
  322|  2.67k|            return true;
  323|  2.67k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  16.1k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 9, False: 16.0k]
  ------------------
  329|      9|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      9|            return true;
  331|      9|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  16.0k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  16.0k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 16.0k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  16.0k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 16.0k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  16.0k|         auto replay_it = span.begin;
  348|  16.0k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  16.0k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  16.0k|         ctx.indent_stack.clear();
  353|  16.0k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 7.05k, False: 9.03k]
  ------------------
  354|  7.05k|            ctx.push_indent(span.base_indent - 1);
  355|  7.05k|         }
  356|       |
  357|  16.0k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  16.0k|         using V = std::remove_cvref_t<T>;
  360|  16.0k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  16.0k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  16.0k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  16.0k|         return true;
  367|  16.0k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2466|  18.4k|      {
 2467|  18.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2467:14): [True: 0, False: 18.4k]
  ------------------
 2468|      0|            return;
 2469|       |
 2470|  18.4k|         yaml::skip_inline_ws(it, end);
 2471|       |
 2472|  18.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2472:14): [True: 14, False: 18.4k]
  ------------------
 2473|     14|            ctx.error = error_code::unexpected_end;
 2474|     14|            return;
 2475|     14|         }
 2476|       |
 2477|       |         // Check for null values: null, Null, NULL, ~
 2478|  18.4k|         if (*it == '~') {
  ------------------
  |  Branch (2478:14): [True: 3.08k, False: 15.3k]
  ------------------
 2479|  3.08k|            ++it;
 2480|  3.08k|            return;
 2481|  3.08k|         }
 2482|       |
 2483|       |         // Parse as plain scalar and check if it's a null keyword
 2484|  15.3k|         auto start = it;
 2485|   217k|         while (it != end && !yaml::plain_scalar_end_or_control_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2485:17): [True: 216k, False: 689]
  |  Branch (2485:30): [True: 201k, False: 14.6k]
  ------------------
 2486|   201k|            ++it;
 2487|   201k|         }
 2488|       |
 2489|  15.3k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2490|  15.3k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2490:14): [True: 86, False: 15.2k]
  ------------------
 2491|     86|            ctx.error = error_code::syntax_error;
 2492|     86|         }
 2493|  15.3k|      }
_ZN3glz33process_yaml_variant_alternativesINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEENS_21is_yaml_variant_arrayEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5283|   365k|      {
 5284|   365k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5285|       |
 5286|       |         if constexpr (category_count == 0) {
 5287|       |            ctx.error = error_code::no_matching_variant_type;
 5288|       |         }
 5289|   365k|         else if constexpr (category_count == 1) {
 5290|       |            // Only one type in this category, use it directly
 5291|   365k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5292|   365k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5293|   365k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5293:17): [True: 365k, False: 0]
  ------------------
 5294|   365k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5295|       |         }
 5296|       |         else {
 5297|       |            // Multiple types in this category, try each one
 5298|       |            constexpr auto N = std::variant_size_v<Variant>;
 5299|       |            bool found_match{};
 5300|       |            size_t match_idx = 0;
 5301|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5302|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5303|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5304|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5305|       |            // (one that materializes no key text can still parse under a latched budget) is
 5306|       |            // unaffected.
 5307|       |            error_code expansion_error{};
 5308|       |            std::string_view expansion_message{};
 5309|       |
 5310|       |            for_each<N>([&]<size_t I>() {
 5311|       |               if (found_match) {
 5312|       |                  return;
 5313|       |               }
 5314|       |               using V = std::variant_alternative_t<I, Variant>;
 5315|       |               if constexpr (Trait<V>::value) {
 5316|       |                  auto copy_it = it;
 5317|       |                  if (!std::holds_alternative<V>(value)) {
 5318|       |                     value = V{};
 5319|       |                  }
 5320|       |
 5321|       |                  auto temp_ctx = ctx.make_speculative();
 5322|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5323|       |
 5324|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5325|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5326|       |                  // attempt that can be repeated for free.
 5327|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5328|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5329|       |
 5330|       |                  if (!bool(temp_ctx.error)) {
 5331|       |                     found_match = true;
 5332|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5333|       |                  }
 5334|       |                  else {
 5335|       |                     it = copy_it;
 5336|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5337|       |                        expansion_error = temp_ctx.error;
 5338|       |                        expansion_message = temp_ctx.custom_error_message;
 5339|       |                     }
 5340|       |                     if (match_idx + 1 < category_count) {
 5341|       |                        // Not the last type, continue trying
 5342|       |                     }
 5343|       |                     else {
 5344|       |                        // Last type failed, propagate error
 5345|       |                        ctx.error = temp_ctx.error;
 5346|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5347|       |                     }
 5348|       |                  }
 5349|       |                  ++match_idx;
 5350|       |               }
 5351|       |            });
 5352|       |
 5353|       |            if (!found_match && !bool(ctx.error)) {
 5354|       |               if (expansion_error != error_code::none) {
 5355|       |                  ctx.error = expansion_error;
 5356|       |                  ctx.custom_error_message = expansion_message;
 5357|       |               }
 5358|       |               else {
 5359|       |                  ctx.error = error_code::no_matching_variant_type;
 5360|       |               }
 5361|       |            }
 5362|       |         }
 5363|   365k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4176|   374k|      {
 4177|   374k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4177:14): [True: 0, False: 374k]
  ------------------
 4178|      0|            return;
 4179|       |
 4180|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4181|   374k|         auto peek = it;
 4182|   374k|         yaml::node_preamble_state preamble{};
 4183|   374k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4183:14): [True: 12.1k, False: 362k]
  ------------------
 4184|   374k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4185|  12.1k|            it = peek;
 4186|  12.1k|            return;
 4187|  12.1k|         }
 4188|       |
 4189|   362k|         if (*peek == '[') {
  ------------------
  |  Branch (4189:14): [True: 92.6k, False: 269k]
  ------------------
 4190|       |            // Flow sequence - consume whitespace and parse
 4191|  92.6k|            it = peek;
 4192|  92.6k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4193|  92.6k|         }
 4194|   269k|         else if (*peek == '-') {
  ------------------
  |  Branch (4194:19): [True: 269k, False: 327]
  ------------------
 4195|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4196|       |            // But if there was a tag, we need to advance past it
 4197|   269k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4197:17): [True: 870, False: 268k]
  |  Branch (4197:57): [True: 2.14k, False: 266k]
  ------------------
 4198|  3.01k|               it = peek;
 4199|  3.01k|            }
 4200|   269k|            int32_t seq_indent = ctx.current_indent();
 4201|   269k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4201:17): [True: 268k, False: 877]
  |  Branch (4201:31): [True: 226k, False: 41.7k]
  ------------------
 4202|   226k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4202:29): [True: 162k, False: 64.4k]
  |  Branch (4202:62): [True: 138k, False: 23.7k]
  ------------------
 4203|   226k|                                                          : (ctx.current_indent() + 1);
 4204|   226k|            }
 4205|   269k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4206|   269k|         }
 4207|    327|         else {
 4208|    327|            ctx.error = error_code::syntax_error;
 4209|    327|         }
 4210|       |
 4211|   362k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4212|   362k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1EEELb0ERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_ZNS_4fromILj450ESC_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2EEERSG_SD_TkNS_10is_contextERSE_SG_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSP_RSS_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   374k|      {
  466|   374k|         skip_inline_ws(it, end);
  467|       |
  468|   374k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 11, False: 374k]
  ------------------
  469|     11|            if constexpr (!AllowEmptyInput) {
  470|     11|               ctx.error = error_code::unexpected_end;
  471|     11|            }
  472|     11|            return true;
  473|     11|         }
  474|       |
  475|   374k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   374k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 374k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   374k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 12, False: 374k]
  ------------------
  481|     12|            ctx.error = error_code::syntax_error;
  482|     12|            return true;
  483|     12|         }
  484|       |
  485|   374k|         skip_inline_ws(it, end);
  486|       |
  487|   374k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 11, False: 374k]
  ------------------
  488|     11|            if constexpr (!AllowEmptyInput) {
  489|     11|               ctx.error = error_code::unexpected_end;
  490|     11|            }
  491|     11|            return true;
  492|     11|         }
  493|       |
  494|   374k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 12.1k, False: 362k]
  ------------------
  495|  12.1k|            return true;
  496|  12.1k|         }
  497|       |
  498|   362k|         return false;
  499|   374k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_ENKUlNSC_8yaml_tagEE_clESR_:
 4184|   374k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   374k|      {
  409|   374k|         state.has_anchor = false;
  410|   374k|         state.anchor_name.clear();
  411|   374k|         state.anchor_start = nullptr;
  412|   374k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   374k|         if constexpr (Policy.allow_alias) {
  415|       |            if constexpr (Policy.alias_can_be_mapping_key) {
  416|       |               if (!alias_token_is_mapping_key(it, end)) {
  417|       |                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  418|       |               }
  419|       |            }
  420|   374k|            else {
  421|   374k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 12.0k, False: 362k]
  ------------------
  422|   374k|            }
  423|   374k|         }
  424|       |
  425|   374k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 362k, False: 12.0k]
  |  Branch (425:27): [True: 3.16k, False: 359k]
  ------------------
  426|  3.16k|            ++it;
  427|  3.16k|            auto name = parse_anchor_name(it, end);
  428|  3.16k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 27, False: 3.13k]
  ------------------
  429|     27|               ctx.error = error_code::syntax_error;
  430|     27|               return true;
  431|     27|            }
  432|  3.13k|            skip_inline_ws(it, end);
  433|  3.13k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 62, False: 3.07k]
  ------------------
  434|     62|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     62|                  ctx.error = error_code::unexpected_end;
  436|     62|               }
  437|     62|               return true;
  438|     62|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  3.07k|            state.has_anchor = true;
  446|  3.07k|            state.anchor_name = std::string(name);
  447|  3.07k|            state.anchor_start = &*it;
  448|  3.07k|         }
  449|       |
  450|   374k|         return false;
  451|   374k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   374k|      {
  301|   374k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 374k]
  |  Branch (301:27): [True: 362k, False: 12.0k]
  ------------------
  302|       |
  303|  12.0k|         ++it; // skip '*'
  304|  12.0k|         auto name = parse_anchor_name(it, end);
  305|  12.0k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 21, False: 12.0k]
  ------------------
  306|     21|            ctx.error = error_code::syntax_error;
  307|     21|            return true;
  308|     21|         }
  309|       |
  310|  12.0k|         auto anchor_it = ctx.anchors.find(name);
  311|  12.0k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 113, False: 11.9k]
  ------------------
  312|    113|            ctx.error = error_code::syntax_error; // undefined alias
  313|    113|            return true;
  314|    113|         }
  315|       |
  316|       |         // Copied rather than referenced: the replay below can replace ctx.anchors wholesale
  317|       |         // (a speculative parse hands its own map back), which would dangle a reference here.
  318|  11.9k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  11.9k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.51k, False: 9.41k]
  ------------------
  322|  2.51k|            return true;
  323|  2.51k|         }
  324|       |
  325|       |         // An anchor is invisible to itself while it expands. A span that aliases the name it
  326|       |         // defines -- reachable because a mapping key's anchor is registered over the key text
  327|       |         // before that text is parsed -- would otherwise replay itself forever.
  328|  9.41k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 41, False: 9.37k]
  ------------------
  329|     41|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     41|            return true;
  331|     41|         }
  332|       |
  333|       |         // Replaying an anchor re-enters the reader directly, bypassing the variant reader's
  334|       |         // depth guard, so this is the only depth accounting a chain of aliases into a
  335|       |         // non-variant target gets. The cycle check above stops the unbounded case; this bounds
  336|       |         // a legitimate but deeply chained one.
  337|  9.37k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  9.37k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 9.36k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  9.36k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 9.36k]
  ------------------
  342|      0|            ctx.error = error_code::exceeded_max_expansion;
  343|      0|            ctx.custom_error_message = "alias expansion";
  344|      0|            return true;
  345|      0|         }
  346|       |
  347|  9.36k|         auto replay_it = span.begin;
  348|  9.36k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  9.36k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  9.36k|         ctx.indent_stack.clear();
  353|  9.36k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 3.63k, False: 5.72k]
  ------------------
  354|  3.63k|            ctx.push_indent(span.base_indent - 1);
  355|  3.63k|         }
  356|       |
  357|  9.36k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  9.36k|         using V = std::remove_cvref_t<T>;
  360|  9.36k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  9.36k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  9.36k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  9.36k|         return true;
  367|  9.36k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2664|  92.6k|      {
 2665|  92.6k|         using V = std::remove_cvref_t<T>;
 2666|  92.6k|         using value_type = typename V::value_type;
 2667|       |
 2668|  92.6k|         struct sequence_container_adapter
 2669|  92.6k|         {
 2670|  92.6k|            size_t index = 0;
 2671|       |
 2672|  92.6k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2673|  92.6k|            {
 2674|  92.6k|               if constexpr (!resizable<V>) {
 2675|  92.6k|                  return index >= container.size();
 2676|  92.6k|               }
 2677|  92.6k|               else {
 2678|  92.6k|                  (void)container;
 2679|  92.6k|                  return false;
 2680|  92.6k|               }
 2681|  92.6k|            }
 2682|       |
 2683|  92.6k|            inline void commit_fixed_slot() noexcept { ++index; }
 2684|       |
 2685|  92.6k|            inline void append(V& container, value_type&& element) noexcept
 2686|  92.6k|            {
 2687|  92.6k|               if constexpr (emplace_backable<V>) {
 2688|  92.6k|                  container.emplace_back(std::move(element));
 2689|  92.6k|               }
 2690|  92.6k|               else if constexpr (emplaceable<V>) {
 2691|  92.6k|                  container.emplace(std::move(element));
 2692|  92.6k|               }
 2693|  92.6k|            }
 2694|  92.6k|         };
 2695|       |
 2696|  92.6k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2696:14): [True: 0, False: 92.6k]
  |  Branch (2696:27): [True: 0, False: 92.6k]
  ------------------
 2697|      0|            ctx.error = error_code::syntax_error;
 2698|      0|            return;
 2699|      0|         }
 2700|       |
 2701|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2702|       |         // before the empty-array early return below so that `[]` also clears.
 2703|  92.6k|         clear_sequence_before_read<Opts>(value);
 2704|       |
 2705|  92.6k|         ++it; // Skip '['
 2706|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2707|  92.6k|         skip_flow_ws_and_newlines(ctx, it, end);
 2708|  92.6k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2708:14): [True: 121, False: 92.5k]
  ------------------
 2709|    121|            return;
 2710|       |
 2711|       |         // Handle empty array
 2712|  92.5k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2712:14): [True: 91.0k, False: 1.54k]
  |  Branch (2712:27): [True: 9.50k, False: 81.5k]
  ------------------
 2713|  9.50k|            ++it;
 2714|  9.50k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2715|  9.50k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2715:17): [True: 66, False: 9.43k]
  ------------------
 2716|     66|               return;
 2717|  9.43k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2718|  9.43k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2718:20): [True: 917, False: 8.52k]
  ------------------
 2719|    917|                  validate_root_flow_tail_after_close(ctx, it, end);
 2720|    917|               }
 2721|  9.43k|            }
 2722|  9.43k|            return;
 2723|  9.50k|         }
 2724|       |
 2725|  83.0k|         bool just_saw_comma = false;
 2726|  83.0k|         sequence_container_adapter adapter{};
 2727|       |
 2728|  83.0k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2729|       |            // Dynamic containers append items (vector-like and set-like)
 2730|  1.84M|            while (it != end) {
  ------------------
  |  Branch (2730:20): [True: 1.84M, False: 2.90k]
  ------------------
 2731|  1.84M|               skip_flow_ws_and_newlines(ctx, it, end);
 2732|  1.84M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2732:20): [True: 0, False: 1.84M]
  ------------------
 2733|      0|                  return;
 2734|       |
 2735|  1.84M|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2735:20): [True: 0, False: 1.84M]
  ------------------
 2736|      0|                  ctx.error = error_code::unexpected_end;
 2737|      0|                  return;
 2738|      0|               }
 2739|       |
 2740|  1.84M|               if (*it == ']') {
  ------------------
  |  Branch (2740:20): [True: 15.3k, False: 1.83M]
  ------------------
 2741|  15.3k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2741:23): [True: 15.3k, False: 0]
  ------------------
 2742|  15.3k|                     ++it;
 2743|  15.3k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2744|  15.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2744:26): [True: 31, False: 15.2k]
  ------------------
 2745|     31|                        return;
 2746|  15.2k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2747|  15.2k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2747:29): [True: 1.87k, False: 13.3k]
  ------------------
 2748|  1.87k|                           validate_root_flow_tail_after_close(ctx, it, end);
 2749|  1.87k|                        }
 2750|  15.2k|                     }
 2751|  15.2k|                     return;
 2752|  15.3k|                  }
 2753|      0|                  ctx.error = error_code::syntax_error;
 2754|      0|                  return;
 2755|  15.3k|               }
 2756|       |
 2757|  1.83M|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2757:20): [True: 293, False: 1.83M]
  |  Branch (2757:34): [True: 54, False: 1.83M]
  ------------------
 2758|    347|                  ctx.error = error_code::syntax_error;
 2759|    347|                  return;
 2760|    347|               }
 2761|  1.83M|               just_saw_comma = false;
 2762|       |
 2763|  1.83M|               value_type element{};
 2764|  1.83M|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2765|       |
 2766|  1.83M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2766:20): [True: 44.2k, False: 1.78M]
  ------------------
 2767|  44.2k|                  return;
 2768|       |
 2769|  1.78M|               bool saw_line_break_before_separator = false;
 2770|  1.78M|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2771|  1.78M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2771:20): [True: 27, False: 1.78M]
  ------------------
 2772|     27|                  return;
 2773|       |
 2774|  1.78M|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2774:20): [True: 1.78M, False: 2.52k]
  |  Branch (2774:33): [True: 10.9k, False: 1.77M]
  ------------------
 2775|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2776|  10.9k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2776:23): [True: 141, False: 10.8k]
  ------------------
 2777|    141|                     ctx.error = error_code::syntax_error;
 2778|    141|                     return;
 2779|    141|                  }
 2780|  10.8k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2781|  10.8k|                     glz::generic key_node = std::move(element);
 2782|  10.8k|                     ++it;
 2783|  10.8k|                     skip_inline_ws(it, end);
 2784|       |
 2785|  10.8k|                     glz::generic mapped{};
 2786|  10.8k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2787|  10.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2787:26): [True: 1.31k, False: 9.51k]
  ------------------
 2788|  1.31k|                        return;
 2789|       |
 2790|  9.51k|                     std::string key;
 2791|  9.51k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2791:26): [True: 14, False: 9.50k]
  ------------------
 2792|     14|                        return;
 2793|       |
 2794|  9.50k|                     glz::generic pair{};
 2795|  9.50k|                     pair[key] = std::move(mapped);
 2796|  9.50k|                     element = std::move(pair);
 2797|       |
 2798|  9.50k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2799|  9.50k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2799:26): [True: 2, False: 9.50k]
  ------------------
 2800|      2|                        return;
 2801|       |                  }
 2802|       |                  else {
 2803|       |                     ctx.error = error_code::syntax_error;
 2804|       |                     return;
 2805|       |                  }
 2806|  10.8k|               }
 2807|       |
 2808|  1.78M|               adapter.append(value, std::move(element));
 2809|       |
 2810|  1.78M|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2810:20): [True: 2.67k, False: 1.78M]
  ------------------
 2811|  2.67k|                  ctx.error = error_code::unexpected_end;
 2812|  2.67k|                  return;
 2813|  2.67k|               }
 2814|       |
 2815|  1.78M|               if (*it == ']') {
  ------------------
  |  Branch (2815:20): [True: 11.8k, False: 1.77M]
  ------------------
 2816|  11.8k|                  ++it;
 2817|  11.8k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2818|  11.8k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2818:23): [True: 264, False: 11.5k]
  ------------------
 2819|    264|                     return;
 2820|  11.5k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2821|  11.5k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2821:26): [True: 1.89k, False: 9.67k]
  ------------------
 2822|  1.89k|                        validate_root_flow_tail_after_close(ctx, it, end);
 2823|  1.89k|                     }
 2824|  11.5k|                  }
 2825|  11.5k|                  return;
 2826|  11.8k|               }
 2827|  1.77M|               else if (*it == ',') {
  ------------------
  |  Branch (2827:25): [True: 1.76M, False: 5.58k]
  ------------------
 2828|  1.76M|                  ++it;
 2829|  1.76M|                  just_saw_comma = true;
 2830|  1.76M|                  skip_flow_ws_and_newlines(ctx, it, end);
 2831|  1.76M|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2831:23): [True: 19, False: 1.76M]
  ------------------
 2832|     19|                     return;
 2833|  1.76M|               }
 2834|  5.58k|               else {
 2835|  5.58k|                  ctx.error = error_code::syntax_error;
 2836|  5.58k|                  return;
 2837|  5.58k|               }
 2838|  1.78M|            }
 2839|       |         }
 2840|       |         else if constexpr (!resizable<V>) {
 2841|       |            // Fixed-size containers (std::array)
 2842|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2843|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2844|       |               if (bool(ctx.error)) [[unlikely]]
 2845|       |                  return;
 2846|       |
 2847|       |               if (it == end) [[unlikely]] {
 2848|       |                  ctx.error = error_code::unexpected_end;
 2849|       |                  return;
 2850|       |               }
 2851|       |
 2852|       |               if (*it == ']') {
 2853|       |                  if (just_saw_comma) {
 2854|       |                     ++it;
 2855|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2856|       |                     if (bool(ctx.error)) [[unlikely]]
 2857|       |                        return;
 2858|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2859|       |                        if (ctx.current_indent() < 0) {
 2860|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2861|       |                        }
 2862|       |                     }
 2863|       |                     return;
 2864|       |                  }
 2865|       |                  ctx.error = error_code::syntax_error;
 2866|       |                  return;
 2867|       |               }
 2868|       |
 2869|       |               if (*it == ',' || *it == '#') {
 2870|       |                  ctx.error = error_code::syntax_error;
 2871|       |                  return;
 2872|       |               }
 2873|       |               just_saw_comma = false;
 2874|       |
 2875|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2876|       |
 2877|       |               if (bool(ctx.error)) [[unlikely]]
 2878|       |                  return;
 2879|       |
 2880|       |               adapter.commit_fixed_slot();
 2881|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2882|       |               if (bool(ctx.error)) [[unlikely]]
 2883|       |                  return;
 2884|       |
 2885|       |               if (it == end) [[unlikely]] {
 2886|       |                  ctx.error = error_code::unexpected_end;
 2887|       |                  return;
 2888|       |               }
 2889|       |
 2890|       |               if (*it == ']') {
 2891|       |                  ++it;
 2892|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2893|       |                  if (bool(ctx.error)) [[unlikely]]
 2894|       |                     return;
 2895|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2896|       |                     if (ctx.current_indent() < 0) {
 2897|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2898|       |                     }
 2899|       |                  }
 2900|       |                  return;
 2901|       |               }
 2902|       |               else if (*it == ',') {
 2903|       |                  ++it;
 2904|       |                  just_saw_comma = true;
 2905|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2906|       |                  if (bool(ctx.error)) [[unlikely]]
 2907|       |                     return;
 2908|       |               }
 2909|       |               else {
 2910|       |                  ctx.error = error_code::syntax_error;
 2911|       |                  return;
 2912|       |               }
 2913|       |            }
 2914|       |
 2915|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2916|       |            // skip to the closing bracket to consume overflow elements.
 2917|       |            int bracket_depth = 1;
 2918|       |            while (it != end && bracket_depth > 0) {
 2919|       |               if (*it == '[') {
 2920|       |                  ++bracket_depth;
 2921|       |               }
 2922|       |               else if (*it == ']') {
 2923|       |                  --bracket_depth;
 2924|       |               }
 2925|       |               ++it;
 2926|       |            }
 2927|       |         }
 2928|       |         else {
 2929|       |            ctx.error = error_code::syntax_error;
 2930|       |            return;
 2931|       |         }
 2932|  83.0k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2648|   362k|      {
 2649|   362k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2650|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2651|   362k|            if constexpr (!check_append_arrays(Opts)) {
 2652|   362k|               value.clear();
 2653|   362k|            }
 2654|       |         }
 2655|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2656|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2657|       |            value.clear();
 2658|       |         }
 2659|   362k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2686|  1.78M|            {
 2687|  1.78M|               if constexpr (emplace_backable<V>) {
 2688|  1.78M|                  container.emplace_back(std::move(element));
 2689|       |               }
 2690|       |               else if constexpr (emplaceable<V>) {
 2691|       |                  container.emplace(std::move(element));
 2692|       |               }
 2693|  1.78M|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3159|   269k|      {
 3160|   269k|         using V = std::remove_cvref_t<T>;
 3161|   269k|         using value_type = typename V::value_type;
 3162|       |
 3163|   269k|         struct sequence_container_adapter
 3164|   269k|         {
 3165|   269k|            size_t index = 0;
 3166|       |
 3167|   269k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3168|   269k|            {
 3169|   269k|               if constexpr (!resizable<V>) {
 3170|   269k|                  return index >= container.size();
 3171|   269k|               }
 3172|   269k|               else {
 3173|   269k|                  (void)container;
 3174|   269k|                  return false;
 3175|   269k|               }
 3176|   269k|            }
 3177|       |
 3178|   269k|            inline void commit_fixed_slot() noexcept { ++index; }
 3179|       |
 3180|   269k|            inline void append(V& container, value_type&& element) noexcept
 3181|   269k|            {
 3182|   269k|               if constexpr (emplace_backable<V>) {
 3183|   269k|                  container.emplace_back(std::move(element));
 3184|   269k|               }
 3185|   269k|               else if constexpr (emplaceable<V>) {
 3186|   269k|                  container.emplace(std::move(element));
 3187|   269k|               }
 3188|   269k|            }
 3189|   269k|         };
 3190|       |
 3191|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3192|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3193|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3194|   269k|         clear_sequence_before_read<Opts>(value);
 3195|       |
 3196|   269k|         sequence_container_adapter adapter{};
 3197|       |
 3198|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3199|   269k|         bool first_item = true;
 3200|   269k|         bool has_pending_item_anchor = false;
 3201|   269k|         std::string pending_item_anchor_name{};
 3202|   269k|         int32_t pending_item_anchor_indent = sequence_indent;
 3203|       |
 3204|   747k|         while (it != end) {
  ------------------
  |  Branch (3204:17): [True: 567k, False: 180k]
  ------------------
 3205|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3206|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3207|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3208|       |               if (adapter.fixed_capacity_reached(value)) {
 3209|       |                  return;
 3210|       |               }
 3211|       |            }
 3212|       |
 3213|       |            // Skip blank lines and comments, track indent
 3214|   567k|            int32_t line_indent = 0;
 3215|   567k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3216|   567k|            auto line_start = it;
 3217|       |
 3218|   909k|            while (it != end) {
  ------------------
  |  Branch (3218:20): [True: 870k, False: 38.8k]
  ------------------
 3219|   870k|               if (*it == '#') {
  ------------------
  |  Branch (3219:20): [True: 23.7k, False: 846k]
  ------------------
 3220|  23.7k|                  skip_comment(it, end);
 3221|  23.7k|                  skip_newline(it, end);
 3222|  23.7k|                  line_start = it;
 3223|  23.7k|                  line_indent = 0;
 3224|  23.7k|               }
 3225|   846k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3225:25): [True: 109k, False: 737k]
  |  Branch (3225:40): [True: 164k, False: 572k]
  ------------------
 3226|   273k|                  skip_newline(it, end);
 3227|   273k|                  line_start = it;
 3228|   273k|                  line_indent = 0;
 3229|   273k|               }
 3230|   572k|               else if (*it == ' ') {
  ------------------
  |  Branch (3230:25): [True: 116k, False: 456k]
  ------------------
 3231|   116k|                  line_start = it;
 3232|   116k|                  line_indent = 0;
 3233|   360k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3233:26): [True: 359k, False: 1.19k]
  |  Branch (3233:39): [True: 243k, False: 115k]
  ------------------
 3234|   243k|                     ++line_indent;
 3235|   243k|                     ++it;
 3236|   243k|                  }
 3237|       |
 3238|   116k|                  bool saw_tab = false;
 3239|   121k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3239:26): [True: 120k, False: 1.29k]
  |  Branch (3239:40): [True: 1.12k, False: 119k]
  |  Branch (3239:54): [True: 3.85k, False: 115k]
  ------------------
 3240|  4.97k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3240:32): [True: 3.67k, False: 1.29k]
  |  Branch (3240:43): [True: 1.29k, False: 0]
  ------------------
 3241|  4.97k|                     ++it;
 3242|  4.97k|                  }
 3243|       |
 3244|   116k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3244:23): [True: 1.29k, False: 115k]
  |  Branch (3244:36): [True: 2.25k, False: 112k]
  |  Branch (3244:51): [True: 22.5k, False: 90.4k]
  |  Branch (3244:66): [True: 13.4k, False: 76.9k]
  ------------------
 3245|       |                     // Blank or comment line - continue to next line
 3246|  39.5k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3246:26): [True: 38.2k, False: 1.29k]
  |  Branch (3246:39): [True: 13.4k, False: 24.7k]
  ------------------
 3247|  13.4k|                        skip_comment(it, end);
 3248|  13.4k|                     }
 3249|  39.5k|                     line_indent = 0;
 3250|  39.5k|                     continue;
 3251|  39.5k|                  }
 3252|       |
 3253|  76.9k|                  if (saw_tab) {
  ------------------
  |  Branch (3253:23): [True: 51, False: 76.9k]
  ------------------
 3254|     51|                     ctx.error = error_code::syntax_error;
 3255|     51|                     return;
 3256|     51|                  }
 3257|  76.9k|                  break; // Found content
 3258|  76.9k|               }
 3259|   456k|               else if (*it == '\t') {
  ------------------
  |  Branch (3259:25): [True: 4.79k, False: 451k]
  ------------------
 3260|  4.79k|                  line_start = it;
 3261|  22.4k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3261:26): [True: 21.6k, False: 786]
  |  Branch (3261:40): [True: 1.89k, False: 19.7k]
  |  Branch (3261:54): [True: 15.7k, False: 4.00k]
  ------------------
 3262|  4.79k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3262:23): [True: 786, False: 4.00k]
  |  Branch (3262:36): [True: 1.20k, False: 2.80k]
  |  Branch (3262:51): [True: 1.00k, False: 1.80k]
  |  Branch (3262:66): [True: 1.70k, False: 101]
  ------------------
 3263|  4.69k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3263:26): [True: 3.90k, False: 786]
  |  Branch (3263:39): [True: 1.70k, False: 2.20k]
  ------------------
 3264|  1.70k|                        skip_comment(it, end);
 3265|  1.70k|                     }
 3266|  4.69k|                     line_indent = 0;
 3267|  4.69k|                     continue;
 3268|  4.69k|                  }
 3269|    101|                  ctx.error = error_code::syntax_error;
 3270|    101|                  return;
 3271|  4.79k|               }
 3272|   451k|               else {
 3273|       |                  // At content (no leading space on this line)
 3274|       |                  // If first item and at '-', whitespace was consumed by caller;
 3275|       |                  // treat as having correct indentation
 3276|   451k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3276:23): [True: 269k, False: 181k]
  |  Branch (3276:37): [True: 268k, False: 877]
  ------------------
 3277|   268k|                     line_indent = sequence_indent;
 3278|   268k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   268k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3279:29): [True: 268k, False: 0]
  |  Branch (3279:49): [True: 266k, False: 1.84k]
  ------------------
 3280|   266k|                           auto probe = it;
 3281|   266k|                           int32_t leading_ws = 0;
 3282|   266k|                           bool saw_tab = false;
 3283|   631k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3283:35): [True: 630k, False: 265]
  |  Branch (3283:64): [True: 359k, False: 271k]
  |  Branch (3283:87): [True: 5.10k, False: 266k]
  ------------------
 3284|   364k|                              --probe;
 3285|   364k|                              ++leading_ws;
 3286|   364k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3286:41): [True: 1.97k, False: 362k]
  |  Branch (3286:52): [True: 3.21k, False: 359k]
  ------------------
 3287|   364k|                           }
 3288|   266k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3288:32): [True: 265, False: 266k]
  |  Branch (3288:61): [True: 155k, False: 110k]
  |  Branch (3288:85): [True: 29.3k, False: 81.3k]
  ------------------
 3289|   185k|                              if (saw_tab) {
  ------------------
  |  Branch (3289:35): [True: 49, False: 185k]
  ------------------
 3290|     49|                                 ctx.error = error_code::syntax_error;
 3291|     49|                                 return;
 3292|     49|                              }
 3293|   185k|                              line_indent = (std::max)(line_indent, leading_ws);
 3294|   185k|                           }
 3295|   266k|                        }
 3296|   268k|                     }
 3297|   268k|                  }
 3298|   268k|                  break;
 3299|   451k|               }
 3300|   870k|            }
 3301|       |
 3302|   567k|            if (it == end) break;
  ------------------
  |  Branch (3302:17): [True: 38.8k, False: 528k]
  ------------------
 3303|       |
 3304|       |            // Check for document end marker
 3305|   528k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3305:17): [True: 1.85k, False: 526k]
  ------------------
 3306|       |
 3307|       |            // Check for dedent
 3308|   526k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3308:17): [True: 11.8k, False: 514k]
  ------------------
 3309|  11.8k|               it = line_start;
 3310|  11.8k|               return;
 3311|  11.8k|            }
 3312|       |
 3313|   514k|            if (*it == '&') {
  ------------------
  |  Branch (3313:17): [True: 14.5k, False: 500k]
  ------------------
 3314|       |               // Standalone anchor lines before "- item" are only supported for
 3315|       |               // indentless mapping values. At top-level block sequences these are
 3316|       |               // malformed in yaml-test-suite cases.
 3317|  14.5k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3317:20): [True: 15, False: 14.4k]
  ------------------
 3318|     15|                  ctx.error = error_code::syntax_error;
 3319|     15|                  return;
 3320|     15|               }
 3321|       |
 3322|  14.4k|               ++it;
 3323|  14.4k|               auto pending_name = parse_anchor_name(it, end);
 3324|  14.4k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3324:20): [True: 25, False: 14.4k]
  ------------------
 3325|     25|                  ctx.error = error_code::syntax_error;
 3326|     25|                  return;
 3327|     25|               }
 3328|  14.4k|               skip_inline_ws(it, end);
 3329|  14.4k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3329:20): [True: 14.3k, False: 120]
  |  Branch (3329:33): [True: 2.99k, False: 11.3k]
  ------------------
 3330|  2.99k|                  skip_comment(it, end);
 3331|  2.99k|               }
 3332|       |
 3333|  14.4k|               has_pending_item_anchor = true;
 3334|  14.4k|               pending_item_anchor_name = std::string(pending_name);
 3335|  14.4k|               pending_item_anchor_indent = line_indent;
 3336|       |
 3337|  14.4k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3337:20): [True: 131, False: 14.3k]
  |  Branch (3337:34): [True: 6.60k, False: 7.73k]
  |  Branch (3337:49): [True: 124, False: 6.47k]
  ------------------
 3338|    255|                  ctx.error = error_code::syntax_error;
 3339|    255|                  return;
 3340|    255|               }
 3341|       |
 3342|  14.2k|               skip_newline(it, end);
 3343|  14.2k|               continue;
 3344|  14.4k|            }
 3345|       |
 3346|       |            // Expect dash for sequence item
 3347|   500k|            if (*it != '-') {
  ------------------
  |  Branch (3347:17): [True: 23.8k, False: 476k]
  ------------------
 3348|  23.8k|               it = line_start;
 3349|  23.8k|               return;
 3350|  23.8k|            }
 3351|       |
 3352|       |            // Compute the actual column of this sequence dash.
 3353|       |            // This is needed by plain-scalar multiline folding to distinguish
 3354|       |            // sibling "- item" entries from deeper "- " continuation content.
 3355|   476k|            dash_col = line_indent;
 3356|   476k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3357|   476k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3357:20): [True: 476k, False: 49]
  ------------------
 3358|   476k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3359|   476k|               }
 3360|   476k|            }
 3361|       |
 3362|   476k|            ++it; // Skip '-'
 3363|       |
 3364|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3365|   476k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3365:17): [True: 473k, False: 3.24k]
  |  Branch (3365:30): [True: 8.13k, False: 464k]
  ------------------
 3366|       |               // Not a sequence item (could be a number like -5)
 3367|  8.13k|               it = line_start;
 3368|  8.13k|               return;
 3369|  8.13k|            }
 3370|       |
 3371|   468k|            bool saw_tab_after_dash = false;
 3372|  1.07M|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3372:20): [True: 1.06M, False: 4.85k]
  |  Branch (3372:34): [True: 574k, False: 492k]
  |  Branch (3372:48): [True: 29.4k, False: 463k]
  ------------------
 3373|   603k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3373:37): [True: 4.02k, False: 599k]
  |  Branch (3373:59): [True: 25.9k, False: 573k]
  ------------------
 3374|   603k|               ++it;
 3375|   603k|            }
 3376|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3377|   468k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3377:17): [True: 25.9k, False: 442k]
  |  Branch (3377:39): [True: 25.1k, False: 779]
  |  Branch (3377:52): [True: 909, False: 24.2k]
  ------------------
 3378|    909|               const auto after_dash = it + 1;
 3379|    909|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3379:20): [True: 9, False: 900]
  |  Branch (3379:41): [True: 15, False: 885]
  ------------------
 3380|     24|                  ctx.error = error_code::syntax_error;
 3381|     24|                  return;
 3382|     24|               }
 3383|    909|            }
 3384|       |
 3385|       |            // Get reference to element to parse into
 3386|   468k|            auto parse_element = [&](auto& element) {
 3387|   468k|               const char* element_start = (it != end) ? &*it : nullptr;
 3388|       |
 3389|       |               // Check what follows
 3390|   468k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   468k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3396|   468k|                     return;
 3397|   468k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   468k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   468k|                  ctx.sequence_item_value_context = true;
 3400|   468k|                  ctx.sequence_dash_indent = dash_col;
 3401|   468k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   468k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   468k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   468k|                  ctx.pop_indent();
 3405|   468k|               }
 3406|   468k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   468k|                  skip_ws_and_comment(it, end);
 3409|   468k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   468k|                  auto nested_start = it;
 3413|   468k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   468k|                  if (bool(ctx.error)) [[unlikely]]
 3415|   468k|                     return;
 3416|   468k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   468k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3422|   468k|                  if (nested_indent > effective_line_indent) {
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|   468k|                     const int32_t element_indent =
 3428|   468k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3429|   468k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3430|   468k|                        return;
 3431|   468k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|   468k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|   468k|                     ctx.sequence_item_value_context = true;
 3434|   468k|                     ctx.sequence_dash_indent = dash_col;
 3435|   468k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|   468k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|   468k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|   468k|                     ctx.pop_indent();
 3439|   468k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   468k|               }
 3442|       |
 3443|   468k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3444|   468k|                  const char* element_end = (it != end) ? &*it : element_start;
 3445|   468k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|   468k|                                                                      pending_item_anchor_indent};
 3447|   468k|                  has_pending_item_anchor = false;
 3448|   468k|               }
 3449|   468k|            };
 3450|       |
 3451|   468k|            if constexpr (emplace_backable<V>) {
 3452|   468k|               auto& element = value.emplace_back();
 3453|   468k|               parse_element(element);
 3454|       |            }
 3455|       |            else if constexpr (emplaceable<V>) {
 3456|       |               value_type element{};
 3457|       |               parse_element(element);
 3458|       |               if (!bool(ctx.error)) {
 3459|       |                  adapter.append(value, std::move(element));
 3460|       |               }
 3461|       |            }
 3462|       |            else if constexpr (!resizable<V>) {
 3463|       |               parse_element(value[adapter.index]);
 3464|       |               adapter.commit_fixed_slot();
 3465|       |            }
 3466|       |            else {
 3467|       |               ctx.error = error_code::syntax_error;
 3468|       |               return;
 3469|       |            }
 3470|       |
 3471|   468k|            first_item = false;
 3472|       |
 3473|   468k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3473:17): [True: 4.06k, False: 464k]
  ------------------
 3474|  4.06k|               return;
 3475|       |
 3476|       |            // Note: after parsing nested block content, iterator may already be
 3477|       |            // at the start of the next line. The outer loop will handle it.
 3478|   468k|         }
 3479|   269k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3386|   468k|            auto parse_element = [&](auto& element) {
 3387|   468k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3387:44): [True: 463k, False: 4.80k]
  ------------------
 3388|       |
 3389|       |               // Check what follows
 3390|   468k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3390:20): [True: 463k, False: 4.80k]
  |  Branch (3390:33): [True: 334k, False: 129k]
  ------------------
 3391|       |                  // Content on same line as dash - set indent to one less than content column
 3392|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3393|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3394|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3395|   334k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3395:23): [True: 0, False: 334k]
  ------------------
 3396|      0|                     return;
 3397|   334k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3398|   334k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3399|   334k|                  ctx.sequence_item_value_context = true;
 3400|   334k|                  ctx.sequence_dash_indent = dash_col;
 3401|   334k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3402|   334k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3403|   334k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3404|   334k|                  ctx.pop_indent();
 3405|   334k|               }
 3406|   133k|               else {
 3407|       |                  // Value on next line - nested block
 3408|   133k|                  skip_ws_and_comment(it, end);
 3409|   133k|                  skip_newline(it, end);
 3410|       |
 3411|       |                  // Get indent of nested content
 3412|   133k|                  auto nested_start = it;
 3413|   133k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3414|   133k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3414:23): [True: 9, False: 133k]
  ------------------
 3415|      9|                     return;
 3416|   133k|                  it = nested_start;
 3417|       |
 3418|       |                  // Content is nested only if indented more than the current line.
 3419|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3420|       |                  // This prevents content at column 0 from being treated as nested.
 3421|   133k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3421:57): [True: 5.05k, False: 128k]
  ------------------
 3422|   133k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3422:23): [True: 97.1k, False: 36.7k]
  ------------------
 3423|       |                     // Save and set indent for nested parsing.
 3424|       |                     // A struct element reads the pushed indent as its own key column; every
 3425|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3426|       |                     // less than the content indent and its content passes "indent > parent".
 3427|  97.1k|                     const int32_t element_indent =
 3428|  97.1k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3428:25): [Folded, False: 97.1k]
  ------------------
 3429|  97.1k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3429:26): [True: 0, False: 97.1k]
  ------------------
 3430|      0|                        return;
 3431|  97.1k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3432|  97.1k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3433|  97.1k|                     ctx.sequence_item_value_context = true;
 3434|  97.1k|                     ctx.sequence_dash_indent = dash_col;
 3435|  97.1k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3436|  97.1k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3437|  97.1k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3438|  97.1k|                     ctx.pop_indent();
 3439|  97.1k|                  }
 3440|       |                  // else: empty element (default constructed)
 3441|   133k|               }
 3442|       |
 3443|   468k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3443:20): [True: 5.00k, False: 463k]
  |  Branch (3443:47): [True: 4.54k, False: 465]
  ------------------
 3444|  4.54k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3444:45): [True: 3.57k, False: 968]
  ------------------
 3445|  4.54k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3446|  4.54k|                                                                      pending_item_anchor_indent};
 3447|  4.54k|                  has_pending_item_anchor = false;
 3448|  4.54k|               }
 3449|   468k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_RNSI_12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5503|   548k|   {
 5504|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5505|       |         // In flow context, only treat plain content as an implicit "key: value"
 5506|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5507|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5508|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5509|       |            // once per entry per nesting level over the whole remaining flow collection.
 5510|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5511|       |            // See `line_could_be_block_mapping` for why a quote is an indicator only where a node
 5512|       |            // can begin. Brackets need no such guard here: ns-plain-safe-in keeps them out of a
 5513|       |            // flow-context plain scalar, so every one of them is an indicator.
 5514|       |            bool at_node_start = true;
 5515|       |            int depth = 0;
 5516|       |            while (pos != stop) {
 5517|       |               const char c = *pos;
 5518|       |               if (c == ' ' || c == '\t') {
 5519|       |                  ++pos;
 5520|       |                  continue;
 5521|       |               }
 5522|       |               const bool node_start = std::exchange(at_node_start, false);
 5523|       |
 5524|       |               if ((c == '"' || c == '\'') && node_start) {
 5525|       |                  if (not yaml::skip_probe_quoted_scalar(pos, stop)) return false;
 5526|       |                  continue;
 5527|       |               }
 5528|       |               if (c == '[' || c == '{') {
 5529|       |                  ++depth;
 5530|       |                  at_node_start = true;
 5531|       |                  ++pos;
 5532|       |                  continue;
 5533|       |               }
 5534|       |               if (c == ']' || c == '}') {
 5535|       |                  if (depth == 0) return false;
 5536|       |                  --depth;
 5537|       |                  ++pos;
 5538|       |                  continue;
 5539|       |               }
 5540|       |               if (c == ',' && depth == 0) return false;
 5541|       |               if (c == ':' && depth == 0) {
 5542|       |                  auto next = pos + 1;
 5543|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5544|       |               }
 5545|       |               // Inside a nested collection ',' separates entries and ':' ends a key.
 5546|       |               if (c == ',' || c == ':') {
 5547|       |                  at_node_start = true;
 5548|       |                  ++pos;
 5549|       |                  continue;
 5550|       |               }
 5551|       |               if (node_start && yaml::skip_probe_node_property(pos, stop)) {
 5552|       |                  at_node_start = true;
 5553|       |                  continue;
 5554|       |               }
 5555|       |               ++pos;
 5556|       |            }
 5557|       |            return false;
 5558|       |         };
 5559|       |
 5560|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5561|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5562|       |               return;
 5563|       |            }
 5564|       |            if (bool(ctx.error)) {
 5565|       |               return;
 5566|       |            }
 5567|       |         }
 5568|       |
 5569|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5570|       |         return;
 5571|       |      }
 5572|       |
 5573|   548k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5573:11): [True: 314k, False: 233k]
  ------------------
 5574|   314k|         return;
 5575|   314k|      }
 5576|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5577|   233k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5577:11): [True: 24.3k, False: 209k]
  ------------------
 5578|  24.3k|         return;
 5579|  24.3k|      }
 5580|   209k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5581|   209k|   }
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISN_EEDaSZ_:
 5938|  84.5k|            auto is_word_boundary = [&](const auto ptr) {
 5939|  84.5k|               if (ptr == end) {
  ------------------
  |  Branch (5939:20): [True: 9.96k, False: 74.6k]
  ------------------
 5940|  9.96k|                  return true;
 5941|  9.96k|               }
 5942|  74.6k|               if (*ptr == ':') {
  ------------------
  |  Branch (5942:20): [True: 26.5k, False: 48.1k]
  ------------------
 5943|  26.5k|                  auto next = ptr + 1;
 5944|  26.5k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5944:26): [True: 9.84k, False: 16.6k]
  |  Branch (5944:43): [True: 3.28k, False: 13.3k]
  |  Branch (5944:59): [True: 3.76k, False: 9.61k]
  |  Branch (5944:76): [True: 2.85k, False: 6.75k]
  |  Branch (5944:93): [True: 4.28k, False: 2.47k]
  ------------------
 5945|  26.5k|               }
 5946|  48.1k|               return is_plain_scalar_boundary(*ptr);
 5947|  74.6k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5864|  48.1k|            auto is_plain_scalar_boundary = [](const char ch) {
 5865|  48.1k|               switch (ch) {
 5866|  1.40k|               case ' ':
  ------------------
  |  Branch (5866:16): [True: 1.40k, False: 46.6k]
  ------------------
 5867|  2.58k|               case '\t':
  ------------------
  |  Branch (5867:16): [True: 1.18k, False: 46.9k]
  ------------------
 5868|  18.0k|               case '\n':
  ------------------
  |  Branch (5868:16): [True: 15.4k, False: 32.6k]
  ------------------
 5869|  39.2k|               case '\r':
  ------------------
  |  Branch (5869:16): [True: 21.1k, False: 26.9k]
  ------------------
 5870|  40.2k|               case ',':
  ------------------
  |  Branch (5870:16): [True: 1.00k, False: 47.0k]
  ------------------
 5871|  41.1k|               case ']':
  ------------------
  |  Branch (5871:16): [True: 914, False: 47.1k]
  ------------------
 5872|  42.0k|               case '}':
  ------------------
  |  Branch (5872:16): [True: 926, False: 47.1k]
  ------------------
 5873|  42.0k|                  return true;
 5874|  6.04k|               default:
  ------------------
  |  Branch (5874:16): [True: 6.04k, False: 42.0k]
  ------------------
 5875|  6.04k|                  return false;
 5876|  48.1k|               }
 5877|  48.1k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISN_EEDaSZ_:
 5879|  76.0k|            auto has_indented_block_continuation = [&](auto word_end) {
 5880|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5881|       |                  return false;
 5882|       |               }
 5883|  76.0k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5883:20): [True: 11.9k, False: 64.0k]
  ------------------
 5884|  11.9k|                  return false;
 5885|  11.9k|               }
 5886|  64.0k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5886:20): [True: 7.28k, False: 56.7k]
  |  Branch (5886:40): [True: 41.3k, False: 15.4k]
  |  Branch (5886:61): [True: 20.4k, False: 20.9k]
  ------------------
 5887|  27.6k|                  return false;
 5888|  27.6k|               }
 5889|       |
 5890|  36.3k|               auto look = word_end;
 5891|  36.3k|               yaml::skip_newline(look, end);
 5892|   185k|               while (look != end) {
  ------------------
  |  Branch (5892:23): [True: 175k, False: 9.22k]
  ------------------
 5893|   175k|                  int32_t line_indent = 0;
 5894|   237k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5894:26): [True: 236k, False: 399]
  |  Branch (5894:41): [True: 61.1k, False: 175k]
  ------------------
 5895|  61.1k|                     ++line_indent;
 5896|  61.1k|                     ++look;
 5897|  61.1k|                  }
 5898|   175k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5898:23): [True: 175k, False: 399]
  |  Branch (5898:38): [True: 2.26k, False: 173k]
  ------------------
 5899|  2.26k|                     return false;
 5900|  2.26k|                  }
 5901|   173k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5901:23): [True: 399, False: 173k]
  |  Branch (5901:38): [True: 125k, False: 48.2k]
  |  Branch (5901:55): [True: 13.1k, False: 35.0k]
  ------------------
 5902|   138k|                     if (look != end) {
  ------------------
  |  Branch (5902:26): [True: 138k, False: 399]
  ------------------
 5903|   138k|                        yaml::skip_newline(look, end);
 5904|   138k|                        continue;
 5905|   138k|                     }
 5906|    399|                     return false;
 5907|   138k|                  }
 5908|  35.0k|                  if (*look == '#') {
  ------------------
  |  Branch (5908:23): [True: 11.5k, False: 23.4k]
  ------------------
 5909|  11.5k|                     yaml::skip_comment(look, end);
 5910|  11.5k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5910:26): [True: 10.5k, False: 953]
  |  Branch (5910:42): [True: 5.12k, False: 5.46k]
  |  Branch (5910:59): [True: 5.41k, False: 52]
  ------------------
 5911|  10.5k|                        yaml::skip_newline(look, end);
 5912|  10.5k|                        continue;
 5913|  10.5k|                     }
 5914|  1.00k|                     return false;
 5915|  11.5k|                  }
 5916|       |
 5917|       |                  // If the next non-empty line is an implicit mapping entry,
 5918|       |                  // don't treat it as scalar continuation for auto-deduced
 5919|       |                  // booleans/nulls.
 5920|  23.4k|                  {
 5921|  23.4k|                     auto scan = look;
 5922|   246k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5922:29): [True: 245k, False: 992]
  |  Branch (5922:44): [True: 236k, False: 8.70k]
  |  Branch (5922:61): [True: 234k, False: 2.01k]
  ------------------
 5923|   234k|                        if (*scan == ':') {
  ------------------
  |  Branch (5923:29): [True: 19.7k, False: 214k]
  ------------------
 5924|  19.7k|                           auto after_colon = scan + 1;
 5925|  19.7k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5925:32): [True: 413, False: 19.3k]
  |  Branch (5925:54): [True: 6.78k, False: 12.5k]
  |  Branch (5925:77): [True: 1.88k, False: 10.6k]
  ------------------
 5926|  11.7k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5926:32): [True: 1.51k, False: 9.18k]
  |  Branch (5926:56): [True: 1.18k, False: 8.00k]
  ------------------
 5927|  11.7k|                              return false;
 5928|  11.7k|                           }
 5929|  19.7k|                        }
 5930|   222k|                        ++scan;
 5931|   222k|                     }
 5932|  23.4k|                  }
 5933|       |
 5934|  11.7k|                  return line_indent > ctx.current_indent();
 5935|  23.4k|               }
 5936|  9.22k|               return false;
 5937|  36.3k|            };
_ZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5457|   653k|   {
 5458|   653k|      using counts = yaml_variant_type_count<Variant>;
 5459|       |      if constexpr (counts::n_object == 0) {
 5460|       |         return false;
 5461|       |      }
 5462|   653k|      else {
 5463|       |         // Quick check: if no viable mapping separator in the current span,
 5464|       |         // avoid expensive speculative parse.
 5465|   653k|         const bool could_be_mapping = [&] {
 5466|   653k|            if constexpr (yaml::check_flow_context(Opts)) {
 5467|   653k|               return line_could_be_flow_mapping(it, end);
 5468|   653k|            }
 5469|   653k|            else {
 5470|   653k|               return yaml::line_could_be_block_mapping(it, end);
 5471|   653k|            }
 5472|   653k|         }();
 5473|   653k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5473:14): [True: 258k, False: 394k]
  ------------------
 5474|   258k|            return false;
 5475|   258k|         }
 5476|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5477|   394k|         auto temp_ctx = ctx.make_speculative();
 5478|   394k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5479|   394k|                                                                                               end);
 5480|   394k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5481|   394k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5482|   394k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5482:14): [True: 342k, False: 51.4k]
  ------------------
 5483|   342k|            ctx.anchors = std::move(temp_ctx.anchors);
 5484|   342k|            return true;
 5485|   342k|         }
 5486|       |         // The line matched "key: value" pattern but parsing failed.
 5487|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5488|       |         // so propagate the error rather than silently falling back to string.
 5489|  51.4k|         ctx.error = temp_ctx.error;
 5490|  51.4k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5491|  51.4k|         return false;
 5492|   394k|      }
 5493|   653k|   }
_ZZN3glz36try_parse_block_mapping_into_variantINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5465|   653k|         const bool could_be_mapping = [&] {
 5466|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5467|       |               return line_could_be_flow_mapping(it, end);
 5468|       |            }
 5469|   653k|            else {
 5470|   653k|               return yaml::line_could_be_block_mapping(it, end);
 5471|   653k|            }
 5472|   653k|         }();
_ZZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_ENKUlT_E_clISD_EEDaSM_:
  145|  1.78k|               auto is_document_start = [&](auto pos) {
  146|  1.78k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (146:23): [True: 1.07k, False: 714]
  |  Branch (146:41): [True: 430, False: 645]
  |  Branch (146:58): [True: 361, False: 69]
  |  Branch (146:75): [True: 334, False: 27]
  ------------------
  147|    334|                     auto after = pos + 3;
  148|    334|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (148:29): [True: 12, False: 322]
  |  Branch (148:45): [True: 106, False: 216]
  |  Branch (148:62): [True: 147, False: 69]
  |  Branch (148:80): [True: 39, False: 30]
  |  Branch (148:98): [True: 18, False: 12]
  ------------------
  149|     12|                            *after == '#';
  ------------------
  |  Branch (149:29): [True: 1, False: 11]
  ------------------
  150|    334|                  }
  151|  1.45k|                  return false;
  152|  1.78k|               };
_ZN3glz9read_yamlITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERNSt3__16vectorIcNS8_9allocatorIcEEEEEENS_9error_ctxEOT0_OT1_:
 6696|  39.3k|   {
 6697|  39.3k|      if (buffer.size() == 0) {
  ------------------
  |  Branch (6697:11): [True: 0, False: 39.3k]
  ------------------
 6698|      0|         using V = std::remove_cvref_t<T>;
 6699|      0|         if constexpr (requires { value = nullptr; }) {
 6700|      0|            value = nullptr;
 6701|      0|            return {};
 6702|       |         }
 6703|       |         else if constexpr (nullable_like<V>) {
 6704|       |            value = {};
 6705|       |            return {};
 6706|       |         }
 6707|      0|      }
 6708|      0|      yaml::yaml_context ctx{};
 6709|  39.3k|      return read<set_yaml<Opts>()>(std::forward<T>(value), std::forward<Buffer>(buffer), ctx);
 6710|  39.3k|   }

