LLVMFuzzerTestOneInput:
    8|  32.8k|{
    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|  32.8k|   {
   13|  32.8k|      const std::vector<char> buffer{Data, Data + Size};
   14|       |
   15|  32.8k|      static constexpr glz::opts opts{.format = glz::YAML, .null_terminated = false};
   16|  32.8k|      glz::generic yaml{};
   17|  32.8k|      auto ec = glz::read<opts>(yaml, buffer);
   18|  32.8k|      if (!ec) {
  ------------------
  |  Branch (18:11): [True: 5.60k, False: 27.2k]
  ------------------
   19|  5.60k|         [[maybe_unused]] auto s = yaml.size();
   20|  5.60k|      }
   21|  32.8k|   }
   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|  32.8k|   {
   26|  32.8k|      const std::vector<char> buffer{Data, Data + Size};
   27|       |
   28|  32.8k|      glz::generic yaml{};
   29|  32.8k|      auto ec = glz::read_yaml(yaml, buffer);
   30|  32.8k|      if (!ec) {
  ------------------
  |  Branch (30:11): [True: 5.60k, False: 27.2k]
  ------------------
   31|  5.60k|         [[maybe_unused]] auto s = yaml.size();
   32|  5.60k|      }
   33|  32.8k|   }
   34|       |
   35|       |   // use a vector with null termination instead of a std::string to avoid
   36|       |   // small string optimization to hide bounds problems
   37|  32.8k|   std::vector<char> buffer{Data, Data + Size};
   38|  32.8k|   buffer.push_back('\0');
   39|       |
   40|       |   // const qualified input buffer
   41|  32.8k|   {
   42|  32.8k|      const auto& input = buffer;
   43|  32.8k|      glz::generic yaml{};
   44|  32.8k|      auto ec = glz::read_yaml(yaml, input);
   45|  32.8k|      if (!ec) {
  ------------------
  |  Branch (45:11): [True: 4.35k, False: 28.4k]
  ------------------
   46|  4.35k|         [[maybe_unused]] auto s = yaml.size();
   47|  4.35k|      }
   48|  32.8k|   }
   49|       |
   50|       |   // non-const input buffer
   51|  32.8k|   {
   52|  32.8k|      glz::generic yaml{};
   53|  32.8k|      auto ec = glz::read_yaml(yaml, buffer);
   54|  32.8k|      if (!ec) {
  ------------------
  |  Branch (54:11): [True: 4.35k, False: 28.4k]
  ------------------
   55|  4.35k|         [[maybe_unused]] auto s = yaml.size();
   56|  4.35k|      }
   57|  32.8k|   }
   58|       |
   59|  32.8k|   return 0;
   60|  32.8k|}

_ZN3glz11empty_rangeITkNS_5rangeERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEEEbOT_:
  284|  3.09M|   {
  285|  3.09M|#ifdef __cpp_lib_ranges
  286|  3.09M|      return std::ranges::empty(rng);
  287|       |#else
  288|       |      // in lieu of std::ranges::empty
  289|       |      if constexpr (requires() {
  290|       |                       { rng.empty() } -> std::convertible_to<bool>;
  291|       |                    }) {
  292|       |         return rng.empty();
  293|       |      }
  294|       |      else if constexpr (requires() {
  295|       |                            { rng.size() } -> std::same_as<std::size_t>;
  296|       |                         }) {
  297|       |         return rng.size() == std::size_t{0};
  298|       |      }
  299|       |      else {
  300|       |         return std::cbegin(rng) == std::cend(rng);
  301|       |      }
  302|       |#endif
  303|  3.09M|   }
_ZN3glz11empty_rangeITkNS_5rangeERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEEEbOT_:
  284|  7.13M|   {
  285|  7.13M|#ifdef __cpp_lib_ranges
  286|  7.13M|      return std::ranges::empty(rng);
  287|       |#else
  288|       |      // in lieu of std::ranges::empty
  289|       |      if constexpr (requires() {
  290|       |                       { rng.empty() } -> std::convertible_to<bool>;
  291|       |                    }) {
  292|       |         return rng.empty();
  293|       |      }
  294|       |      else if constexpr (requires() {
  295|       |                            { rng.size() } -> std::same_as<std::size_t>;
  296|       |                         }) {
  297|       |         return rng.size() == std::size_t{0};
  298|       |      }
  299|       |      else {
  300|       |         return std::cbegin(rng) == std::cend(rng);
  301|       |      }
  302|       |#endif
  303|  7.13M|   }

_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEED2Ev:
  569|  34.7M|      {
  570|  34.7M|         free_data();
  571|  34.7M|         free_index();
  572|  34.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE9free_dataEv:
  266|  34.7M|      {
  267|  34.7M|         destroy_all();
  268|  34.7M|         ::operator delete(data_);
  269|  34.7M|         data_ = nullptr;
  270|  34.7M|         size_ = 0;
  271|  34.7M|         capacity_ = 0;
  272|  34.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11destroy_allEv:
  259|  45.5M|      {
  260|  87.6M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (260:31): [True: 42.1M, False: 45.5M]
  ------------------
  261|  42.1M|            std::destroy_at(data_ + i);
  262|  42.1M|         }
  263|  45.5M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE10free_indexEv:
  308|  34.7M|      {
  309|  34.7M|         std::free(index_);
  310|  34.7M|         index_ = nullptr;
  311|  34.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEC2Ev:
  566|  18.3M|      ordered_small_map() = default;
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEaSEOS4_:
  628|  4.53k|      {
  629|  4.53k|         if (this != &other) {
  ------------------
  |  Branch (629:14): [True: 4.53k, False: 0]
  ------------------
  630|  4.53k|            free_data();
  631|  4.53k|            free_index();
  632|  4.53k|            data_ = other.data_;
  633|  4.53k|            size_ = other.size_;
  634|  4.53k|            capacity_ = other.capacity_;
  635|  4.53k|            index_ = other.index_;
  636|  4.53k|            other.data_ = nullptr;
  637|  4.53k|            other.size_ = 0;
  638|  4.53k|            other.capacity_ = 0;
  639|  4.53k|            other.index_ = nullptr;
  640|  4.53k|         }
  641|  4.53k|         return *this;
  642|  4.53k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEEC2EOS4_:
  610|  16.3M|         : data_(other.data_), size_(other.size_), capacity_(other.capacity_), index_(other.index_)
  611|  16.3M|      {
  612|  16.3M|         other.data_ = nullptr;
  613|  16.3M|         other.size_ = 0;
  614|  16.3M|         other.capacity_ = 0;
  615|  16.3M|         other.index_ = nullptr;
  616|  16.3M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE5emptyEv:
  662|  16.2M|      [[nodiscard]] bool empty() const noexcept { return size_ == 0; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE5beginEv:
  645|  16.1M|      iterator begin() noexcept { return data_; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE3endEv:
  649|  47.1M|      iterator end() noexcept { return data_ + size_; }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11linear_findINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEPNS6_4pairISC_S3_EERKT_:
  421|  26.3M|      {
  422|  69.1M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (422:31): [True: 45.1M, False: 24.0M]
  ------------------
  423|  45.1M|            if (data_[i].first == key) return data_ + i;
  ------------------
  |  Branch (423:17): [True: 2.30M, False: 42.8M]
  ------------------
  424|  45.1M|         }
  425|  24.0M|         return data_ + size_;
  426|  26.3M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE14grow_if_neededEv:
  217|  28.2M|      {
  218|  28.2M|         if (size_ == capacity_) {
  ------------------
  |  Branch (218:14): [True: 10.7M, False: 17.4M]
  ------------------
  219|  10.7M|            if (size_ == max_u32) {
  ------------------
  |  Branch (219:17): [True: 0, False: 10.7M]
  ------------------
  220|      0|               throw_capacity_overflow();
  221|      0|            }
  222|  10.7M|            const uint32_t new_cap = next_data_capacity(capacity_);
  223|  10.7M|            reallocate_data(new_cap);
  224|  10.7M|         }
  225|  28.2M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE18next_data_capacityEj:
  120|  10.7M|      {
  121|  10.7M|         if (current == 0) return 4;
  ------------------
  |  Branch (121:14): [True: 8.92M, False: 1.87M]
  ------------------
  122|  1.87M|         if (current > (max_u32 / 2)) return max_u32;
  ------------------
  |  Branch (122:14): [True: 0, False: 1.87M]
  ------------------
  123|  1.87M|         return current * 2;
  124|  1.87M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE15reallocate_dataEj:
  205|  10.7M|      {
  206|  10.7M|         if (new_cap < size_) {
  ------------------
  |  Branch (206:14): [True: 0, False: 10.7M]
  ------------------
  207|      0|            throw_capacity_overflow();
  208|      0|         }
  209|  10.7M|         auto* new_data = allocate_and_relocate(new_cap);
  210|  10.7M|         destroy_all();
  211|  10.7M|         ::operator delete(data_);
  212|  10.7M|         data_ = new_data;
  213|  10.7M|         capacity_ = new_cap;
  214|  10.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE21allocate_and_relocateEj:
  159|  10.7M|      {
  160|  10.7M|         auto* new_data = static_cast<value_type*>(::operator new(checked_data_allocation_bytes(new_cap)));
  161|  10.7M|#if __cpp_exceptions
  162|  10.7M|         uint32_t constructed = 0;
  163|  10.7M|         try {
  164|  24.6M|            for (; constructed < size_; ++constructed) {
  ------------------
  |  Branch (164:20): [True: 13.8M, False: 10.7M]
  ------------------
  165|  13.8M|               std::construct_at(new_data + constructed, std::move_if_noexcept(data_[constructed]));
  166|  13.8M|            }
  167|  10.7M|         }
  168|  10.7M|         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|  10.7M|         return new_data;
  179|  10.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE29checked_data_allocation_bytesEj:
  134|  10.7M|      {
  135|  10.7M|         if (count > ((std::numeric_limits<size_t>::max)() / sizeof(value_type))) {
  ------------------
  |  Branch (135:14): [True: 0, False: 10.7M]
  ------------------
  136|      0|            GLZ_THROW_OR_ABORT(std::bad_alloc{});
  ------------------
  |  |    8|      0|#define GLZ_THROW_OR_ABORT(EXC) (throw(EXC))
  ------------------
  137|      0|         }
  138|  10.7M|         return static_cast<size_t>(count) * sizeof(value_type);
  139|  10.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE8hash_keyENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEE:
   97|  17.6M|      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|  7.98M|      {
  286|  7.98M|         const uint32_t a = h & bloom_mask;
  287|  7.98M|         const uint32_t b = (h >> 10) & bloom_mask;
  288|  7.98M|         return (index_->bloom[a >> 3] & (uint8_t(1) << (a & 7))) && (index_->bloom[b >> 3] & (uint8_t(1) << (b & 7)));
  ------------------
  |  Branch (288:17): [True: 4.23M, False: 3.74M]
  |  Branch (288:70): [True: 4.01M, False: 223k]
  ------------------
  289|  7.98M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE17index_find_or_posINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEENS4_17index_find_resultERKT_j:
  400|  4.64M|      {
  401|  4.64M|         ensure_index();
  402|       |
  403|  4.64M|         const auto* base = index_entries();
  404|  4.64M|         const auto* idx_end = base + index_->size;
  405|  4.64M|         const auto* p = branchless_lower_bound(base, index_->size, h);
  406|  4.64M|         const size_t pos = static_cast<size_t>(p - base);
  407|       |
  408|       |         // Scan adjacent entries with matching hash
  409|  4.67M|         for (auto* scan = p; scan != idx_end && scan->key_hash == h; ++scan) {
  ------------------
  |  Branch (409:31): [True: 4.66M, False: 17.1k]
  |  Branch (409:50): [True: 4.33M, False: 324k]
  ------------------
  410|  4.33M|            if (data_[scan->index].first == key) {
  ------------------
  |  Branch (410:17): [True: 4.30M, False: 27.7k]
  ------------------
  411|  4.30M|               return {data_ + scan->index, pos, h};
  412|  4.30M|            }
  413|  4.33M|         }
  414|       |
  415|   341k|         return {data_ + size_, pos, h};
  416|  4.64M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE12ensure_indexEv:
  360|  4.64M|      {
  361|  4.64M|         if (size_ <= linear_search_threshold) return;
  ------------------
  |  Branch (361:14): [True: 0, False: 4.64M]
  ------------------
  362|  4.64M|         const auto current = index_size();
  363|  4.64M|         if (current == size_) return; // fully current
  ------------------
  |  Branch (363:14): [True: 3.28M, False: 1.36M]
  ------------------
  364|       |
  365|  1.36M|         if (current == 0 || (size_ - current) > linear_search_threshold) {
  ------------------
  |  Branch (365:14): [True: 253k, False: 1.11M]
  |  Branch (365:30): [True: 83.4k, False: 1.02M]
  ------------------
  366|   337k|            rebuild_index(); // full rebuild
  367|   337k|            return;
  368|   337k|         }
  369|       |
  370|       |         // Incrementally insert-sort the few new entries
  371|  3.35M|         for (uint32_t i = current; i < size_; ++i) {
  ------------------
  |  Branch (371:37): [True: 2.33M, False: 1.02M]
  ------------------
  372|  2.33M|            const hash_index_entry entry{hash_key(data_[i].first), i};
  373|  2.33M|            const auto* base = index_entries();
  374|  2.33M|            const auto* p = branchless_lower_bound(base, index_->size, entry.key_hash);
  375|  2.33M|            auto pos = static_cast<size_t>(p - base);
  376|       |
  377|  2.33M|            const uint32_t m = index_->size;
  378|  2.33M|            ensure_index_capacity(static_cast<size_type>(m) + 1);
  379|  2.33M|            auto* entries = index_entries();
  380|  2.33M|            if (pos < m) {
  ------------------
  |  Branch (380:17): [True: 2.23M, False: 95.6k]
  ------------------
  381|  2.23M|               std::memmove(entries + pos + 1, entries + pos, (m - pos) * sizeof(hash_index_entry));
  382|  2.23M|            }
  383|  2.33M|            entries[pos] = entry;
  384|  2.33M|            index_->size = i + 1;
  385|  2.33M|         }
  386|  1.02M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE13rebuild_indexEv:
  343|   337k|      {
  344|   337k|         ensure_index_capacity(static_cast<size_type>(size_));
  345|   337k|         bloom_clear();
  346|   337k|         auto* entries = index_entries();
  347|  7.00M|         for (uint32_t i = 0; i < size_; ++i) {
  ------------------
  |  Branch (347:31): [True: 6.66M, False: 337k]
  ------------------
  348|  6.66M|            const uint32_t h = hash_key(data_[i].first);
  349|  6.66M|            entries[i] = {h, i};
  350|  6.66M|            bloom_set(h);
  351|  6.66M|         }
  352|   337k|         std::sort(entries, entries + size_, [](const auto& a, const auto& b) { return a.key_hash < b.key_hash; });
  353|   337k|         index_->size = size_;
  354|   337k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11bloom_clearEv:
  291|   337k|      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|  38.7M|         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|  6.98M|      {
  441|  46.8M|         while (len > 1) {
  ------------------
  |  Branch (441:17): [True: 39.8M, False: 6.98M]
  ------------------
  442|  39.8M|            size_t half = len / 2;
  443|  39.8M|            p += (p[half - 1].key_hash < target) * half;
  444|  39.8M|            len -= half;
  445|  39.8M|         }
  446|       |         // Final element check: advance past it if it's less than target
  447|  6.98M|         p += (len == 1 && p->key_hash < target);
  ------------------
  |  Branch (447:16): [True: 6.98M, False: 0]
  |  Branch (447:28): [True: 112k, False: 6.86M]
  ------------------
  448|  6.98M|         return p;
  449|  6.98M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE9bloom_setEj:
  277|  10.9M|      {
  278|  10.9M|         const uint32_t a = h & bloom_mask;
  279|  10.9M|         const uint32_t b = (h >> 10) & bloom_mask;
  280|  10.9M|         index_->bloom[a >> 3] |= uint8_t(1) << (a & 7);
  281|  10.9M|         index_->bloom[b >> 3] |= uint8_t(1) << (b & 7);
  282|  10.9M|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE10index_sizeEv:
  300|  4.99M|      uint32_t index_size() const noexcept { return index_ ? index_->size : 0; }
  ------------------
  |  Branch (300:53): [True: 4.73M, False: 253k]
  ------------------
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE21ensure_index_capacityEm:
  314|  3.00M|      {
  315|  3.00M|         if (needed == 0) return;
  ------------------
  |  Branch (315:14): [True: 0, False: 3.00M]
  ------------------
  316|  3.00M|         if (needed > static_cast<size_type>(max_u32)) {
  ------------------
  |  Branch (316:14): [True: 0, False: 3.00M]
  ------------------
  317|      0|            throw_index_overflow();
  318|      0|         }
  319|  3.00M|         const auto needed_u32 = static_cast<uint32_t>(needed);
  320|  3.00M|         if (index_ && index_->capacity >= needed_u32) return;
  ------------------
  |  Branch (320:14): [True: 2.75M, False: 253k]
  |  Branch (320:24): [True: 2.60M, False: 150k]
  ------------------
  321|   403k|         uint32_t cap = index_ ? index_->capacity : 0;
  ------------------
  |  Branch (321:25): [True: 150k, False: 253k]
  ------------------
  322|   808k|         while (cap < needed_u32) {
  ------------------
  |  Branch (322:17): [True: 404k, False: 403k]
  ------------------
  323|   404k|            const uint32_t next = next_index_capacity(cap);
  324|   404k|            if (next <= cap) {
  ------------------
  |  Branch (324:17): [True: 0, False: 404k]
  ------------------
  325|      0|               throw_index_overflow();
  326|      0|            }
  327|   404k|            cap = next;
  328|   404k|         }
  329|   403k|         auto* block = static_cast<index_header*>(std::realloc(index_, checked_index_allocation_bytes(cap)));
  330|   403k|         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: 403k]
  ------------------
  331|   403k|         if (!index_) {
  ------------------
  |  Branch (331:14): [True: 253k, False: 150k]
  ------------------
  332|   253k|            block->size = 0;
  333|   253k|            std::memset(block->bloom, 0, bloom_bytes);
  334|   253k|         }
  335|   403k|         block->capacity = cap;
  336|   403k|         index_ = block;
  337|   403k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE19next_index_capacityEj:
  127|   404k|      {
  128|   404k|         if (current == 0) return 16;
  ------------------
  |  Branch (128:14): [True: 253k, False: 150k]
  ------------------
  129|   150k|         if (current > (max_u32 / 2)) return max_u32;
  ------------------
  |  Branch (129:14): [True: 0, False: 150k]
  ------------------
  130|   150k|         return current * 2;
  131|   150k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE30checked_index_allocation_bytesEj:
  142|   403k|      {
  143|   403k|         constexpr size_t header = sizeof(index_header);
  144|   403k|         constexpr size_t entry = sizeof(hash_index_entry);
  145|   403k|         if (count > (((std::numeric_limits<size_t>::max)() - header) / entry)) {
  ------------------
  |  Branch (145:14): [True: 0, False: 403k]
  ------------------
  146|      0|            GLZ_THROW_OR_ABORT(std::bad_alloc{});
  ------------------
  |  |    8|      0|#define GLZ_THROW_OR_ABORT(EXC) (throw(EXC))
  ------------------
  147|      0|         }
  148|   403k|         return header + static_cast<size_t>(count) * entry;
  149|   403k|      }
_ZNK3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE13index_entriesEv:
  296|  9.98M|      {
  297|  9.98M|         return static_cast<hash_index_entry*>(static_cast<void*>(index_ + 1));
  298|  9.98M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE4findINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEPNS6_4pairISC_S3_EERKT_:
  902|  90.3k|      {
  903|  90.3k|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (903:14): [True: 90.3k, False: 0]
  ------------------
  904|  90.3k|            return linear_find(key);
  905|  90.3k|         }
  906|      0|         return index_find(key);
  907|  90.3k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE6insertEONSt3__14pairINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEES3_EE:
  719|  90.3k|      {
  720|  90.3k|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (720:14): [True: 90.3k, False: 0]
  ------------------
  721|  90.3k|            auto it = linear_find(value.first);
  722|  90.3k|            if (it != end()) return {it, false};
  ------------------
  |  Branch (722:17): [True: 0, False: 90.3k]
  ------------------
  723|  90.3k|            push_back_impl(std::move(value));
  724|  90.3k|            return {data_ + size_ - 1, true};
  725|  90.3k|         }
  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|  90.3k|      {
  236|  90.3k|         grow_if_needed();
  237|  90.3k|         std::construct_at(data_ + size_, std::move(val));
  238|  90.3k|         ++size_;
  239|  90.3k|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE7emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_:
  746|  34.7M|      {
  747|  34.7M|         return try_emplace(std::forward<K>(key), std::forward<Args>(args)...);
  748|  34.7M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11try_emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_:
  752|  34.7M|      {
  753|  34.7M|         if (size_ <= linear_search_threshold) {
  ------------------
  |  Branch (753:14): [True: 26.1M, False: 8.62M]
  ------------------
  754|  26.1M|            auto it = linear_find(key);
  755|  26.1M|            if (it != end()) return {it, false};
  ------------------
  |  Branch (755:17): [True: 2.30M, False: 23.8M]
  ------------------
  756|  23.8M|            emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...);
  757|  23.8M|            return {data_ + size_ - 1, true};
  758|  26.1M|         }
  759|  8.62M|         const uint32_t h = hash_key(key);
  760|  8.62M|         if (try_bloom_insert(h, [&] { emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...); })) {
  ------------------
  |  Branch (760:14): [True: 3.97M, False: 4.64M]
  ------------------
  761|  3.97M|            return {data_ + size_ - 1, true};
  762|  3.97M|         }
  763|  4.64M|         auto [it, pos, _] = index_find_or_pos(key, h);
  764|  4.64M|         if (it != end()) return {it, false};
  ------------------
  |  Branch (764:14): [True: 4.30M, False: 341k]
  ------------------
  765|   341k|         emplace_back_kv(std::forward<K>(key), std::forward<Args>(args)...);
  766|   341k|         bloom_set(h);
  767|   341k|         if (index_size() > 0) {
  ------------------
  |  Branch (767:14): [True: 341k, False: 0]
  ------------------
  768|   341k|            const uint32_t n = index_->size;
  769|   341k|            ensure_index_capacity(static_cast<size_type>(n) + 1);
  770|   341k|            auto* entries = index_entries();
  771|   341k|            if (pos < n) {
  ------------------
  |  Branch (771:17): [True: 324k, False: 16.9k]
  ------------------
  772|   324k|               std::memmove(entries + pos + 1, entries + pos, (n - pos) * sizeof(hash_index_entry));
  773|   324k|            }
  774|   341k|            entries[pos] = {h, static_cast<uint32_t>(size_ - 1)};
  775|   341k|            index_->size = size_;
  776|   341k|         }
  777|   341k|         return {data_ + size_ - 1, true};
  778|  4.64M|      }
_ZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE15emplace_back_kvINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEEvOT_DpOT0_:
  251|  28.1M|      {
  252|  28.1M|         grow_if_needed();
  253|  28.1M|         std::construct_at(data_ + size_, std::piecewise_construct, std::forward_as_tuple(std::forward<K>(key)),
  254|  28.1M|                           std::forward_as_tuple(std::forward<Args>(args)...));
  255|  28.1M|         ++size_;
  256|  28.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|  8.62M|      {
  530|  8.62M|         if (index_ && size_ <= bloom_threshold && !bloom_maybe_contains(h)) {
  ------------------
  |  Branch (530:14): [True: 8.36M, False: 253k]
  |  Branch (530:24): [True: 7.98M, False: 383k]
  |  Branch (530:52): [True: 3.97M, False: 4.01M]
  ------------------
  531|       |            // Definitely not present — skip the search
  532|  3.97M|            append_fn();
  533|  3.97M|            bloom_set(h);
  534|       |            // Index is now stale (index_->size < size_), will rebuild on next lookup or false positive
  535|  3.97M|            return true;
  536|  3.97M|         }
  537|  4.64M|         return false;
  538|  8.62M|      }
_ZZN3glz17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES0_EEE11try_emplaceINSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEJS3_EEENS6_4pairIPNSD_ISC_S3_EEbEEOT_DpOT0_ENKUlvE_clEv:
  760|  3.97M|         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|  10.1k|      size_type size() const noexcept { return size_; }

_ZN3glz12ensure_spaceINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEETkNS_10is_contextENS_7contextEEEbRT0_RT_m:
  181|  59.9M|   {
  182|  59.9M|      using Buffer = std::remove_cvref_t<B>;
  183|       |
  184|  59.9M|      if constexpr (vector_like<Buffer>) {
  185|  59.9M|         if (required > b.size()) [[unlikely]] {
  ------------------
  |  Branch (185:14): [True: 1.02M, False: 58.8M]
  ------------------
  186|       |            // 2× growth amortizes repeated reallocations to O(n) total cost.
  187|  1.02M|            b.resize(2 * required);
  188|  1.02M|         }
  189|  59.9M|         return true;
  190|       |      }
  191|       |      else if constexpr (has_bounded_capacity<Buffer>) {
  192|       |         if (required > buffer_traits<Buffer>::capacity(b)) [[unlikely]] {
  193|       |            ctx.error = error_code::buffer_overflow;
  194|       |            return false;
  195|       |         }
  196|       |         return true;
  197|       |      }
  198|       |      else {
  199|       |         return true; // Raw pointer or other - trust caller
  200|       |      }
  201|  59.9M|   }
_ZN3glz13buffer_traitsINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE8finalizeERS7_m:
   58|  3.28M|      {
   59|  3.28M|         if constexpr (is_resizable) {
   60|  3.28M|            b.resize(written);
   61|  3.28M|         }
   62|       |         // For fixed buffers: no-op, count is returned in result
   63|  3.28M|      }

_ZN3glz8str_viewINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7_EENS1_17basic_string_viewIcS4_EEOT0_:
  288|  3.65M|   {
  289|       |      if constexpr (std::same_as<std::decay_t<T>, std::string_view>) {
  290|       |         return value; // already the answer; rebuilding it from data() and size() costs instructions
  291|       |      }
  292|       |      else if constexpr (!char_array_t<T> && std::is_pointer_v<std::decay_t<T>>) {
  293|       |         return value ? std::string_view{value} : std::string_view{};
  294|       |      }
  295|  3.65M|      else if constexpr (has_data<T> && has_size<T>) {
  296|  3.65M|         return std::string_view{value.data(), value.size()};
  297|       |      }
  298|       |      else {
  299|       |         return std::string_view{value};
  300|       |      }
  301|  3.65M|   }
_ZN3glz8str_viewINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKS7_EENS1_17basic_string_viewIcS4_EEOT0_:
  288|  22.4M|   {
  289|       |      if constexpr (std::same_as<std::decay_t<T>, std::string_view>) {
  290|       |         return value; // already the answer; rebuilding it from data() and size() costs instructions
  291|       |      }
  292|       |      else if constexpr (!char_array_t<T> && std::is_pointer_v<std::decay_t<T>>) {
  293|       |         return value ? std::string_view{value} : std::string_view{};
  294|       |      }
  295|  22.4M|      else if constexpr (has_data<T> && has_size<T>) {
  296|  22.4M|         return std::string_view{value.data(), value.size()};
  297|       |      }
  298|       |      else {
  299|       |         return std::string_view{value};
  300|       |      }
  301|  22.4M|   }
_ZN3glz10get_memberIRNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERKMS4_NSt3__17variantIJDndNS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEbNS6_6vectorIS4_NSB_IS4_EEEENS3_IS4_EEEEEEEDcOT_OT0_:
  616|  49.3M|   {
  617|  49.3M|      using V = std::decay_t<decltype(element)>;
  618|  49.3M|      if constexpr (std::is_member_object_pointer_v<V>) {
  619|  49.3M|         return value.*element;
  620|       |      }
  621|       |      else if constexpr (std::is_member_function_pointer_v<V>) {
  622|       |         return element;
  623|       |      }
  624|       |      else if constexpr (std::invocable<Element, Value> && not eigen_t<Element>) {
  625|       |         // Eigen places a static_assert inside of the operator()(), so we must target
  626|       |         // matrix types and reject them from the invocable check
  627|       |         // Eigen ought to put the check in the `enable_if` for operator()()
  628|       |         return std::invoke(std::forward<Element>(element), std::forward<Value>(value));
  629|       |      }
  630|       |      else if constexpr (std::is_pointer_v<V> && !std::is_reference_v<Element>) {
  631|       |         if constexpr (std::invocable<decltype(*element), Value>) {
  632|       |            return std::invoke(*element, std::forward<Value>(value));
  633|       |         }
  634|       |         else {
  635|       |            return *element;
  636|       |         }
  637|       |      }
  638|       |      else {
  639|       |         return element;
  640|       |      }
  641|  49.3M|   }

_ZNK3glz9error_ctxcvbEv:
  136|   131k|      operator bool() const noexcept { return ec != error_code::none; }
_ZN3glz11depth_guardINS_4yaml12yaml_contextEEC2ERS2_m:
  185|  34.1M|      depth_guard(Ctx& c, const size_t limit = max_recursive_depth_limit) noexcept : ctx(c)
  186|  34.1M|      {
  187|  34.1M|         if (ctx.depth >= limit) [[unlikely]] {
  ------------------
  |  Branch (187:14): [True: 4.61k, False: 34.0M]
  ------------------
  188|  4.61k|            ctx.error = error_code::exceeded_max_recursive_depth;
  189|  4.61k|            return;
  190|  4.61k|         }
  191|  34.0M|         ++ctx.depth;
  192|  34.0M|         entered = true;
  193|  34.0M|      }
_ZNK3glz11depth_guardINS_4yaml12yaml_contextEEcvbEv:
  198|  34.1M|      explicit operator bool() const noexcept { return entered; }
_ZN3glz11depth_guardINS_4yaml12yaml_contextEED2Ev:
  195|  34.1M|      {
  196|  34.1M|         if (entered) --ctx.depth;
  ------------------
  |  Branch (196:14): [True: 34.0M, False: 4.61k]
  ------------------
  197|  34.1M|      }

_ZN3glz4readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERKNSt3__16vectorIcNS6_9allocatorIcEEEEQaa14read_supportedIT0_XdtT_6formatEEnt18is_input_streamingIT1_EEENS_9error_ctxERSD_OSE_:
  219|  32.8k|   {
  220|  32.8k|      format_context_t<Opts.format> ctx{};
  221|  32.8k|      return read<Opts>(value, buffer, ctx);
  222|  32.8k|   }
_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_:
  136|  32.8k|   {
  137|  32.8k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  138|  32.8k|      using Buffer = std::remove_reference_t<decltype(buffer)>;
  139|       |
  140|  32.8k|      if constexpr (Opts.format != NDJSON) {
  141|  32.8k|         if (buffer.empty()) [[unlikely]] {
  ------------------
  |  Branch (141:14): [True: 0, False: 32.8k]
  ------------------
  142|      0|            ctx.error = error_code::no_read_input;
  143|      0|            return {0, ctx.error, ctx.custom_error_message};
  144|      0|         }
  145|  32.8k|      }
  146|       |
  147|  32.8k|      constexpr bool use_padded = resizable<Buffer> && non_const_buffer<Buffer> && !check_disable_padding(Opts);
  ------------------
  |  Branch (147:35): [Folded, False: 32.8k]
  |  Branch (147:56): [Folded, False: 0]
  |  Branch (147:84): [True: 0, Folded]
  ------------------
  148|       |
  149|  32.8k|      [[maybe_unused]] size_t original_size{};
  150|       |      if constexpr (use_padded) {
  151|       |         // Pad the buffer for SWAR
  152|       |         original_size = buffer.size();
  153|       |         buffer.resize(original_size + padding_bytes);
  154|       |      }
  155|       |
  156|  32.8k|      auto [it, end] = read_iterators<Opts, use_padded>(buffer);
  157|  32.8k|      auto start = it;
  158|  32.8k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (158:11): [True: 0, False: 32.8k]
  ------------------
  159|      0|         goto finish;
  160|      0|      }
  161|       |
  162|       |      // Bound the speculative re-parsing a variant resolution may do, in bytes, relative to this
  163|       |      // input. Seeded per read so a reused context starts fresh. See charge_speculation.
  164|  32.8k|      if constexpr (requires { ctx.speculation_budget; }) {
  165|  32.8k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  166|  32.8k|         ctx.speculation_budget =
  167|  32.8k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (167:14): [True: 160, False: 32.6k]
  ------------------
  168|  32.8k|      }
  169|       |
  170|       |      // A YAML context marks its outermost parse with stream_begin and seeds its expansion budgets
  171|       |      // there, so clearing it here is what makes those budgets per-read like the one above. A
  172|       |      // reused context would otherwise carry a spent budget into the next document and reject a
  173|       |      // valid one, and would leave stream_begin pointing into the buffer of the previous read.
  174|       |      // Nested YAML parses do not route through glz::read, so they still cannot reseed themselves.
  175|  32.8k|      if constexpr (requires { ctx.stream_begin; }) {
  176|  32.8k|         ctx.stream_begin = nullptr;
  177|  32.8k|      }
  178|       |
  179|       |      if constexpr (use_padded) {
  180|       |         parse<Opts.format>::template op<is_padded_on<Opts>()>(value, ctx, it, end);
  181|       |      }
  182|  32.8k|      else {
  183|  32.8k|         parse<Opts.format>::template op<is_padded_off<Opts>()>(value, ctx, it, end);
  184|  32.8k|      }
  185|       |
  186|  32.8k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (186:11): [True: 27.2k, False: 5.60k]
  ------------------
  187|  27.2k|         goto finish;
  188|  27.2k|      }
  189|       |
  190|       |      // The JSON RFC 8259 defines: JSON-text = ws value ws
  191|       |      // So, trailing whitespace is permitted and sometimes we want to
  192|       |      // validate this, even though this memory will not affect Glaze.
  193|       |      if constexpr (check_validate_trailing_whitespace(Opts)) {
  194|       |         if (it < end) {
  195|       |            skip_ws<Opts>(ctx, it, end);
  196|       |            if (bool(ctx.error)) [[unlikely]] {
  197|       |               goto finish;
  198|       |            }
  199|       |            if (it != end) [[unlikely]] {
  200|       |               ctx.error = error_code::syntax_error;
  201|       |            }
  202|       |         }
  203|       |      }
  204|       |
  205|  32.8k|   finish:
  206|  32.8k|      finalize_top_level_read<Opts>(ctx, start, it, end);
  207|       |
  208|       |      if constexpr (use_padded) {
  209|       |         // Restore the original buffer state
  210|       |         buffer.resize(original_size);
  211|       |      }
  212|       |
  213|  32.8k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  214|  5.60k|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEELb0ETkNS_10contiguousERKNSt3__16vectorIcNS2_9allocatorIcEEEEEEDaOT1_:
   40|  32.8k|   {
   41|  32.8k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  32.8k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  32.8k|      auto end = reinterpret_cast<const char*>(buffer.data()); // to be incremented
   45|       |
   46|       |      if constexpr (Padded) {
   47|       |         end += buffer.size() - padding_bytes;
   48|       |      }
   49|  32.8k|      else {
   50|  32.8k|         end += buffer.size();
   51|  32.8k|      }
   52|       |
   53|  32.8k|      return std::pair{it, end};
   54|  32.8k|   }
_ZN3glz23finalize_top_level_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEETkNS_10is_contextERNS_4yaml12yaml_contextEEEvOT0_PKcS8_S8_:
  115|  32.8k|   {
  116|       |      if constexpr (Opts.format == JSON && !check_null_terminated(Opts)) {
  117|       |         // Deliberately not [[unlikely]]: a body that ends with the buffer lands here on every
  118|       |         // successful read, which is the ordinary case for a registry parsing a wire span.
  119|       |         // start < it, not !=, because a streaming origin can be empty or overshoot on an error
  120|       |         // path; neither is an absent value.
  121|       |         if (ctx.error == error_code::end_reached && ctx.depth == 0 && it == end && start < it) {
  122|       |            context ws_ctx{}; // only written to when skip_ws parses a comment; the result is unused
  123|       |            const char* consumed = start;
  124|       |            skip_ws<Opts>(ws_ctx, consumed, it);
  125|       |            if (consumed == it) {
  126|       |               ctx.error = error_code::no_read_input;
  127|       |            }
  128|       |         }
  129|       |      }
  130|  32.8k|      finalize_read_context<Opts>(ctx);
  131|  32.8k|   }
_ZN3glz21finalize_read_contextITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEETkNS_10is_contextERNS_4yaml12yaml_contextEEEvOT0_:
   76|  32.8k|   {
   77|       |      // A partial read stops as soon as it has the fields it was asked for, so it unwinds through
   78|       |      // its enclosing containers on an error code rather than through their closing braces, and
   79|       |      // none of them decrement depth on the way out. Depth is left standing at whatever nesting the
   80|       |      // last field sat at.
   81|       |      //
   82|       |      // That has to be cleared here rather than left for the next read to trip over. This is the
   83|       |      // one path that reports success with depth still raised, and depth is what settle_end_reached
   84|       |      // reads to tell a completed parse from a truncated one -- so a context reused after a partial
   85|       |      // read would see a later well-formed buffer settle to unexpected_end. Reads that end any
   86|       |      // other way either return depth to zero themselves or carry an error, and a context holding
   87|       |      // an error short-circuits the next read before it parses anything.
   88|       |      if constexpr (check_partial_read(Opts)) {
   89|       |         if (ctx.error == error_code::partial_read_complete) [[likely]] {
   90|       |            ctx.error = error_code::none;
   91|       |            ctx.depth = 0;
   92|       |            return;
   93|       |         }
   94|       |      }
   95|  32.8k|      settle_end_reached(ctx);
   96|  32.8k|   }
_ZN3glz18settle_end_reachedITkNS_10is_contextERNS_4yaml12yaml_contextEEEvOT_:
   68|   131k|   {
   69|   131k|      if (ctx.error == error_code::end_reached) {
  ------------------
  |  Branch (69:11): [True: 0, False: 131k]
  ------------------
   70|      0|         ctx.error = (ctx.depth == 0) ? error_code::none : error_code::unexpected_end;
  ------------------
  |  Branch (70:22): [True: 0, False: 0]
  ------------------
   71|      0|      }
   72|   131k|   }
_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_:
  136|  65.6k|   {
  137|  65.6k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  138|  65.6k|      using Buffer = std::remove_reference_t<decltype(buffer)>;
  139|       |
  140|  65.6k|      if constexpr (Opts.format != NDJSON) {
  141|  65.6k|         if (buffer.empty()) [[unlikely]] {
  ------------------
  |  Branch (141:14): [True: 0, False: 65.6k]
  ------------------
  142|      0|            ctx.error = error_code::no_read_input;
  143|      0|            return {0, ctx.error, ctx.custom_error_message};
  144|      0|         }
  145|  65.6k|      }
  146|       |
  147|  65.6k|      constexpr bool use_padded = resizable<Buffer> && non_const_buffer<Buffer> && !check_disable_padding(Opts);
  ------------------
  |  Branch (147:35): [Folded, False: 65.6k]
  |  Branch (147:56): [Folded, False: 0]
  |  Branch (147:84): [True: 0, Folded]
  ------------------
  148|       |
  149|  65.6k|      [[maybe_unused]] size_t original_size{};
  150|       |      if constexpr (use_padded) {
  151|       |         // Pad the buffer for SWAR
  152|       |         original_size = buffer.size();
  153|       |         buffer.resize(original_size + padding_bytes);
  154|       |      }
  155|       |
  156|  65.6k|      auto [it, end] = read_iterators<Opts, use_padded>(buffer);
  157|  65.6k|      auto start = it;
  158|  65.6k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (158:11): [True: 0, False: 65.6k]
  ------------------
  159|      0|         goto finish;
  160|      0|      }
  161|       |
  162|       |      // Bound the speculative re-parsing a variant resolution may do, in bytes, relative to this
  163|       |      // input. Seeded per read so a reused context starts fresh. See charge_speculation.
  164|  65.6k|      if constexpr (requires { ctx.speculation_budget; }) {
  165|  65.6k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  166|  65.6k|         ctx.speculation_budget =
  167|  65.6k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (167:14): [True: 324, False: 65.3k]
  ------------------
  168|  65.6k|      }
  169|       |
  170|       |      // A YAML context marks its outermost parse with stream_begin and seeds its expansion budgets
  171|       |      // there, so clearing it here is what makes those budgets per-read like the one above. A
  172|       |      // reused context would otherwise carry a spent budget into the next document and reject a
  173|       |      // valid one, and would leave stream_begin pointing into the buffer of the previous read.
  174|       |      // Nested YAML parses do not route through glz::read, so they still cannot reseed themselves.
  175|  65.6k|      if constexpr (requires { ctx.stream_begin; }) {
  176|  65.6k|         ctx.stream_begin = nullptr;
  177|  65.6k|      }
  178|       |
  179|       |      if constexpr (use_padded) {
  180|       |         parse<Opts.format>::template op<is_padded_on<Opts>()>(value, ctx, it, end);
  181|       |      }
  182|  65.6k|      else {
  183|  65.6k|         parse<Opts.format>::template op<is_padded_off<Opts>()>(value, ctx, it, end);
  184|  65.6k|      }
  185|       |
  186|  65.6k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (186:11): [True: 55.7k, False: 9.95k]
  ------------------
  187|  55.7k|         goto finish;
  188|  55.7k|      }
  189|       |
  190|       |      // The JSON RFC 8259 defines: JSON-text = ws value ws
  191|       |      // So, trailing whitespace is permitted and sometimes we want to
  192|       |      // validate this, even though this memory will not affect Glaze.
  193|       |      if constexpr (check_validate_trailing_whitespace(Opts)) {
  194|       |         if (it < end) {
  195|       |            skip_ws<Opts>(ctx, it, end);
  196|       |            if (bool(ctx.error)) [[unlikely]] {
  197|       |               goto finish;
  198|       |            }
  199|       |            if (it != end) [[unlikely]] {
  200|       |               ctx.error = error_code::syntax_error;
  201|       |            }
  202|       |         }
  203|       |      }
  204|       |
  205|  65.6k|   finish:
  206|  65.6k|      finalize_top_level_read<Opts>(ctx, start, it, end);
  207|       |
  208|       |      if constexpr (use_padded) {
  209|       |         // Restore the original buffer state
  210|       |         buffer.resize(original_size);
  211|       |      }
  212|       |
  213|  65.6k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  214|  9.95k|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEELb0ETkNS_10contiguousERKNSt3__16vectorIcNS3_9allocatorIcEEEEEEDaOT1_:
   40|  65.6k|   {
   41|  65.6k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  65.6k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  65.6k|      auto end = reinterpret_cast<const char*>(buffer.data()); // to be incremented
   45|       |
   46|       |      if constexpr (Padded) {
   47|       |         end += buffer.size() - padding_bytes;
   48|       |      }
   49|  65.6k|      else {
   50|  65.6k|         end += buffer.size();
   51|  65.6k|      }
   52|       |
   53|  65.6k|      return std::pair{it, end};
   54|  65.6k|   }
_ZN3glz23finalize_top_level_readITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEETkNS_10is_contextERNS1_12yaml_contextEEEvOT0_PKcS8_S8_:
  115|  98.4k|   {
  116|       |      if constexpr (Opts.format == JSON && !check_null_terminated(Opts)) {
  117|       |         // Deliberately not [[unlikely]]: a body that ends with the buffer lands here on every
  118|       |         // successful read, which is the ordinary case for a registry parsing a wire span.
  119|       |         // start < it, not !=, because a streaming origin can be empty or overshoot on an error
  120|       |         // path; neither is an absent value.
  121|       |         if (ctx.error == error_code::end_reached && ctx.depth == 0 && it == end && start < it) {
  122|       |            context ws_ctx{}; // only written to when skip_ws parses a comment; the result is unused
  123|       |            const char* consumed = start;
  124|       |            skip_ws<Opts>(ws_ctx, consumed, it);
  125|       |            if (consumed == it) {
  126|       |               ctx.error = error_code::no_read_input;
  127|       |            }
  128|       |         }
  129|       |      }
  130|  98.4k|      finalize_read_context<Opts>(ctx);
  131|  98.4k|   }
_ZN3glz21finalize_read_contextITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEETkNS_10is_contextERNS1_12yaml_contextEEEvOT0_:
   76|  98.4k|   {
   77|       |      // A partial read stops as soon as it has the fields it was asked for, so it unwinds through
   78|       |      // its enclosing containers on an error code rather than through their closing braces, and
   79|       |      // none of them decrement depth on the way out. Depth is left standing at whatever nesting the
   80|       |      // last field sat at.
   81|       |      //
   82|       |      // That has to be cleared here rather than left for the next read to trip over. This is the
   83|       |      // one path that reports success with depth still raised, and depth is what settle_end_reached
   84|       |      // reads to tell a completed parse from a truncated one -- so a context reused after a partial
   85|       |      // read would see a later well-formed buffer settle to unexpected_end. Reads that end any
   86|       |      // other way either return depth to zero themselves or carry an error, and a context holding
   87|       |      // an error short-circuits the next read before it parses anything.
   88|       |      if constexpr (check_partial_read(Opts)) {
   89|       |         if (ctx.error == error_code::partial_read_complete) [[likely]] {
   90|       |            ctx.error = error_code::none;
   91|       |            ctx.depth = 0;
   92|       |            return;
   93|       |         }
   94|       |      }
   95|  98.4k|      settle_end_reached(ctx);
   96|  98.4k|   }
_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_:
  136|  32.8k|   {
  137|  32.8k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
  138|  32.8k|      using Buffer = std::remove_reference_t<decltype(buffer)>;
  139|       |
  140|  32.8k|      if constexpr (Opts.format != NDJSON) {
  141|  32.8k|         if (buffer.empty()) [[unlikely]] {
  ------------------
  |  Branch (141:14): [True: 0, False: 32.8k]
  ------------------
  142|      0|            ctx.error = error_code::no_read_input;
  143|      0|            return {0, ctx.error, ctx.custom_error_message};
  144|      0|         }
  145|  32.8k|      }
  146|       |
  147|  32.8k|      constexpr bool use_padded = resizable<Buffer> && non_const_buffer<Buffer> && !check_disable_padding(Opts);
  ------------------
  |  Branch (147:35): [True: 0, Folded]
  |  Branch (147:56): [True: 0, Folded]
  |  Branch (147:84): [True: 0, Folded]
  ------------------
  148|       |
  149|  32.8k|      [[maybe_unused]] size_t original_size{};
  150|  32.8k|      if constexpr (use_padded) {
  151|       |         // Pad the buffer for SWAR
  152|  32.8k|         original_size = buffer.size();
  153|  32.8k|         buffer.resize(original_size + padding_bytes);
  154|  32.8k|      }
  155|       |
  156|  32.8k|      auto [it, end] = read_iterators<Opts, use_padded>(buffer);
  157|  32.8k|      auto start = it;
  158|  32.8k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (158:11): [True: 0, False: 32.8k]
  ------------------
  159|      0|         goto finish;
  160|      0|      }
  161|       |
  162|       |      // Bound the speculative re-parsing a variant resolution may do, in bytes, relative to this
  163|       |      // input. Seeded per read so a reused context starts fresh. See charge_speculation.
  164|  32.8k|      if constexpr (requires { ctx.speculation_budget; }) {
  165|  32.8k|         const size_t proportional = max_speculative_parse_factor * size_t(end - it);
  166|  32.8k|         ctx.speculation_budget =
  167|  32.8k|            (proportional > min_speculative_parse_bytes ? proportional : min_speculative_parse_bytes) + 2;
  ------------------
  |  Branch (167:14): [True: 164, False: 32.6k]
  ------------------
  168|  32.8k|      }
  169|       |
  170|       |      // A YAML context marks its outermost parse with stream_begin and seeds its expansion budgets
  171|       |      // there, so clearing it here is what makes those budgets per-read like the one above. A
  172|       |      // reused context would otherwise carry a spent budget into the next document and reject a
  173|       |      // valid one, and would leave stream_begin pointing into the buffer of the previous read.
  174|       |      // Nested YAML parses do not route through glz::read, so they still cannot reseed themselves.
  175|  32.8k|      if constexpr (requires { ctx.stream_begin; }) {
  176|  32.8k|         ctx.stream_begin = nullptr;
  177|  32.8k|      }
  178|       |
  179|  32.8k|      if constexpr (use_padded) {
  180|  32.8k|         parse<Opts.format>::template op<is_padded_on<Opts>()>(value, ctx, it, end);
  181|       |      }
  182|       |      else {
  183|       |         parse<Opts.format>::template op<is_padded_off<Opts>()>(value, ctx, it, end);
  184|       |      }
  185|       |
  186|  32.8k|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (186:11): [True: 28.4k, False: 4.35k]
  ------------------
  187|  28.4k|         goto finish;
  188|  28.4k|      }
  189|       |
  190|       |      // The JSON RFC 8259 defines: JSON-text = ws value ws
  191|       |      // So, trailing whitespace is permitted and sometimes we want to
  192|       |      // validate this, even though this memory will not affect Glaze.
  193|       |      if constexpr (check_validate_trailing_whitespace(Opts)) {
  194|       |         if (it < end) {
  195|       |            skip_ws<Opts>(ctx, it, end);
  196|       |            if (bool(ctx.error)) [[unlikely]] {
  197|       |               goto finish;
  198|       |            }
  199|       |            if (it != end) [[unlikely]] {
  200|       |               ctx.error = error_code::syntax_error;
  201|       |            }
  202|       |         }
  203|       |      }
  204|       |
  205|  32.8k|   finish:
  206|  32.8k|      finalize_top_level_read<Opts>(ctx, start, it, end);
  207|       |
  208|  32.8k|      if constexpr (use_padded) {
  209|       |         // Restore the original buffer state
  210|  32.8k|         buffer.resize(original_size);
  211|  32.8k|      }
  212|       |
  213|  32.8k|      return {size_t(it - start), ctx.error, ctx.custom_error_message};
  214|  4.35k|   }
_ZN3glz14read_iteratorsITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEELb1ETkNS_10contiguousERNSt3__16vectorIcNS3_9allocatorIcEEEEEEDaOT1_:
   40|  32.8k|   {
   41|  32.8k|      static_assert(sizeof(decltype(*buffer.data())) == 1);
   42|       |
   43|  32.8k|      auto it = reinterpret_cast<const char*>(buffer.data());
   44|  32.8k|      auto end = reinterpret_cast<const char*>(buffer.data()); // to be incremented
   45|       |
   46|  32.8k|      if constexpr (Padded) {
   47|  32.8k|         end += buffer.size() - padding_bytes;
   48|       |      }
   49|       |      else {
   50|       |         end += buffer.size();
   51|       |      }
   52|       |
   53|  32.8k|      return std::pair{it, end};
   54|  32.8k|   }

_ZN3glz5writeITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_13output_bufferENSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEQ15write_supportedIT0_XdtT_6formatEEEENS_9error_ctxEOSE_RT1_:
   78|  3.28M|   {
   79|  3.28M|      context ctx{};
   80|  3.28M|      return write<Opts>(std::forward<T>(value), buffer, ctx);
   81|  3.28M|   }
_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|  3.28M|   {
   19|  3.28M|      using traits = buffer_traits<std::remove_cvref_t<Buffer>>;
   20|       |
   21|  3.28M|      if constexpr (traits::is_resizable) {
   22|       |         // A buffer could be size 1, to ensure we have sufficient memory we can't just check `empty()`
   23|  3.28M|         if (buffer.size() < 2 * write_padding_bytes) {
  ------------------
  |  Branch (23:14): [True: 3.28M, False: 0]
  ------------------
   24|  3.28M|            buffer.resize(2 * write_padding_bytes);
   25|  3.28M|         }
   26|  3.28M|      }
   27|  3.28M|      size_t ix = 0; // overwrite index
   28|  3.28M|      to<Opts.format, std::remove_cvref_t<T>>::template op<Opts>(std::forward<T>(value), ctx, buffer, ix);
   29|       |
   30|  3.28M|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (30:11): [True: 0, False: 3.28M]
  ------------------
   31|      0|         return {ix, ctx.error, ctx.custom_error_message};
   32|      0|      }
   33|       |
   34|  3.28M|      traits::finalize(buffer, ix);
   35|  3.28M|      return {ix, error_code::none, ctx.custom_error_message};
   36|  3.28M|   }

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

_ZN3glz9sweethash7sweet32ITkNS0_16contiguous_rangeENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEEEjRKT_j:
  270|  17.6M|   {
  271|  17.6M|      return sweet32(static_cast<const void*>(s.data()), s.size(), seed);
  272|  17.6M|   }
_ZN3glz9sweethash7sweet32EPKvmj:
  154|  17.6M|   {
  155|  17.6M|      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|  17.6M|      if (len <= 8) {
  ------------------
  |  Branch (158:11): [True: 9.64M, False: 7.96M]
  ------------------
  159|  9.64M|         uint64_t v = 0;
  160|  9.64M|         switch (len) {
  161|   620k|         case 8:
  ------------------
  |  Branch (161:10): [True: 620k, False: 9.02M]
  ------------------
  162|   620k|            std::memcpy(&v, p, 8);
  163|   620k|            break;
  164|   276k|         case 7:
  ------------------
  |  Branch (164:10): [True: 276k, False: 9.37M]
  ------------------
  165|   276k|            std::memcpy(&v, p, 7);
  166|   276k|            break;
  167|   572k|         case 6:
  ------------------
  |  Branch (167:10): [True: 572k, False: 9.07M]
  ------------------
  168|   572k|            std::memcpy(&v, p, 6);
  169|   572k|            break;
  170|   918k|         case 5:
  ------------------
  |  Branch (170:10): [True: 918k, False: 8.73M]
  ------------------
  171|   918k|            std::memcpy(&v, p, 5);
  172|   918k|            break;
  173|   772k|         case 4:
  ------------------
  |  Branch (173:10): [True: 772k, False: 8.87M]
  ------------------
  174|   772k|            std::memcpy(&v, p, 4);
  175|   772k|            break;
  176|  1.27M|         case 3:
  ------------------
  |  Branch (176:10): [True: 1.27M, False: 8.37M]
  ------------------
  177|  1.27M|            std::memcpy(&v, p, 3);
  178|  1.27M|            break;
  179|   916k|         case 2:
  ------------------
  |  Branch (179:10): [True: 916k, False: 8.73M]
  ------------------
  180|   916k|            std::memcpy(&v, p, 2);
  181|   916k|            break;
  182|  2.64M|         case 1:
  ------------------
  |  Branch (182:10): [True: 2.64M, False: 7.00M]
  ------------------
  183|  2.64M|            v = p[0];
  184|  2.64M|            break;
  185|  1.65M|         default:
  ------------------
  |  Branch (185:10): [True: 1.65M, False: 7.99M]
  ------------------
  186|  1.65M|            break;
  187|  9.64M|         }
  188|  9.64M|         v = v ^ seed ^ (len + 1);
  189|  9.64M|         return static_cast<uint32_t>(v) ^ static_cast<uint32_t>(v >> 32);
  190|  9.64M|      }
  191|       |
  192|       |      // Full hash for inputs > 8 bytes
  193|  7.96M|      uint64_t seed64 = (static_cast<uint64_t>(seed) << 32) | static_cast<uint64_t>(seed);
  194|  7.96M|      uint64_t h = (seed64 ^ prime4) + (len * prime1);
  195|  7.96M|      const uint8_t* const end = p + len;
  196|       |
  197|  7.96M|      if (len >= 32) {
  ------------------
  |  Branch (197:11): [True: 3.11M, False: 4.85M]
  ------------------
  198|  3.11M|         uint64_t h1 = h;
  199|  3.11M|         uint64_t h2 = (seed64 * prime2) ^ prime3;
  200|  3.11M|         uint64_t h3 = (seed64 * prime3) ^ prime4;
  201|  3.11M|         uint64_t h4 = (seed64 * prime4) ^ prime5;
  202|       |
  203|  13.1M|         do {
  204|  13.1M|            uint64_t k1, k2, k3, k4;
  205|  13.1M|            std::memcpy(&k1, p, 8);
  206|  13.1M|            std::memcpy(&k2, p + 8, 8);
  207|  13.1M|            std::memcpy(&k3, p + 16, 8);
  208|  13.1M|            std::memcpy(&k4, p + 24, 8);
  209|       |
  210|  13.1M|            k1 = k1 * prime2;
  211|  13.1M|            k1 = k1 ^ (k1 >> 47);
  212|  13.1M|            h1 = h1 ^ k1;
  213|  13.1M|            h1 = h1 * prime1;
  214|       |
  215|  13.1M|            k2 = k2 * prime3;
  216|  13.1M|            k2 = k2 ^ (k2 >> 47);
  217|  13.1M|            h2 = h2 ^ k2;
  218|  13.1M|            h2 = h2 * prime2;
  219|       |
  220|  13.1M|            k3 = k3 * prime4;
  221|  13.1M|            k3 = k3 ^ (k3 >> 47);
  222|  13.1M|            h3 = h3 ^ k3;
  223|  13.1M|            h3 = h3 * prime3;
  224|       |
  225|  13.1M|            k4 = k4 * prime5;
  226|  13.1M|            k4 = k4 ^ (k4 >> 47);
  227|  13.1M|            h4 = h4 ^ k4;
  228|  13.1M|            h4 = h4 * prime4;
  229|       |
  230|  13.1M|            p = p + 32;
  231|  13.1M|            len = len - 32;
  232|  13.1M|         } while (len >= 32);
  ------------------
  |  Branch (232:19): [True: 10.0M, False: 3.11M]
  ------------------
  233|       |
  234|  3.11M|         h = h1 + h2 + h3 + h4;
  235|  3.11M|      }
  236|       |
  237|  19.3M|      while (len >= 8) {
  ------------------
  |  Branch (237:14): [True: 11.3M, False: 7.96M]
  ------------------
  238|  11.3M|         uint64_t k;
  239|  11.3M|         std::memcpy(&k, p, 8);
  240|  11.3M|         k = k * prime2;
  241|  11.3M|         k = k ^ (k >> 47);
  242|  11.3M|         h = h ^ k;
  243|  11.3M|         h = h * prime1;
  244|  11.3M|         p = p + 8;
  245|  11.3M|         len = len - 8;
  246|  11.3M|      }
  247|       |
  248|  7.96M|      if (len > 0) {
  ------------------
  |  Branch (248:11): [True: 6.62M, False: 1.33M]
  ------------------
  249|  6.62M|         uint64_t k;
  250|  6.62M|         std::memcpy(&k, end - 8, 8);
  251|  6.62M|         k = k * prime2;
  252|  6.62M|         k = k ^ (k >> 47);
  253|  6.62M|         k = k * prime3;
  254|  6.62M|         h = h ^ k;
  255|  6.62M|      }
  256|       |
  257|  7.96M|      h = mix64(h);
  258|  7.96M|      return static_cast<uint32_t>(h) ^ static_cast<uint32_t>(h >> 32);
  259|  17.6M|   }
_ZN3glz9sweethash5mix64Em:
   33|  7.96M|   {
   34|  7.96M|      v = v ^ (v >> 33);
   35|  7.96M|      v = v * prime2;
   36|  7.96M|      v = v ^ (v >> 29);
   37|  7.96M|      v = v * prime3;
   38|  7.96M|      return v;
   39|  7.96M|   }

_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEC2Ev:
  338|  64.4M|      generic_json() = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEED2Ev:
  114|   108M|      ~generic_json() = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEaSEDn:
  231|    212|      {
  232|    212|         data = value;
  233|    212|         return *this;
  234|    212|      }
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEaSEOS3_:
  342|  20.7M|      generic_json& operator=(generic_json&&) = default;
_ZN3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEC2EOS3_:
  341|  43.5M|      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_:
  210|  90.3k|      {
  211|  90.3k|         if (holds<null_t>()) data = object_t{};
  ------------------
  |  Branch (211:14): [True: 90.3k, False: 0]
  ------------------
  212|  90.3k|         auto& object = std::get<object_t>(data);
  213|  90.3k|         auto iter = object.find(key);
  214|  90.3k|         if (iter == object.end()) {
  ------------------
  |  Branch (214:14): [True: 90.3k, False: 0]
  ------------------
  215|  90.3k|            iter = object.insert(std::make_pair(std::string(key), generic_json{})).first;
  216|  90.3k|         }
  217|  90.3k|         return iter->second;
  218|  90.3k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE5holdsIDnEEbv:
  201|  3.36M|      {
  202|  3.36M|         return std::holds_alternative<T>(data);
  203|  3.36M|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE7is_nullEv:
  418|  3.26M|      [[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:
  153|  4.08M|      {
  154|  4.08M|         return std::get_if<T>(&data);
  155|  4.08M|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE4sizeEv:
  534|  19.9k|      {
  535|  19.9k|         if (auto* v = get_if<object_t>()) {
  ------------------
  |  Branch (535:20): [True: 10.1k, False: 9.76k]
  ------------------
  536|  10.1k|            return v->size();
  537|  10.1k|         }
  538|  9.76k|         else if (auto* v = get_if<array_t>()) {
  ------------------
  |  Branch (538:25): [True: 1.74k, False: 8.01k]
  ------------------
  539|  1.74k|            return v->size();
  540|  1.74k|         }
  541|  8.01k|         else if (auto* v = get_if<std::string>()) {
  ------------------
  |  Branch (541:25): [True: 6.53k, False: 1.48k]
  ------------------
  542|  6.53k|            return v->size();
  543|  6.53k|         }
  544|  1.48k|         else {
  545|  1.48k|            return 0;
  546|  1.48k|         }
  547|  19.9k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINS2_IS3_EEEEPKT_v:
  159|  19.9k|      {
  160|  19.9k|         return std::get_if<T>(&data);
  161|  19.9k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__16vectorIS3_NS5_9allocatorIS3_EEEEEEPKT_v:
  159|  9.76k|      {
  160|  9.76k|         return std::get_if<T>(&data);
  161|  9.76k|      }
_ZNK3glz12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEE6get_ifINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEPKT_v:
  159|  8.01k|      {
  160|  8.01k|         return std::get_if<T>(&data);
  161|  8.01k|      }

_ZN3glz10write_jsonITkNS_15write_supportedIL_ZNS_4JSONEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_13output_bufferERNSt3__112basic_stringIcNS7_11char_traitsIcEENS7_9allocatorIcEEEEEENS_9error_ctxEOT_OT0_:
 2828|  3.28M|   {
 2829|  3.28M|      return write<opts{}>(std::forward<T>(value), std::forward<Buffer>(buffer));
 2830|  3.28M|   }
_ZN3glz2toILj10ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS4_TkNS_10is_contextERNS_7contextERNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERmEEvOT0_OT1_OT2_OT3_:
  525|  29.0M|      {
  526|  29.0M|         using V = std::remove_cvref_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  527|  29.0M|         to<JSON, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  528|  29.0M|                                        std::forward<Ctx>(ctx), std::forward<B>(b), std::forward<IX>(ix));
  529|  29.0M|      }
_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_:
 1947|  29.0M|      {
 1948|       |         // Adjacent tagging needs no per-alternative dispatch: the discriminator and the value are
 1949|       |         // written side by side whatever the alternative is. The visit below still instantiates in
 1950|       |         // that mode (`if constexpr` does not discard the statements after it), but both of its
 1951|       |         // tagged branches are compile-time dead there and the runtime `return` keeps it unreached.
 1952|       |         if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::adjacent) {
 1953|       |            write_adjacent<Opts>(value, ctx, b, ix);
 1954|       |            return;
 1955|       |         }
 1956|  29.0M|         std::visit(
 1957|  29.0M|            [&](auto&& val) {
 1958|  29.0M|               using V = std::decay_t<decltype(val)>;
 1959|       |
 1960|  29.0M|               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1961|  29.0M|                             custom_write<V>) {
 1962|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1963|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1964|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1965|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1966|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1967|       |                  //
 1968|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1969|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1970|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1971|  29.0M|                  if (missing_id(value, ctx)) {
 1972|  29.0M|                     return;
 1973|  29.0M|                  }
 1974|  29.0M|                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1975|  29.0M|                  if constexpr (Opts.prettify) {
 1976|  29.0M|                     dump("{\n", b, ix);
 1977|  29.0M|                     ctx.depth += check_indentation_width(Opts);
 1978|  29.0M|                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1979|  29.0M|                     dump('"', b, ix);
 1980|  29.0M|                     dump_maybe_empty(tag_v<T>, b, ix);
 1981|  29.0M|                     if constexpr (std::integral<id_type>) {
 1982|  29.0M|                        dump("\": ", b, ix);
 1983|  29.0M|                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1984|  29.0M|                     }
 1985|  29.0M|                     else {
 1986|  29.0M|                        dump("\": \"", b, ix);
 1987|  29.0M|                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1988|  29.0M|                        dump('"', b, ix);
 1989|  29.0M|                     }
 1990|  29.0M|                     const auto pos_after_tag = ix;
 1991|  29.0M|                     dump(",\n", b, ix);
 1992|  29.0M|                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1993|  29.0M|                     const auto pos_body_start = ix;
 1994|  29.0M|                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 1995|  29.0M|                     if (ix == pos_body_start) {
 1996|  29.0M|                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 1997|  29.0M|                     }
 1998|  29.0M|                     ctx.depth -= check_indentation_width(Opts);
 1999|  29.0M|                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2000|  29.0M|                        return;
 2001|  29.0M|                     }
 2002|  29.0M|                     std::memcpy(&b[ix], "\n", 1);
 2003|  29.0M|                     ++ix;
 2004|  29.0M|                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2005|  29.0M|                     ix += ctx.depth;
 2006|  29.0M|                     std::memcpy(&b[ix], "}", 1);
 2007|  29.0M|                     ++ix;
 2008|  29.0M|                  }
 2009|  29.0M|                  else {
 2010|  29.0M|                     dump("{\"", b, ix);
 2011|  29.0M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2012|  29.0M|                     if constexpr (std::integral<id_type>) {
 2013|  29.0M|                        dump("\":", b, ix);
 2014|  29.0M|                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2015|  29.0M|                     }
 2016|  29.0M|                     else {
 2017|  29.0M|                        dump("\":\"", b, ix);
 2018|  29.0M|                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2019|  29.0M|                        dump('"', b, ix);
 2020|  29.0M|                     }
 2021|  29.0M|                     const auto pos_after_tag = ix;
 2022|  29.0M|                     dump(',', b, ix);
 2023|  29.0M|                     const auto pos_body_start = ix;
 2024|  29.0M|                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2025|  29.0M|                     if (ix == pos_body_start) {
 2026|  29.0M|                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2027|  29.0M|                     }
 2028|  29.0M|                     dump('}', b, ix);
 2029|  29.0M|                  }
 2030|  29.0M|               }
 2031|  29.0M|               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2032|  29.0M|                                  variant_unit_alternative<V>) {
 2033|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2034|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2035|  29.0M|                  if (missing_id(value, ctx)) {
 2036|  29.0M|                     return;
 2037|  29.0M|                  }
 2038|  29.0M|                  if constexpr (Opts.prettify) {
 2039|  29.0M|                     dump("{\n", b, ix);
 2040|  29.0M|                     ctx.depth += check_indentation_width(Opts);
 2041|  29.0M|                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2042|  29.0M|                     dump('"', b, ix);
 2043|  29.0M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2044|  29.0M|                     dump("\": ", b, ix);
 2045|  29.0M|                     write_id<Opts>(value, ctx, b, ix);
 2046|  29.0M|                     ctx.depth -= check_indentation_width(Opts);
 2047|  29.0M|                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2048|  29.0M|                        return;
 2049|  29.0M|                     }
 2050|  29.0M|                     std::memcpy(&b[ix], "\n", 1);
 2051|  29.0M|                     ++ix;
 2052|  29.0M|                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2053|  29.0M|                     ix += ctx.depth;
 2054|  29.0M|                     std::memcpy(&b[ix], "}", 1);
 2055|  29.0M|                     ++ix;
 2056|  29.0M|                  }
 2057|  29.0M|                  else {
 2058|  29.0M|                     dump("{\"", b, ix);
 2059|  29.0M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2060|  29.0M|                     dump("\":", b, ix);
 2061|  29.0M|                     write_id<Opts>(value, ctx, b, ix);
 2062|  29.0M|                     dump('}', b, ix);
 2063|  29.0M|                  }
 2064|  29.0M|               }
 2065|  29.0M|               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2066|  29.0M|                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2067|  29.0M|                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2068|       |                  // An alternative that declares a member named like the discriminator carries the
 2069|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2070|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2071|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2072|  29.0M|                  if (missing_id(value, ctx)) {
 2073|  29.0M|                     return;
 2074|  29.0M|                  }
 2075|  29.0M|                  constexpr auto N = []() {
 2076|  29.0M|                     if constexpr (is_memory_object<V>) {
 2077|  29.0M|                        return reflect<memory_type<V>>::size;
 2078|  29.0M|                     }
 2079|  29.0M|                     else {
 2080|  29.0M|                        return reflect<V>::size;
 2081|  29.0M|                     }
 2082|  29.0M|                  }();
 2083|       |
 2084|       |                  // must first write out type
 2085|  29.0M|                  if constexpr (Opts.prettify) {
 2086|  29.0M|                     dump("{\n", b, ix);
 2087|  29.0M|                     ctx.depth += check_indentation_width(Opts);
 2088|  29.0M|                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2089|  29.0M|                     dump('"', b, ix);
 2090|  29.0M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2091|       |
 2092|  29.0M|                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2093|       |
 2094|  29.0M|                     if constexpr (std::integral<id_type>) {
 2095|  29.0M|                        dump("\": ", b, ix);
 2096|  29.0M|                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2097|  29.0M|                        if constexpr (N > 0) {
 2098|  29.0M|                           dump(",\n", b, ix);
 2099|  29.0M|                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2100|  29.0M|                        }
 2101|  29.0M|                     }
 2102|  29.0M|                     else {
 2103|  29.0M|                        dump("\": \"", b, ix);
 2104|  29.0M|                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2105|  29.0M|                        if constexpr (N == 0) {
 2106|  29.0M|                           dump('"', b, ix);
 2107|  29.0M|                        }
 2108|  29.0M|                        else {
 2109|  29.0M|                           dump("\",\n", b, ix);
 2110|  29.0M|                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2111|  29.0M|                        }
 2112|  29.0M|                     }
 2113|  29.0M|                  }
 2114|  29.0M|                  else {
 2115|  29.0M|                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2116|       |
 2117|  29.0M|                     dump("{\"", b, ix);
 2118|  29.0M|                     dump_maybe_empty(tag_v<T>, b, ix);
 2119|       |
 2120|  29.0M|                     if constexpr (std::integral<id_type>) {
 2121|  29.0M|                        dump("\":", b, ix);
 2122|  29.0M|                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2123|  29.0M|                        if constexpr (N > 0) {
 2124|  29.0M|                           dump(',', b, ix);
 2125|  29.0M|                        }
 2126|  29.0M|                     }
 2127|  29.0M|                     else {
 2128|  29.0M|                        dump("\":\"", b, ix);
 2129|  29.0M|                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2130|  29.0M|                        if constexpr (N == 0) {
 2131|  29.0M|                           dump('"', b, ix);
 2132|  29.0M|                        }
 2133|  29.0M|                        else {
 2134|  29.0M|                           dump("\",", b, ix);
 2135|  29.0M|                        }
 2136|  29.0M|                     }
 2137|  29.0M|                  }
 2138|  29.0M|                  if constexpr (is_memory_object<V>) {
 2139|  29.0M|                     if (!val) [[unlikely]] {
 2140|  29.0M|                        ctx.error = error_code::invalid_variant_object;
 2141|  29.0M|                        return;
 2142|  29.0M|                     }
 2143|  29.0M|                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2144|  29.0M|                  }
 2145|  29.0M|                  else {
 2146|  29.0M|                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2147|  29.0M|                  }
 2148|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2149|  29.0M|                  if constexpr (Opts.skip_null_members) {
 2150|  29.0M|                     if (b[ix - 1] == ',') {
 2151|  29.0M|                        --ix;
 2152|  29.0M|                     }
 2153|  29.0M|                  }
 2154|       |
 2155|  29.0M|                  if constexpr (Opts.prettify) {
 2156|  29.0M|                     ctx.depth -= check_indentation_width(Opts);
 2157|  29.0M|                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2158|  29.0M|                        return;
 2159|  29.0M|                     }
 2160|  29.0M|                     std::memcpy(&b[ix], "\n", 1);
 2161|  29.0M|                     ++ix;
 2162|  29.0M|                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2163|  29.0M|                     ix += ctx.depth;
 2164|  29.0M|                     std::memcpy(&b[ix], "}", 1);
 2165|  29.0M|                     ++ix;
 2166|  29.0M|                  }
 2167|  29.0M|                  else {
 2168|  29.0M|                     dump('}', b, ix);
 2169|  29.0M|                  }
 2170|  29.0M|               }
 2171|  29.0M|               else {
 2172|  29.0M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2173|  29.0M|               }
 2174|  29.0M|            },
 2175|  29.0M|            value);
 2176|  29.0M|      }
_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_:
 1957|  14.1M|            [&](auto&& val) {
 1958|  14.1M|               using V = std::decay_t<decltype(val)>;
 1959|       |
 1960|       |               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1961|       |                             custom_write<V>) {
 1962|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1963|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1964|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1965|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1966|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1967|       |                  //
 1968|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1969|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1970|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1971|       |                  if (missing_id(value, ctx)) {
 1972|       |                     return;
 1973|       |                  }
 1974|       |                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1975|       |                  if constexpr (Opts.prettify) {
 1976|       |                     dump("{\n", b, ix);
 1977|       |                     ctx.depth += check_indentation_width(Opts);
 1978|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1979|       |                     dump('"', b, ix);
 1980|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 1981|       |                     if constexpr (std::integral<id_type>) {
 1982|       |                        dump("\": ", b, ix);
 1983|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1984|       |                     }
 1985|       |                     else {
 1986|       |                        dump("\": \"", b, ix);
 1987|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1988|       |                        dump('"', b, ix);
 1989|       |                     }
 1990|       |                     const auto pos_after_tag = ix;
 1991|       |                     dump(",\n", b, ix);
 1992|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1993|       |                     const auto pos_body_start = ix;
 1994|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 1995|       |                     if (ix == pos_body_start) {
 1996|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 1997|       |                     }
 1998|       |                     ctx.depth -= check_indentation_width(Opts);
 1999|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2000|       |                        return;
 2001|       |                     }
 2002|       |                     std::memcpy(&b[ix], "\n", 1);
 2003|       |                     ++ix;
 2004|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2005|       |                     ix += ctx.depth;
 2006|       |                     std::memcpy(&b[ix], "}", 1);
 2007|       |                     ++ix;
 2008|       |                  }
 2009|       |                  else {
 2010|       |                     dump("{\"", b, ix);
 2011|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2012|       |                     if constexpr (std::integral<id_type>) {
 2013|       |                        dump("\":", b, ix);
 2014|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2015|       |                     }
 2016|       |                     else {
 2017|       |                        dump("\":\"", b, ix);
 2018|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2019|       |                        dump('"', b, ix);
 2020|       |                     }
 2021|       |                     const auto pos_after_tag = ix;
 2022|       |                     dump(',', b, ix);
 2023|       |                     const auto pos_body_start = ix;
 2024|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2025|       |                     if (ix == pos_body_start) {
 2026|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2027|       |                     }
 2028|       |                     dump('}', b, ix);
 2029|       |                  }
 2030|       |               }
 2031|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2032|       |                                  variant_unit_alternative<V>) {
 2033|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2034|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2035|       |                  if (missing_id(value, ctx)) {
 2036|       |                     return;
 2037|       |                  }
 2038|       |                  if constexpr (Opts.prettify) {
 2039|       |                     dump("{\n", b, ix);
 2040|       |                     ctx.depth += check_indentation_width(Opts);
 2041|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2042|       |                     dump('"', b, ix);
 2043|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2044|       |                     dump("\": ", b, ix);
 2045|       |                     write_id<Opts>(value, ctx, b, ix);
 2046|       |                     ctx.depth -= check_indentation_width(Opts);
 2047|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2048|       |                        return;
 2049|       |                     }
 2050|       |                     std::memcpy(&b[ix], "\n", 1);
 2051|       |                     ++ix;
 2052|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2053|       |                     ix += ctx.depth;
 2054|       |                     std::memcpy(&b[ix], "}", 1);
 2055|       |                     ++ix;
 2056|       |                  }
 2057|       |                  else {
 2058|       |                     dump("{\"", b, ix);
 2059|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2060|       |                     dump("\":", b, ix);
 2061|       |                     write_id<Opts>(value, ctx, b, ix);
 2062|       |                     dump('}', b, ix);
 2063|       |                  }
 2064|       |               }
 2065|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2066|       |                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2067|       |                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2068|       |                  // An alternative that declares a member named like the discriminator carries the
 2069|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2070|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2071|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2072|       |                  if (missing_id(value, ctx)) {
 2073|       |                     return;
 2074|       |                  }
 2075|       |                  constexpr auto N = []() {
 2076|       |                     if constexpr (is_memory_object<V>) {
 2077|       |                        return reflect<memory_type<V>>::size;
 2078|       |                     }
 2079|       |                     else {
 2080|       |                        return reflect<V>::size;
 2081|       |                     }
 2082|       |                  }();
 2083|       |
 2084|       |                  // must first write out type
 2085|       |                  if constexpr (Opts.prettify) {
 2086|       |                     dump("{\n", b, ix);
 2087|       |                     ctx.depth += check_indentation_width(Opts);
 2088|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2089|       |                     dump('"', b, ix);
 2090|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2091|       |
 2092|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2093|       |
 2094|       |                     if constexpr (std::integral<id_type>) {
 2095|       |                        dump("\": ", b, ix);
 2096|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2097|       |                        if constexpr (N > 0) {
 2098|       |                           dump(",\n", b, ix);
 2099|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2100|       |                        }
 2101|       |                     }
 2102|       |                     else {
 2103|       |                        dump("\": \"", b, ix);
 2104|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2105|       |                        if constexpr (N == 0) {
 2106|       |                           dump('"', b, ix);
 2107|       |                        }
 2108|       |                        else {
 2109|       |                           dump("\",\n", b, ix);
 2110|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2111|       |                        }
 2112|       |                     }
 2113|       |                  }
 2114|       |                  else {
 2115|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2116|       |
 2117|       |                     dump("{\"", b, ix);
 2118|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2119|       |
 2120|       |                     if constexpr (std::integral<id_type>) {
 2121|       |                        dump("\":", b, ix);
 2122|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2123|       |                        if constexpr (N > 0) {
 2124|       |                           dump(',', b, ix);
 2125|       |                        }
 2126|       |                     }
 2127|       |                     else {
 2128|       |                        dump("\":\"", b, ix);
 2129|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2130|       |                        if constexpr (N == 0) {
 2131|       |                           dump('"', b, ix);
 2132|       |                        }
 2133|       |                        else {
 2134|       |                           dump("\",", b, ix);
 2135|       |                        }
 2136|       |                     }
 2137|       |                  }
 2138|       |                  if constexpr (is_memory_object<V>) {
 2139|       |                     if (!val) [[unlikely]] {
 2140|       |                        ctx.error = error_code::invalid_variant_object;
 2141|       |                        return;
 2142|       |                     }
 2143|       |                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2144|       |                  }
 2145|       |                  else {
 2146|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2147|       |                  }
 2148|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2149|       |                  if constexpr (Opts.skip_null_members) {
 2150|       |                     if (b[ix - 1] == ',') {
 2151|       |                        --ix;
 2152|       |                     }
 2153|       |                  }
 2154|       |
 2155|       |                  if constexpr (Opts.prettify) {
 2156|       |                     ctx.depth -= check_indentation_width(Opts);
 2157|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2158|       |                        return;
 2159|       |                     }
 2160|       |                     std::memcpy(&b[ix], "\n", 1);
 2161|       |                     ++ix;
 2162|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2163|       |                     ix += ctx.depth;
 2164|       |                     std::memcpy(&b[ix], "}", 1);
 2165|       |                     ++ix;
 2166|       |                  }
 2167|       |                  else {
 2168|       |                     dump('}', b, ix);
 2169|       |                  }
 2170|       |               }
 2171|  14.1M|               else {
 2172|  14.1M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2173|  14.1M|               }
 2174|  14.1M|            },
_ZN3glz2toILj10EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERDnTkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
 1841|  14.1M|      {
 1842|  14.1M|         if constexpr (not check_write_unchecked(Opts)) {
 1843|  14.1M|            if (!ensure_space(ctx, b, ix + 4)) [[unlikely]] {
  ------------------
  |  Branch (1843:17): [True: 0, False: 14.1M]
  ------------------
 1844|      0|               return;
 1845|      0|            }
 1846|  14.1M|         }
 1847|       |         if constexpr (std::endian::native == std::endian::big) {
 1848|       |            static constexpr char null_v[] = "null";
 1849|       |            std::memcpy(&b[ix], null_v, 4);
 1850|       |         }
 1851|  14.1M|         else {
 1852|  14.1M|            static constexpr uint32_t null_v = 1819047278;
 1853|  14.1M|            std::memcpy(&b[ix], &null_v, 4);
 1854|  14.1M|         }
 1855|  14.1M|         ix += 4;
 1856|  14.1M|      }
_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_:
 1957|   882k|            [&](auto&& val) {
 1958|   882k|               using V = std::decay_t<decltype(val)>;
 1959|       |
 1960|       |               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1961|       |                             custom_write<V>) {
 1962|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1963|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1964|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1965|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1966|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1967|       |                  //
 1968|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1969|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1970|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1971|       |                  if (missing_id(value, ctx)) {
 1972|       |                     return;
 1973|       |                  }
 1974|       |                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1975|       |                  if constexpr (Opts.prettify) {
 1976|       |                     dump("{\n", b, ix);
 1977|       |                     ctx.depth += check_indentation_width(Opts);
 1978|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1979|       |                     dump('"', b, ix);
 1980|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 1981|       |                     if constexpr (std::integral<id_type>) {
 1982|       |                        dump("\": ", b, ix);
 1983|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1984|       |                     }
 1985|       |                     else {
 1986|       |                        dump("\": \"", b, ix);
 1987|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1988|       |                        dump('"', b, ix);
 1989|       |                     }
 1990|       |                     const auto pos_after_tag = ix;
 1991|       |                     dump(",\n", b, ix);
 1992|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1993|       |                     const auto pos_body_start = ix;
 1994|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 1995|       |                     if (ix == pos_body_start) {
 1996|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 1997|       |                     }
 1998|       |                     ctx.depth -= check_indentation_width(Opts);
 1999|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2000|       |                        return;
 2001|       |                     }
 2002|       |                     std::memcpy(&b[ix], "\n", 1);
 2003|       |                     ++ix;
 2004|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2005|       |                     ix += ctx.depth;
 2006|       |                     std::memcpy(&b[ix], "}", 1);
 2007|       |                     ++ix;
 2008|       |                  }
 2009|       |                  else {
 2010|       |                     dump("{\"", b, ix);
 2011|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2012|       |                     if constexpr (std::integral<id_type>) {
 2013|       |                        dump("\":", b, ix);
 2014|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2015|       |                     }
 2016|       |                     else {
 2017|       |                        dump("\":\"", b, ix);
 2018|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2019|       |                        dump('"', b, ix);
 2020|       |                     }
 2021|       |                     const auto pos_after_tag = ix;
 2022|       |                     dump(',', b, ix);
 2023|       |                     const auto pos_body_start = ix;
 2024|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2025|       |                     if (ix == pos_body_start) {
 2026|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2027|       |                     }
 2028|       |                     dump('}', b, ix);
 2029|       |                  }
 2030|       |               }
 2031|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2032|       |                                  variant_unit_alternative<V>) {
 2033|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2034|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2035|       |                  if (missing_id(value, ctx)) {
 2036|       |                     return;
 2037|       |                  }
 2038|       |                  if constexpr (Opts.prettify) {
 2039|       |                     dump("{\n", b, ix);
 2040|       |                     ctx.depth += check_indentation_width(Opts);
 2041|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2042|       |                     dump('"', b, ix);
 2043|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2044|       |                     dump("\": ", b, ix);
 2045|       |                     write_id<Opts>(value, ctx, b, ix);
 2046|       |                     ctx.depth -= check_indentation_width(Opts);
 2047|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2048|       |                        return;
 2049|       |                     }
 2050|       |                     std::memcpy(&b[ix], "\n", 1);
 2051|       |                     ++ix;
 2052|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2053|       |                     ix += ctx.depth;
 2054|       |                     std::memcpy(&b[ix], "}", 1);
 2055|       |                     ++ix;
 2056|       |                  }
 2057|       |                  else {
 2058|       |                     dump("{\"", b, ix);
 2059|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2060|       |                     dump("\":", b, ix);
 2061|       |                     write_id<Opts>(value, ctx, b, ix);
 2062|       |                     dump('}', b, ix);
 2063|       |                  }
 2064|       |               }
 2065|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2066|       |                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2067|       |                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2068|       |                  // An alternative that declares a member named like the discriminator carries the
 2069|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2070|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2071|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2072|       |                  if (missing_id(value, ctx)) {
 2073|       |                     return;
 2074|       |                  }
 2075|       |                  constexpr auto N = []() {
 2076|       |                     if constexpr (is_memory_object<V>) {
 2077|       |                        return reflect<memory_type<V>>::size;
 2078|       |                     }
 2079|       |                     else {
 2080|       |                        return reflect<V>::size;
 2081|       |                     }
 2082|       |                  }();
 2083|       |
 2084|       |                  // must first write out type
 2085|       |                  if constexpr (Opts.prettify) {
 2086|       |                     dump("{\n", b, ix);
 2087|       |                     ctx.depth += check_indentation_width(Opts);
 2088|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2089|       |                     dump('"', b, ix);
 2090|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2091|       |
 2092|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2093|       |
 2094|       |                     if constexpr (std::integral<id_type>) {
 2095|       |                        dump("\": ", b, ix);
 2096|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2097|       |                        if constexpr (N > 0) {
 2098|       |                           dump(",\n", b, ix);
 2099|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2100|       |                        }
 2101|       |                     }
 2102|       |                     else {
 2103|       |                        dump("\": \"", b, ix);
 2104|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2105|       |                        if constexpr (N == 0) {
 2106|       |                           dump('"', b, ix);
 2107|       |                        }
 2108|       |                        else {
 2109|       |                           dump("\",\n", b, ix);
 2110|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2111|       |                        }
 2112|       |                     }
 2113|       |                  }
 2114|       |                  else {
 2115|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2116|       |
 2117|       |                     dump("{\"", b, ix);
 2118|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2119|       |
 2120|       |                     if constexpr (std::integral<id_type>) {
 2121|       |                        dump("\":", b, ix);
 2122|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2123|       |                        if constexpr (N > 0) {
 2124|       |                           dump(',', b, ix);
 2125|       |                        }
 2126|       |                     }
 2127|       |                     else {
 2128|       |                        dump("\":\"", b, ix);
 2129|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2130|       |                        if constexpr (N == 0) {
 2131|       |                           dump('"', b, ix);
 2132|       |                        }
 2133|       |                        else {
 2134|       |                           dump("\",", b, ix);
 2135|       |                        }
 2136|       |                     }
 2137|       |                  }
 2138|       |                  if constexpr (is_memory_object<V>) {
 2139|       |                     if (!val) [[unlikely]] {
 2140|       |                        ctx.error = error_code::invalid_variant_object;
 2141|       |                        return;
 2142|       |                     }
 2143|       |                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2144|       |                  }
 2145|       |                  else {
 2146|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2147|       |                  }
 2148|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2149|       |                  if constexpr (Opts.skip_null_members) {
 2150|       |                     if (b[ix - 1] == ',') {
 2151|       |                        --ix;
 2152|       |                     }
 2153|       |                  }
 2154|       |
 2155|       |                  if constexpr (Opts.prettify) {
 2156|       |                     ctx.depth -= check_indentation_width(Opts);
 2157|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2158|       |                        return;
 2159|       |                     }
 2160|       |                     std::memcpy(&b[ix], "\n", 1);
 2161|       |                     ++ix;
 2162|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2163|       |                     ix += ctx.depth;
 2164|       |                     std::memcpy(&b[ix], "}", 1);
 2165|       |                     ++ix;
 2166|       |                  }
 2167|       |                  else {
 2168|       |                     dump('}', b, ix);
 2169|       |                  }
 2170|       |               }
 2171|   882k|               else {
 2172|   882k|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2173|   882k|               }
 2174|   882k|            },
_ZN3glz2toILj10EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERdTkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
  814|   882k|      {
  815|   882k|         if constexpr (not check_write_unchecked(Opts)) {
  816|   882k|            static_assert(required_padding<T>());
  817|   882k|            if (!ensure_space(ctx, b, ix + required_padding<T>())) [[unlikely]] {
  ------------------
  |  Branch (817:17): [True: 0, False: 882k]
  ------------------
  818|      0|               return;
  819|      0|            }
  820|   882k|         }
  821|       |
  822|   882k|         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|   882k|         else {
  832|   882k|            write_chars::op<O>(value, ctx, b, ix);
  833|   882k|         }
  834|   882k|      }
_ZN3glz16required_paddingIdEEmv:
  538|   882k|   {
  539|   882k|      constexpr auto value = []() -> size_t {
  540|   882k|         if constexpr (boolean_like<T>) {
  541|   882k|            return 8;
  542|   882k|         }
  543|   882k|         else if constexpr (num_t<T>) {
  544|   882k|            if constexpr (std::floating_point<T>) {
  545|   882k|               if constexpr (sizeof(T) > 8) {
  546|   882k|                  return 64;
  547|   882k|               }
  548|   882k|               else if constexpr (sizeof(T) > 4) {
  549|       |                  // zmij scratch + 4 for optional quotes and trailing comma.
  550|   882k|                  return zmij::double_buffer_size + 4;
  551|   882k|               }
  552|   882k|               else {
  553|   882k|                  return zmij::float_buffer_size + 4;
  554|   882k|               }
  555|   882k|            }
  556|   882k|            else if constexpr (sizeof(T) > 4) {
  557|   882k|               return 24;
  558|   882k|            }
  559|   882k|            else if constexpr (sizeof(T) > 2) {
  560|   882k|               return 16;
  561|   882k|            }
  562|   882k|            else {
  563|   882k|               return 8;
  564|   882k|            }
  565|   882k|         }
  566|   882k|         else if constexpr (nullable_like<T>) {
  567|   882k|            if constexpr (has_value_type<T>) {
  568|   882k|               return required_padding<typename T::value_type>();
  569|   882k|            }
  570|   882k|            else if constexpr (has_element_type<T>) {
  571|   882k|               return required_padding<typename T::element_type>();
  572|   882k|            }
  573|   882k|            else {
  574|   882k|               return 0;
  575|   882k|            }
  576|   882k|         }
  577|   882k|         else if constexpr (always_null_t<T>) {
  578|   882k|            return 8;
  579|   882k|         }
  580|   882k|         else {
  581|   882k|            return 0;
  582|   882k|         }
  583|   882k|      }();
  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|   882k|      return value;
  591|   882k|   }
_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_:
 1957|  3.65M|            [&](auto&& val) {
 1958|  3.65M|               using V = std::decay_t<decltype(val)>;
 1959|       |
 1960|       |               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1961|       |                             custom_write<V>) {
 1962|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1963|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1964|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1965|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1966|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1967|       |                  //
 1968|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1969|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1970|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1971|       |                  if (missing_id(value, ctx)) {
 1972|       |                     return;
 1973|       |                  }
 1974|       |                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1975|       |                  if constexpr (Opts.prettify) {
 1976|       |                     dump("{\n", b, ix);
 1977|       |                     ctx.depth += check_indentation_width(Opts);
 1978|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1979|       |                     dump('"', b, ix);
 1980|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 1981|       |                     if constexpr (std::integral<id_type>) {
 1982|       |                        dump("\": ", b, ix);
 1983|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1984|       |                     }
 1985|       |                     else {
 1986|       |                        dump("\": \"", b, ix);
 1987|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1988|       |                        dump('"', b, ix);
 1989|       |                     }
 1990|       |                     const auto pos_after_tag = ix;
 1991|       |                     dump(",\n", b, ix);
 1992|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1993|       |                     const auto pos_body_start = ix;
 1994|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 1995|       |                     if (ix == pos_body_start) {
 1996|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 1997|       |                     }
 1998|       |                     ctx.depth -= check_indentation_width(Opts);
 1999|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2000|       |                        return;
 2001|       |                     }
 2002|       |                     std::memcpy(&b[ix], "\n", 1);
 2003|       |                     ++ix;
 2004|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2005|       |                     ix += ctx.depth;
 2006|       |                     std::memcpy(&b[ix], "}", 1);
 2007|       |                     ++ix;
 2008|       |                  }
 2009|       |                  else {
 2010|       |                     dump("{\"", b, ix);
 2011|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2012|       |                     if constexpr (std::integral<id_type>) {
 2013|       |                        dump("\":", b, ix);
 2014|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2015|       |                     }
 2016|       |                     else {
 2017|       |                        dump("\":\"", b, ix);
 2018|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2019|       |                        dump('"', b, ix);
 2020|       |                     }
 2021|       |                     const auto pos_after_tag = ix;
 2022|       |                     dump(',', b, ix);
 2023|       |                     const auto pos_body_start = ix;
 2024|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2025|       |                     if (ix == pos_body_start) {
 2026|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2027|       |                     }
 2028|       |                     dump('}', b, ix);
 2029|       |                  }
 2030|       |               }
 2031|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2032|       |                                  variant_unit_alternative<V>) {
 2033|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2034|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2035|       |                  if (missing_id(value, ctx)) {
 2036|       |                     return;
 2037|       |                  }
 2038|       |                  if constexpr (Opts.prettify) {
 2039|       |                     dump("{\n", b, ix);
 2040|       |                     ctx.depth += check_indentation_width(Opts);
 2041|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2042|       |                     dump('"', b, ix);
 2043|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2044|       |                     dump("\": ", b, ix);
 2045|       |                     write_id<Opts>(value, ctx, b, ix);
 2046|       |                     ctx.depth -= check_indentation_width(Opts);
 2047|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2048|       |                        return;
 2049|       |                     }
 2050|       |                     std::memcpy(&b[ix], "\n", 1);
 2051|       |                     ++ix;
 2052|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2053|       |                     ix += ctx.depth;
 2054|       |                     std::memcpy(&b[ix], "}", 1);
 2055|       |                     ++ix;
 2056|       |                  }
 2057|       |                  else {
 2058|       |                     dump("{\"", b, ix);
 2059|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2060|       |                     dump("\":", b, ix);
 2061|       |                     write_id<Opts>(value, ctx, b, ix);
 2062|       |                     dump('}', b, ix);
 2063|       |                  }
 2064|       |               }
 2065|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2066|       |                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2067|       |                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2068|       |                  // An alternative that declares a member named like the discriminator carries the
 2069|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2070|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2071|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2072|       |                  if (missing_id(value, ctx)) {
 2073|       |                     return;
 2074|       |                  }
 2075|       |                  constexpr auto N = []() {
 2076|       |                     if constexpr (is_memory_object<V>) {
 2077|       |                        return reflect<memory_type<V>>::size;
 2078|       |                     }
 2079|       |                     else {
 2080|       |                        return reflect<V>::size;
 2081|       |                     }
 2082|       |                  }();
 2083|       |
 2084|       |                  // must first write out type
 2085|       |                  if constexpr (Opts.prettify) {
 2086|       |                     dump("{\n", b, ix);
 2087|       |                     ctx.depth += check_indentation_width(Opts);
 2088|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2089|       |                     dump('"', b, ix);
 2090|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2091|       |
 2092|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2093|       |
 2094|       |                     if constexpr (std::integral<id_type>) {
 2095|       |                        dump("\": ", b, ix);
 2096|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2097|       |                        if constexpr (N > 0) {
 2098|       |                           dump(",\n", b, ix);
 2099|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2100|       |                        }
 2101|       |                     }
 2102|       |                     else {
 2103|       |                        dump("\": \"", b, ix);
 2104|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2105|       |                        if constexpr (N == 0) {
 2106|       |                           dump('"', b, ix);
 2107|       |                        }
 2108|       |                        else {
 2109|       |                           dump("\",\n", b, ix);
 2110|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2111|       |                        }
 2112|       |                     }
 2113|       |                  }
 2114|       |                  else {
 2115|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2116|       |
 2117|       |                     dump("{\"", b, ix);
 2118|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2119|       |
 2120|       |                     if constexpr (std::integral<id_type>) {
 2121|       |                        dump("\":", b, ix);
 2122|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2123|       |                        if constexpr (N > 0) {
 2124|       |                           dump(',', b, ix);
 2125|       |                        }
 2126|       |                     }
 2127|       |                     else {
 2128|       |                        dump("\":\"", b, ix);
 2129|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2130|       |                        if constexpr (N == 0) {
 2131|       |                           dump('"', b, ix);
 2132|       |                        }
 2133|       |                        else {
 2134|       |                           dump("\",", b, ix);
 2135|       |                        }
 2136|       |                     }
 2137|       |                  }
 2138|       |                  if constexpr (is_memory_object<V>) {
 2139|       |                     if (!val) [[unlikely]] {
 2140|       |                        ctx.error = error_code::invalid_variant_object;
 2141|       |                        return;
 2142|       |                     }
 2143|       |                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2144|       |                  }
 2145|       |                  else {
 2146|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2147|       |                  }
 2148|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2149|       |                  if constexpr (Opts.skip_null_members) {
 2150|       |                     if (b[ix - 1] == ',') {
 2151|       |                        --ix;
 2152|       |                     }
 2153|       |                  }
 2154|       |
 2155|       |                  if constexpr (Opts.prettify) {
 2156|       |                     ctx.depth -= check_indentation_width(Opts);
 2157|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2158|       |                        return;
 2159|       |                     }
 2160|       |                     std::memcpy(&b[ix], "\n", 1);
 2161|       |                     ++ix;
 2162|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2163|       |                     ix += ctx.depth;
 2164|       |                     std::memcpy(&b[ix], "}", 1);
 2165|       |                     ++ix;
 2166|       |                  }
 2167|       |                  else {
 2168|       |                     dump('}', b, ix);
 2169|       |                  }
 2170|       |               }
 2171|  3.65M|               else {
 2172|  3.65M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2173|  3.65M|               }
 2174|  3.65M|            },
_ZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_SB_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
  845|  3.65M|      {
  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|  3.65M|         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|  3.65M|            else {
  945|  3.65M|               const sv str = [&]() -> const sv {
  946|  3.65M|                  if constexpr (array_char_t<T>) {
  947|  3.65M|                     return sv{value.data(), value.size()};
  948|  3.65M|                  }
  949|  3.65M|                  else if constexpr (u8str_t<T>) {
  950|  3.65M|                     return sv{reinterpret_cast<const char*>(value.data()), value.size()};
  951|  3.65M|                  }
  952|  3.65M|                  else {
  953|  3.65M|                     return str_view<T>(value);
  954|  3.65M|                  }
  955|  3.65M|               }();
  956|  3.65M|               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|  3.65M|               else {
  988|       |                  // Using the original sizing
  989|  3.65M|                  if (!ensure_space(ctx, b, ix + 10 + 2 * n)) [[unlikely]] {
  ------------------
  |  Branch (989:23): [True: 0, False: 3.65M]
  ------------------
  990|      0|                     return;
  991|      0|                  }
  992|  3.65M|               }
  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|  3.65M|               else {
 1002|  3.65M|                  std::memcpy(&b[ix], "\"", 1);
 1003|  3.65M|                  ++ix;
 1004|       |
 1005|  3.65M|                  const auto* c = str.data();
 1006|  3.65M|                  const auto* const e = c + n;
 1007|  3.65M|                  const auto start = &b[ix];
 1008|  3.65M|                  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|  3.65M|                  auto write_escape = [&]() {
 1017|  3.65M|                     if constexpr (check_escape_control_characters(Opts)) {
 1018|  3.65M|                        if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
 1019|  3.65M|                           std::memcpy(data, &escaped, 2);
 1020|  3.65M|                           data += 2;
 1021|  3.65M|                        }
 1022|  3.65M|                        else {
 1023|  3.65M|                           char unicode_escape[6] = {'\\', 'u', '0', '0', '0', '0'};
 1024|  3.65M|                           constexpr char hex_digits[] = "0123456789ABCDEF";
 1025|  3.65M|                           unicode_escape[4] = hex_digits[(uint8_t(*c) >> 4) & 0xF];
 1026|  3.65M|                           unicode_escape[5] = hex_digits[uint8_t(*c) & 0xF];
 1027|  3.65M|                           std::memcpy(data, unicode_escape, 6);
 1028|  3.65M|                           data += 6;
 1029|  3.65M|                        }
 1030|  3.65M|                     }
 1031|  3.65M|                     else {
 1032|  3.65M|                        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|  3.65M|                           if (char_escape_table[uint8_t(*c)] == 0) [[unlikely]] {
 1039|  3.65M|                              ctx.error = error_code::invalid_control_character;
 1040|  3.65M|                           }
 1041|  3.65M|                        }
 1042|  3.65M|                        std::memcpy(data, &char_escape_table[uint8_t(*c)], 2);
 1043|  3.65M|                        data += 2;
 1044|  3.65M|                     }
 1045|  3.65M|                     ++c;
 1046|  3.65M|                  };
 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|  3.65M|#if defined(GLZ_USE_SSE2)
 1055|  3.65M|                  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|  3.65M|                  if (n > 7) {
  ------------------
  |  Branch (1061:23): [True: 2.10M, False: 1.55M]
  ------------------
 1062|  6.23M|                     for (const auto end_m7 = e - 7; c < end_m7;) {
  ------------------
  |  Branch (1062:54): [True: 4.13M, False: 2.10M]
  ------------------
 1063|  4.13M|                        std::memcpy(data, c, 8);
 1064|  4.13M|                        uint64_t swar;
 1065|  4.13M|                        std::memcpy(&swar, c, 8);
 1066|       |                        if constexpr (std::endian::native == std::endian::big) {
 1067|       |                           swar = std::byteswap(swar);
 1068|       |                        }
 1069|       |
 1070|  4.13M|                        constexpr uint64_t lo7_mask = repeat_byte8(0b01111111);
 1071|  4.13M|                        const uint64_t lo7 = swar & lo7_mask;
 1072|  4.13M|                        const uint64_t quote = (lo7 ^ repeat_byte8('"')) + lo7_mask;
 1073|  4.13M|                        const uint64_t backslash = (lo7 ^ repeat_byte8('\\')) + lo7_mask;
 1074|  4.13M|                        const uint64_t less_32 = (swar & repeat_byte8(0b01100000)) + lo7_mask;
 1075|  4.13M|                        uint64_t next = ~((quote & backslash & less_32) | swar);
 1076|       |
 1077|  4.13M|                        next &= repeat_byte8(0b10000000);
 1078|  4.13M|                        if (next == 0) {
  ------------------
  |  Branch (1078:29): [True: 802k, False: 3.32M]
  ------------------
 1079|   802k|                           data += 8;
 1080|   802k|                           c += 8;
 1081|   802k|                           continue;
 1082|   802k|                        }
 1083|       |
 1084|  3.32M|                        const auto length = (countr_zero(next) >> 3);
 1085|  3.32M|                        c += length;
 1086|  3.32M|                        data += length;
 1087|  3.32M|                        write_escape();
 1088|  3.32M|                     }
 1089|  2.10M|                  }
 1090|       |
 1091|       |                  // Scalar tail
 1092|  17.9M|                  for (; c < e; ++c) {
  ------------------
  |  Branch (1092:26): [True: 14.3M, False: 3.65M]
  ------------------
 1093|  14.3M|                     if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
  ------------------
  |  Branch (1093:79): [True: 1.18M, False: 13.1M]
  ------------------
 1094|  1.18M|                        std::memcpy(data, &escaped, 2);
 1095|  1.18M|                        data += 2;
 1096|  1.18M|                     }
 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|  13.1M|                     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|  13.1M|                        std::memcpy(data, c, 1);
 1118|  13.1M|                        ++data;
 1119|  13.1M|                     }
 1120|  14.3M|                  }
 1121|       |
 1122|  3.65M|                  ix += size_t(data - start);
 1123|       |
 1124|  3.65M|                  std::memcpy(&b[ix], "\"", 1);
 1125|  3.65M|                  ++ix;
 1126|  3.65M|               }
 1127|  3.65M|            }
 1128|  3.65M|         }
 1129|  3.65M|      }
_ZZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_SB_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlvE_clEv:
  945|  3.65M|               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|  3.65M|                  else {
  953|  3.65M|                     return str_view<T>(value);
  954|  3.65M|                  }
  955|  3.65M|               }();
_ZZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_SB_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlvE0_clEv:
 1016|  27.5M|                  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|  27.5M|                     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|  27.5M|                        std::memcpy(data, &char_escape_table[uint8_t(*c)], 2);
 1043|  27.5M|                        data += 2;
 1044|  27.5M|                     }
 1045|  27.5M|                     ++c;
 1046|  27.5M|                  };
_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_:
 1957|   134k|            [&](auto&& val) {
 1958|   134k|               using V = std::decay_t<decltype(val)>;
 1959|       |
 1960|       |               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1961|       |                             custom_write<V>) {
 1962|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1963|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1964|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1965|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1966|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1967|       |                  //
 1968|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1969|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1970|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1971|       |                  if (missing_id(value, ctx)) {
 1972|       |                     return;
 1973|       |                  }
 1974|       |                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1975|       |                  if constexpr (Opts.prettify) {
 1976|       |                     dump("{\n", b, ix);
 1977|       |                     ctx.depth += check_indentation_width(Opts);
 1978|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1979|       |                     dump('"', b, ix);
 1980|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 1981|       |                     if constexpr (std::integral<id_type>) {
 1982|       |                        dump("\": ", b, ix);
 1983|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1984|       |                     }
 1985|       |                     else {
 1986|       |                        dump("\": \"", b, ix);
 1987|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1988|       |                        dump('"', b, ix);
 1989|       |                     }
 1990|       |                     const auto pos_after_tag = ix;
 1991|       |                     dump(",\n", b, ix);
 1992|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1993|       |                     const auto pos_body_start = ix;
 1994|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 1995|       |                     if (ix == pos_body_start) {
 1996|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 1997|       |                     }
 1998|       |                     ctx.depth -= check_indentation_width(Opts);
 1999|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2000|       |                        return;
 2001|       |                     }
 2002|       |                     std::memcpy(&b[ix], "\n", 1);
 2003|       |                     ++ix;
 2004|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2005|       |                     ix += ctx.depth;
 2006|       |                     std::memcpy(&b[ix], "}", 1);
 2007|       |                     ++ix;
 2008|       |                  }
 2009|       |                  else {
 2010|       |                     dump("{\"", b, ix);
 2011|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2012|       |                     if constexpr (std::integral<id_type>) {
 2013|       |                        dump("\":", b, ix);
 2014|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2015|       |                     }
 2016|       |                     else {
 2017|       |                        dump("\":\"", b, ix);
 2018|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2019|       |                        dump('"', b, ix);
 2020|       |                     }
 2021|       |                     const auto pos_after_tag = ix;
 2022|       |                     dump(',', b, ix);
 2023|       |                     const auto pos_body_start = ix;
 2024|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2025|       |                     if (ix == pos_body_start) {
 2026|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2027|       |                     }
 2028|       |                     dump('}', b, ix);
 2029|       |                  }
 2030|       |               }
 2031|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2032|       |                                  variant_unit_alternative<V>) {
 2033|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2034|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2035|       |                  if (missing_id(value, ctx)) {
 2036|       |                     return;
 2037|       |                  }
 2038|       |                  if constexpr (Opts.prettify) {
 2039|       |                     dump("{\n", b, ix);
 2040|       |                     ctx.depth += check_indentation_width(Opts);
 2041|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2042|       |                     dump('"', b, ix);
 2043|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2044|       |                     dump("\": ", b, ix);
 2045|       |                     write_id<Opts>(value, ctx, b, ix);
 2046|       |                     ctx.depth -= check_indentation_width(Opts);
 2047|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2048|       |                        return;
 2049|       |                     }
 2050|       |                     std::memcpy(&b[ix], "\n", 1);
 2051|       |                     ++ix;
 2052|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2053|       |                     ix += ctx.depth;
 2054|       |                     std::memcpy(&b[ix], "}", 1);
 2055|       |                     ++ix;
 2056|       |                  }
 2057|       |                  else {
 2058|       |                     dump("{\"", b, ix);
 2059|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2060|       |                     dump("\":", b, ix);
 2061|       |                     write_id<Opts>(value, ctx, b, ix);
 2062|       |                     dump('}', b, ix);
 2063|       |                  }
 2064|       |               }
 2065|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2066|       |                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2067|       |                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2068|       |                  // An alternative that declares a member named like the discriminator carries the
 2069|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2070|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2071|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2072|       |                  if (missing_id(value, ctx)) {
 2073|       |                     return;
 2074|       |                  }
 2075|       |                  constexpr auto N = []() {
 2076|       |                     if constexpr (is_memory_object<V>) {
 2077|       |                        return reflect<memory_type<V>>::size;
 2078|       |                     }
 2079|       |                     else {
 2080|       |                        return reflect<V>::size;
 2081|       |                     }
 2082|       |                  }();
 2083|       |
 2084|       |                  // must first write out type
 2085|       |                  if constexpr (Opts.prettify) {
 2086|       |                     dump("{\n", b, ix);
 2087|       |                     ctx.depth += check_indentation_width(Opts);
 2088|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2089|       |                     dump('"', b, ix);
 2090|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2091|       |
 2092|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2093|       |
 2094|       |                     if constexpr (std::integral<id_type>) {
 2095|       |                        dump("\": ", b, ix);
 2096|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2097|       |                        if constexpr (N > 0) {
 2098|       |                           dump(",\n", b, ix);
 2099|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2100|       |                        }
 2101|       |                     }
 2102|       |                     else {
 2103|       |                        dump("\": \"", b, ix);
 2104|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2105|       |                        if constexpr (N == 0) {
 2106|       |                           dump('"', b, ix);
 2107|       |                        }
 2108|       |                        else {
 2109|       |                           dump("\",\n", b, ix);
 2110|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2111|       |                        }
 2112|       |                     }
 2113|       |                  }
 2114|       |                  else {
 2115|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2116|       |
 2117|       |                     dump("{\"", b, ix);
 2118|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2119|       |
 2120|       |                     if constexpr (std::integral<id_type>) {
 2121|       |                        dump("\":", b, ix);
 2122|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2123|       |                        if constexpr (N > 0) {
 2124|       |                           dump(',', b, ix);
 2125|       |                        }
 2126|       |                     }
 2127|       |                     else {
 2128|       |                        dump("\":\"", b, ix);
 2129|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2130|       |                        if constexpr (N == 0) {
 2131|       |                           dump('"', b, ix);
 2132|       |                        }
 2133|       |                        else {
 2134|       |                           dump("\",", b, ix);
 2135|       |                        }
 2136|       |                     }
 2137|       |                  }
 2138|       |                  if constexpr (is_memory_object<V>) {
 2139|       |                     if (!val) [[unlikely]] {
 2140|       |                        ctx.error = error_code::invalid_variant_object;
 2141|       |                        return;
 2142|       |                     }
 2143|       |                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2144|       |                  }
 2145|       |                  else {
 2146|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2147|       |                  }
 2148|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2149|       |                  if constexpr (Opts.skip_null_members) {
 2150|       |                     if (b[ix - 1] == ',') {
 2151|       |                        --ix;
 2152|       |                     }
 2153|       |                  }
 2154|       |
 2155|       |                  if constexpr (Opts.prettify) {
 2156|       |                     ctx.depth -= check_indentation_width(Opts);
 2157|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2158|       |                        return;
 2159|       |                     }
 2160|       |                     std::memcpy(&b[ix], "\n", 1);
 2161|       |                     ++ix;
 2162|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2163|       |                     ix += ctx.depth;
 2164|       |                     std::memcpy(&b[ix], "}", 1);
 2165|       |                     ++ix;
 2166|       |                  }
 2167|       |                  else {
 2168|       |                     dump('}', b, ix);
 2169|       |                  }
 2170|       |               }
 2171|   134k|               else {
 2172|   134k|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2173|   134k|               }
 2174|   134k|            },
_ZN3glz2toILj10EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEETkNS_10is_contextERNS_7contextEmEEvbOT1_OT0_RT2_:
  777|   134k|      {
  778|   134k|         static constexpr auto checked = not check_write_unchecked(Opts);
  779|   134k|         if constexpr (checked) {
  780|   134k|            if (!ensure_space(ctx, b, ix + 8)) [[unlikely]] {
  ------------------
  |  Branch (780:17): [True: 0, False: 134k]
  ------------------
  781|      0|               return;
  782|      0|            }
  783|   134k|         }
  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|   134k|         else {
  795|   134k|            if (value) {
  ------------------
  |  Branch (795:17): [True: 29.6k, False: 104k]
  ------------------
  796|  29.6k|               std::memcpy(&b[ix], "true", 4);
  797|  29.6k|               ix += 4;
  798|  29.6k|            }
  799|   104k|            else {
  800|   104k|               std::memcpy(&b[ix], "false", 5);
  801|   104k|               ix += 5;
  802|   104k|            }
  803|   134k|         }
  804|   134k|      }
_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_:
 1957|  3.09M|            [&](auto&& val) {
 1958|  3.09M|               using V = std::decay_t<decltype(val)>;
 1959|       |
 1960|       |               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1961|       |                             custom_write<V>) {
 1962|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1963|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1964|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1965|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1966|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1967|       |                  //
 1968|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1969|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1970|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1971|       |                  if (missing_id(value, ctx)) {
 1972|       |                     return;
 1973|       |                  }
 1974|       |                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1975|       |                  if constexpr (Opts.prettify) {
 1976|       |                     dump("{\n", b, ix);
 1977|       |                     ctx.depth += check_indentation_width(Opts);
 1978|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1979|       |                     dump('"', b, ix);
 1980|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 1981|       |                     if constexpr (std::integral<id_type>) {
 1982|       |                        dump("\": ", b, ix);
 1983|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1984|       |                     }
 1985|       |                     else {
 1986|       |                        dump("\": \"", b, ix);
 1987|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1988|       |                        dump('"', b, ix);
 1989|       |                     }
 1990|       |                     const auto pos_after_tag = ix;
 1991|       |                     dump(",\n", b, ix);
 1992|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1993|       |                     const auto pos_body_start = ix;
 1994|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 1995|       |                     if (ix == pos_body_start) {
 1996|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 1997|       |                     }
 1998|       |                     ctx.depth -= check_indentation_width(Opts);
 1999|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2000|       |                        return;
 2001|       |                     }
 2002|       |                     std::memcpy(&b[ix], "\n", 1);
 2003|       |                     ++ix;
 2004|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2005|       |                     ix += ctx.depth;
 2006|       |                     std::memcpy(&b[ix], "}", 1);
 2007|       |                     ++ix;
 2008|       |                  }
 2009|       |                  else {
 2010|       |                     dump("{\"", b, ix);
 2011|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2012|       |                     if constexpr (std::integral<id_type>) {
 2013|       |                        dump("\":", b, ix);
 2014|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2015|       |                     }
 2016|       |                     else {
 2017|       |                        dump("\":\"", b, ix);
 2018|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2019|       |                        dump('"', b, ix);
 2020|       |                     }
 2021|       |                     const auto pos_after_tag = ix;
 2022|       |                     dump(',', b, ix);
 2023|       |                     const auto pos_body_start = ix;
 2024|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2025|       |                     if (ix == pos_body_start) {
 2026|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2027|       |                     }
 2028|       |                     dump('}', b, ix);
 2029|       |                  }
 2030|       |               }
 2031|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2032|       |                                  variant_unit_alternative<V>) {
 2033|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2034|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2035|       |                  if (missing_id(value, ctx)) {
 2036|       |                     return;
 2037|       |                  }
 2038|       |                  if constexpr (Opts.prettify) {
 2039|       |                     dump("{\n", b, ix);
 2040|       |                     ctx.depth += check_indentation_width(Opts);
 2041|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2042|       |                     dump('"', b, ix);
 2043|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2044|       |                     dump("\": ", b, ix);
 2045|       |                     write_id<Opts>(value, ctx, b, ix);
 2046|       |                     ctx.depth -= check_indentation_width(Opts);
 2047|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2048|       |                        return;
 2049|       |                     }
 2050|       |                     std::memcpy(&b[ix], "\n", 1);
 2051|       |                     ++ix;
 2052|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2053|       |                     ix += ctx.depth;
 2054|       |                     std::memcpy(&b[ix], "}", 1);
 2055|       |                     ++ix;
 2056|       |                  }
 2057|       |                  else {
 2058|       |                     dump("{\"", b, ix);
 2059|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2060|       |                     dump("\":", b, ix);
 2061|       |                     write_id<Opts>(value, ctx, b, ix);
 2062|       |                     dump('}', b, ix);
 2063|       |                  }
 2064|       |               }
 2065|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2066|       |                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2067|       |                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2068|       |                  // An alternative that declares a member named like the discriminator carries the
 2069|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2070|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2071|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2072|       |                  if (missing_id(value, ctx)) {
 2073|       |                     return;
 2074|       |                  }
 2075|       |                  constexpr auto N = []() {
 2076|       |                     if constexpr (is_memory_object<V>) {
 2077|       |                        return reflect<memory_type<V>>::size;
 2078|       |                     }
 2079|       |                     else {
 2080|       |                        return reflect<V>::size;
 2081|       |                     }
 2082|       |                  }();
 2083|       |
 2084|       |                  // must first write out type
 2085|       |                  if constexpr (Opts.prettify) {
 2086|       |                     dump("{\n", b, ix);
 2087|       |                     ctx.depth += check_indentation_width(Opts);
 2088|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2089|       |                     dump('"', b, ix);
 2090|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2091|       |
 2092|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2093|       |
 2094|       |                     if constexpr (std::integral<id_type>) {
 2095|       |                        dump("\": ", b, ix);
 2096|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2097|       |                        if constexpr (N > 0) {
 2098|       |                           dump(",\n", b, ix);
 2099|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2100|       |                        }
 2101|       |                     }
 2102|       |                     else {
 2103|       |                        dump("\": \"", b, ix);
 2104|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2105|       |                        if constexpr (N == 0) {
 2106|       |                           dump('"', b, ix);
 2107|       |                        }
 2108|       |                        else {
 2109|       |                           dump("\",\n", b, ix);
 2110|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2111|       |                        }
 2112|       |                     }
 2113|       |                  }
 2114|       |                  else {
 2115|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2116|       |
 2117|       |                     dump("{\"", b, ix);
 2118|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2119|       |
 2120|       |                     if constexpr (std::integral<id_type>) {
 2121|       |                        dump("\":", b, ix);
 2122|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2123|       |                        if constexpr (N > 0) {
 2124|       |                           dump(',', b, ix);
 2125|       |                        }
 2126|       |                     }
 2127|       |                     else {
 2128|       |                        dump("\":\"", b, ix);
 2129|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2130|       |                        if constexpr (N == 0) {
 2131|       |                           dump('"', b, ix);
 2132|       |                        }
 2133|       |                        else {
 2134|       |                           dump("\",", b, ix);
 2135|       |                        }
 2136|       |                     }
 2137|       |                  }
 2138|       |                  if constexpr (is_memory_object<V>) {
 2139|       |                     if (!val) [[unlikely]] {
 2140|       |                        ctx.error = error_code::invalid_variant_object;
 2141|       |                        return;
 2142|       |                     }
 2143|       |                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2144|       |                  }
 2145|       |                  else {
 2146|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2147|       |                  }
 2148|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2149|       |                  if constexpr (Opts.skip_null_members) {
 2150|       |                     if (b[ix - 1] == ',') {
 2151|       |                        --ix;
 2152|       |                     }
 2153|       |                  }
 2154|       |
 2155|       |                  if constexpr (Opts.prettify) {
 2156|       |                     ctx.depth -= check_indentation_width(Opts);
 2157|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2158|       |                        return;
 2159|       |                     }
 2160|       |                     std::memcpy(&b[ix], "\n", 1);
 2161|       |                     ++ix;
 2162|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2163|       |                     ix += ctx.depth;
 2164|       |                     std::memcpy(&b[ix], "}", 1);
 2165|       |                     ++ix;
 2166|       |                  }
 2167|       |                  else {
 2168|       |                     dump('}', b, ix);
 2169|       |                  }
 2170|       |               }
 2171|  3.09M|               else {
 2172|  3.09M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2173|  3.09M|               }
 2174|  3.09M|            },
_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_:
 1426|  3.09M|      {
 1427|  3.09M|         if (empty_range(value)) {
  ------------------
  |  Branch (1427:14): [True: 142k, False: 2.94M]
  ------------------
 1428|   142k|            dump("[]", b, ix);
 1429|   142k|         }
 1430|  2.94M|         else {
 1431|       |            // For bounded buffers, skip pre-allocation path since value_padding is for SIMD, not actual size
 1432|       |            if constexpr (has_size<T> && array_padding_known<T> && !has_bounded_capacity<B>) {
 1433|       |               const auto n = value.size();
 1434|       |
 1435|       |               static constexpr auto value_padding = []() -> size_t {
 1436|       |                  if constexpr (required_padding<typename T::value_type>() > 0)
 1437|       |                     return required_padding<typename T::value_type>();
 1438|       |                  else
 1439|       |                     return fixed_padding<typename T::value_type>;
 1440|       |               }();
 1441|       |
 1442|       |               if constexpr (Opts.prettify) {
 1443|       |                  if constexpr (check_new_lines_in_arrays(Opts)) {
 1444|       |                     ctx.depth += check_indentation_width(Opts);
 1445|       |                  }
 1446|       |
 1447|       |                  // add space for '\n' and ',' characters for each element, hence `+ 2`
 1448|       |                  // use n + 1 because we put the end array character after the last element with whitespace
 1449|       |                  if (!ensure_space(ctx, b, ix + (n + 1) * (value_padding + ctx.depth + 2) + write_padding_bytes))
 1450|       |                     [[unlikely]] {
 1451|       |                     return;
 1452|       |                  }
 1453|       |
 1454|       |                  if constexpr (check_new_lines_in_arrays(Opts)) {
 1455|       |                     std::memcpy(&b[ix], "[\n", 2);
 1456|       |                     ix += 2;
 1457|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 1458|       |                     ix += ctx.depth;
 1459|       |                  }
 1460|       |                  else {
 1461|       |                     std::memcpy(&b[ix], "[", 1);
 1462|       |                     ++ix;
 1463|       |                  }
 1464|       |               }
 1465|       |               else {
 1466|       |                  static constexpr auto comma_padding = 1;
 1467|       |                  if (!ensure_space(ctx, b, ix + n * (value_padding + comma_padding) + write_padding_bytes))
 1468|       |                     [[unlikely]] {
 1469|       |                     return;
 1470|       |                  }
 1471|       |                  std::memcpy(&b[ix], "[", 1);
 1472|       |                  ++ix;
 1473|       |               }
 1474|       |
 1475|       |               auto it = std::begin(value);
 1476|       |               using val_t = std::remove_cvref_t<decltype(*it)>;
 1477|       |               to<JSON, val_t>::template op<write_unchecked_on<Opts>()>(*it, ctx, b, ix);
 1478|       |
 1479|       |               ++it;
 1480|       |               for (const auto fin = std::end(value); it != fin; ++it) {
 1481|       |                  if constexpr (Opts.prettify) {
 1482|       |                     if constexpr (check_new_lines_in_arrays(Opts)) {
 1483|       |                        std::memcpy(&b[ix], ",\n", 2);
 1484|       |                        ix += 2;
 1485|       |                        std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 1486|       |                        ix += ctx.depth;
 1487|       |                     }
 1488|       |                     else {
 1489|       |                        std::memcpy(&b[ix], ", ", 2);
 1490|       |                        ix += 2;
 1491|       |                     }
 1492|       |                  }
 1493|       |                  else {
 1494|       |                     std::memcpy(&b[ix], ",", 1);
 1495|       |                     ++ix;
 1496|       |                  }
 1497|       |                  if constexpr (is_output_streaming<B>) {
 1498|       |                     flush_buffer(b, ix);
 1499|       |                  }
 1500|       |
 1501|       |                  to<JSON, val_t>::template op<write_unchecked_on<Opts>()>(*it, ctx, b, ix);
 1502|       |               }
 1503|       |               if constexpr (Opts.prettify && check_new_lines_in_arrays(Opts)) {
 1504|       |                  ctx.depth -= check_indentation_width(Opts);
 1505|       |                  std::memcpy(&b[ix], "\n", 1);
 1506|       |                  ++ix;
 1507|       |                  std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 1508|       |                  ix += ctx.depth;
 1509|       |               }
 1510|       |
 1511|       |               std::memcpy(&b[ix], "]", 1);
 1512|       |               ++ix;
 1513|       |            }
 1514|  2.94M|            else {
 1515|       |               // we either can't get the size (std::forward_list) or we cannot compute the allocation size
 1516|       |
 1517|       |               if constexpr (Opts.prettify) {
 1518|       |                  if constexpr (check_new_lines_in_arrays(Opts)) {
 1519|       |                     ctx.depth += check_indentation_width(Opts);
 1520|       |                  }
 1521|       |
 1522|       |                  if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 1523|       |                     return;
 1524|       |                  }
 1525|       |
 1526|       |                  if constexpr (check_new_lines_in_arrays(Opts)) {
 1527|       |                     std::memcpy(&b[ix], "[\n", 2);
 1528|       |                     ix += 2;
 1529|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 1530|       |                     ix += ctx.depth;
 1531|       |                  }
 1532|       |                  else {
 1533|       |                     std::memcpy(&b[ix], "[", 1);
 1534|       |                     ++ix;
 1535|       |                  }
 1536|       |               }
 1537|  2.94M|               else {
 1538|  2.94M|                  if (!ensure_space(ctx, b, ix + write_padding_bytes)) [[unlikely]] {
  ------------------
  |  Branch (1538:23): [True: 0, False: 2.94M]
  ------------------
 1539|      0|                     return;
 1540|      0|                  }
 1541|  2.94M|                  std::memcpy(&b[ix], "[", 1);
 1542|  2.94M|                  ++ix;
 1543|  2.94M|               }
 1544|       |
 1545|      0|               auto it = std::begin(value);
 1546|  2.94M|               using val_t = std::remove_cvref_t<decltype(*it)>;
 1547|       |               if constexpr (required_padding<val_t>()) {
 1548|       |                  to<JSON, val_t>::template op<write_unchecked_on<Opts>()>(*it, ctx, b, ix);
 1549|       |               }
 1550|  2.94M|               else {
 1551|  2.94M|                  to<JSON, val_t>::template op<Opts>(*it, ctx, b, ix);
 1552|  2.94M|                  if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1552:23): [True: 0, False: 2.94M]
  ------------------
 1553|      0|                     return;
 1554|      0|                  }
 1555|  2.94M|               }
 1556|       |
 1557|  2.94M|               ++it;
 1558|  3.26M|               for (const auto fin = std::end(value); it != fin; ++it) {
  ------------------
  |  Branch (1558:55): [True: 317k, False: 2.94M]
  ------------------
 1559|       |                  if constexpr (required_padding<val_t>()) {
 1560|       |                     if constexpr (Opts.prettify) {
 1561|       |                        if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 1562|       |                           return;
 1563|       |                        }
 1564|       |                     }
 1565|       |                     else {
 1566|       |                        if (!ensure_space(ctx, b, ix + write_padding_bytes)) [[unlikely]] {
 1567|       |                           return;
 1568|       |                        }
 1569|       |                     }
 1570|       |
 1571|       |                     if constexpr (Opts.prettify) {
 1572|       |                        if constexpr (check_new_lines_in_arrays(Opts)) {
 1573|       |                           std::memcpy(&b[ix], ",\n", 2);
 1574|       |                           ix += 2;
 1575|       |                           std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 1576|       |                           ix += ctx.depth;
 1577|       |                        }
 1578|       |                        else {
 1579|       |                           std::memcpy(&b[ix], ", ", 2);
 1580|       |                           ix += 2;
 1581|       |                        }
 1582|       |                     }
 1583|       |                     else {
 1584|       |                        std::memcpy(&b[ix], ",", 1);
 1585|       |                        ++ix;
 1586|       |                     }
 1587|       |                     if constexpr (is_output_streaming<B>) {
 1588|       |                        flush_buffer(b, ix);
 1589|       |                     }
 1590|       |
 1591|       |                     to<JSON, val_t>::template op<write_unchecked_on<Opts>()>(*it, ctx, b, ix);
 1592|       |                  }
 1593|   317k|                  else {
 1594|   317k|                     write_array_entry_separator<Opts>(ctx, b, ix);
 1595|   317k|                     to<JSON, val_t>::template op<Opts>(*it, ctx, b, ix);
 1596|   317k|                     if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1596:26): [True: 0, False: 317k]
  ------------------
 1597|      0|                        return;
 1598|      0|                     }
 1599|   317k|                  }
 1600|   317k|               }
 1601|       |               if constexpr (Opts.prettify && check_new_lines_in_arrays(Opts)) {
 1602|       |                  ctx.depth -= check_indentation_width(Opts);
 1603|       |                  dump_newline_indent(check_indentation_char(Opts), ctx.depth, b, ix);
 1604|       |               }
 1605|       |
 1606|  2.94M|               dump(']', b, ix);
 1607|  2.94M|            }
 1608|  2.94M|         }
 1609|  3.09M|      }
_ZN3glz27write_array_entry_separatorITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEELb1ERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextERNS_7contextEmEEvOT2_OT1_RT3_:
 1353|   317k|   {
 1354|       |      if constexpr (Opts.prettify) {
 1355|       |         if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 1356|       |            return;
 1357|       |         }
 1358|       |         if constexpr (check_new_lines_in_arrays(Opts)) {
 1359|       |            std::memcpy(&b[ix], ",\n", 2);
 1360|       |            ix += 2;
 1361|       |            std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 1362|       |            ix += ctx.depth;
 1363|       |         }
 1364|       |         else {
 1365|       |            std::memcpy(&b[ix], ", ", 2);
 1366|       |            ix += 2;
 1367|       |         }
 1368|       |      }
 1369|   317k|      else {
 1370|   317k|         if constexpr (minified_check) {
 1371|   317k|            if (!ensure_space(ctx, b, ix + 1)) [[unlikely]] {
  ------------------
  |  Branch (1371:17): [True: 0, False: 317k]
  ------------------
 1372|      0|               return;
 1373|      0|            }
 1374|   317k|         }
 1375|   317k|         std::memcpy(&b[ix], ",", 1);
 1376|   317k|         ++ix;
 1377|   317k|      }
 1378|       |      if constexpr (is_output_streaming<B>) {
 1379|       |         flush_buffer(b, ix);
 1380|       |      }
 1381|   317k|   }
_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_:
 1957|  7.13M|            [&](auto&& val) {
 1958|  7.13M|               using V = std::decay_t<decltype(val)>;
 1959|       |
 1960|       |               if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 1961|       |                             custom_write<V>) {
 1962|       |                  // Custom alternative: the user's serializer emits the object body, into which we
 1963|       |                  // merge the variant tag. For this to produce valid JSON the custom to<> must (1)
 1964|       |                  // write an object body and (2) honor opening_and_closing_handled (suppress its own
 1965|       |                  // braces) so the tag shares the alternative's object. A custom writer that emits a
 1966|       |                  // scalar/array, or that ignores those flags, would yield malformed output.
 1967|       |                  //
 1968|       |                  // The tag-emission below mirrors the reflected-object branch that follows; keep the
 1969|       |                  // two in sync. The body size is not known at compile time, so we always write the
 1970|       |                  // tag separator and then drop it at runtime if the body turned out empty.
 1971|       |                  if (missing_id(value, ctx)) {
 1972|       |                     return;
 1973|       |                  }
 1974|       |                  using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 1975|       |                  if constexpr (Opts.prettify) {
 1976|       |                     dump("{\n", b, ix);
 1977|       |                     ctx.depth += check_indentation_width(Opts);
 1978|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1979|       |                     dump('"', b, ix);
 1980|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 1981|       |                     if constexpr (std::integral<id_type>) {
 1982|       |                        dump("\": ", b, ix);
 1983|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 1984|       |                     }
 1985|       |                     else {
 1986|       |                        dump("\": \"", b, ix);
 1987|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 1988|       |                        dump('"', b, ix);
 1989|       |                     }
 1990|       |                     const auto pos_after_tag = ix;
 1991|       |                     dump(",\n", b, ix);
 1992|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 1993|       |                     const auto pos_body_start = ix;
 1994|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 1995|       |                     if (ix == pos_body_start) {
 1996|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 1997|       |                     }
 1998|       |                     ctx.depth -= check_indentation_width(Opts);
 1999|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2000|       |                        return;
 2001|       |                     }
 2002|       |                     std::memcpy(&b[ix], "\n", 1);
 2003|       |                     ++ix;
 2004|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2005|       |                     ix += ctx.depth;
 2006|       |                     std::memcpy(&b[ix], "}", 1);
 2007|       |                     ++ix;
 2008|       |                  }
 2009|       |                  else {
 2010|       |                     dump("{\"", b, ix);
 2011|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2012|       |                     if constexpr (std::integral<id_type>) {
 2013|       |                        dump("\":", b, ix);
 2014|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2015|       |                     }
 2016|       |                     else {
 2017|       |                        dump("\":\"", b, ix);
 2018|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2019|       |                        dump('"', b, ix);
 2020|       |                     }
 2021|       |                     const auto pos_after_tag = ix;
 2022|       |                     dump(',', b, ix);
 2023|       |                     const auto pos_body_start = ix;
 2024|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2025|       |                     if (ix == pos_body_start) {
 2026|       |                        ix = pos_after_tag; // custom body was empty: undo the tag separator
 2027|       |                     }
 2028|       |                     dump('}', b, ix);
 2029|       |                  }
 2030|       |               }
 2031|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2032|       |                                  variant_unit_alternative<V>) {
 2033|       |                  // A unit alternative carries no data, so internal tagging renders it as the
 2034|       |                  // discriminator alone -- the same object an empty struct alternative produces.
 2035|       |                  if (missing_id(value, ctx)) {
 2036|       |                     return;
 2037|       |                  }
 2038|       |                  if constexpr (Opts.prettify) {
 2039|       |                     dump("{\n", b, ix);
 2040|       |                     ctx.depth += check_indentation_width(Opts);
 2041|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2042|       |                     dump('"', b, ix);
 2043|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2044|       |                     dump("\": ", b, ix);
 2045|       |                     write_id<Opts>(value, ctx, b, ix);
 2046|       |                     ctx.depth -= check_indentation_width(Opts);
 2047|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2048|       |                        return;
 2049|       |                     }
 2050|       |                     std::memcpy(&b[ix], "\n", 1);
 2051|       |                     ++ix;
 2052|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2053|       |                     ix += ctx.depth;
 2054|       |                     std::memcpy(&b[ix], "}", 1);
 2055|       |                     ++ix;
 2056|       |                  }
 2057|       |                  else {
 2058|       |                     dump("{\"", b, ix);
 2059|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2060|       |                     dump("\":", b, ix);
 2061|       |                     write_id<Opts>(value, ctx, b, ix);
 2062|       |                     dump('}', b, ix);
 2063|       |                  }
 2064|       |               }
 2065|       |               else if constexpr (check_write_type_info(Opts) && tagging == variant_tagging_kind::internal &&
 2066|       |                                  (glaze_object_t<V> || reflectable<V> || is_memory_object<V>) &&
 2067|       |                                  (not alternative_declares_key<V>(tag_v<T>))) {
 2068|       |                  // An alternative that declares a member named like the discriminator carries the
 2069|       |                  // discriminator itself, so no tag is merged here and the bare-write branch below
 2070|       |                  // handles it. Previously only `reflectable` alternatives were excluded; a
 2071|       |                  // `glaze_object_t` one fell through to this branch and emitted the key twice.
 2072|       |                  if (missing_id(value, ctx)) {
 2073|       |                     return;
 2074|       |                  }
 2075|       |                  constexpr auto N = []() {
 2076|       |                     if constexpr (is_memory_object<V>) {
 2077|       |                        return reflect<memory_type<V>>::size;
 2078|       |                     }
 2079|       |                     else {
 2080|       |                        return reflect<V>::size;
 2081|       |                     }
 2082|       |                  }();
 2083|       |
 2084|       |                  // must first write out type
 2085|       |                  if constexpr (Opts.prettify) {
 2086|       |                     dump("{\n", b, ix);
 2087|       |                     ctx.depth += check_indentation_width(Opts);
 2088|       |                     dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2089|       |                     dump('"', b, ix);
 2090|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2091|       |
 2092|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2093|       |
 2094|       |                     if constexpr (std::integral<id_type>) {
 2095|       |                        dump("\": ", b, ix);
 2096|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2097|       |                        if constexpr (N > 0) {
 2098|       |                           dump(",\n", b, ix);
 2099|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2100|       |                        }
 2101|       |                     }
 2102|       |                     else {
 2103|       |                        dump("\": \"", b, ix);
 2104|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2105|       |                        if constexpr (N == 0) {
 2106|       |                           dump('"', b, ix);
 2107|       |                        }
 2108|       |                        else {
 2109|       |                           dump("\",\n", b, ix);
 2110|       |                           dumpn(check_indentation_char(Opts), ctx.depth, b, ix);
 2111|       |                        }
 2112|       |                     }
 2113|       |                  }
 2114|       |                  else {
 2115|       |                     using id_type = std::decay_t<decltype(ids_v<T>[value.index()])>;
 2116|       |
 2117|       |                     dump("{\"", b, ix);
 2118|       |                     dump_maybe_empty(tag_v<T>, b, ix);
 2119|       |
 2120|       |                     if constexpr (std::integral<id_type>) {
 2121|       |                        dump("\":", b, ix);
 2122|       |                        serialize<JSON>::op<Opts>(ids_v<T>[value.index()], ctx, b, ix);
 2123|       |                        if constexpr (N > 0) {
 2124|       |                           dump(',', b, ix);
 2125|       |                        }
 2126|       |                     }
 2127|       |                     else {
 2128|       |                        dump("\":\"", b, ix);
 2129|       |                        dump_maybe_empty(ids_v<T>[value.index()], b, ix);
 2130|       |                        if constexpr (N == 0) {
 2131|       |                           dump('"', b, ix);
 2132|       |                        }
 2133|       |                        else {
 2134|       |                           dump("\",", b, ix);
 2135|       |                        }
 2136|       |                     }
 2137|       |                  }
 2138|       |                  if constexpr (is_memory_object<V>) {
 2139|       |                     if (!val) [[unlikely]] {
 2140|       |                        ctx.error = error_code::invalid_variant_object;
 2141|       |                        return;
 2142|       |                     }
 2143|       |                     to<JSON, memory_type<V>>::template op<opening_and_closing_handled<Opts>()>(*val, ctx, b, ix);
 2144|       |                  }
 2145|       |                  else {
 2146|       |                     to<JSON, V>::template op<opening_and_closing_handled<Opts>()>(val, ctx, b, ix);
 2147|       |                  }
 2148|       |                  // If we skip everything then we may have an extra comma, which we want to revert
 2149|       |                  if constexpr (Opts.skip_null_members) {
 2150|       |                     if (b[ix - 1] == ',') {
 2151|       |                        --ix;
 2152|       |                     }
 2153|       |                  }
 2154|       |
 2155|       |                  if constexpr (Opts.prettify) {
 2156|       |                     ctx.depth -= check_indentation_width(Opts);
 2157|       |                     if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 2158|       |                        return;
 2159|       |                     }
 2160|       |                     std::memcpy(&b[ix], "\n", 1);
 2161|       |                     ++ix;
 2162|       |                     std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 2163|       |                     ix += ctx.depth;
 2164|       |                     std::memcpy(&b[ix], "}", 1);
 2165|       |                     ++ix;
 2166|       |                  }
 2167|       |                  else {
 2168|       |                     dump('}', b, ix);
 2169|       |                  }
 2170|       |               }
 2171|  7.13M|               else {
 2172|  7.13M|                  to<JSON, V>::template op<Opts>(val, ctx, b, ix);
 2173|  7.13M|               }
 2174|  7.13M|            },
_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_:
 1614|  7.13M|      {
 1615|  7.13M|         if constexpr (not check_opening_handled(Opts)) {
 1616|  7.13M|            dump('{', b, ix);
 1617|  7.13M|         }
 1618|       |
 1619|  7.13M|         if (!empty_range(value)) {
  ------------------
  |  Branch (1619:14): [True: 7.02M, False: 103k]
  ------------------
 1620|  7.02M|            if constexpr (!check_opening_handled(Opts)) {
 1621|       |               if constexpr (Opts.prettify) {
 1622|       |                  ctx.depth += check_indentation_width(Opts);
 1623|       |                  if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 1624|       |                     return;
 1625|       |                  }
 1626|       |                  std::memcpy(&b[ix], "\n", 1);
 1627|       |                  ++ix;
 1628|       |                  std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 1629|       |                  ix += ctx.depth;
 1630|       |               }
 1631|  7.02M|            }
 1632|       |
 1633|  7.02M|            using val_t = detail::iterator_second_type<T>; // the type of value in each [key, value] pair
 1634|  7.02M|            constexpr bool write_function_pointers = check_write_function_pointers(Opts);
 1635|  7.02M|            if constexpr (!always_skipped<val_t> && (write_function_pointers || !is_any_function_ptr<val_t>)) {
 1636|       |               if constexpr (null_t<val_t> && Opts.skip_null_members) {
 1637|       |                  auto write_first_entry = [&](auto&& it) {
 1638|       |                     auto&& [key, entry_val] = *it;
 1639|       |                     if (skip_member<Opts>(entry_val)) {
 1640|       |                        return true;
 1641|       |                     }
 1642|       |                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1643|       |                     return bool(ctx.error);
 1644|       |                  };
 1645|       |
 1646|       |                  auto it = std::begin(value);
 1647|       |                  bool first = write_first_entry(it);
 1648|       |                  if (bool(ctx.error)) [[unlikely]] {
 1649|       |                     return;
 1650|       |                  }
 1651|       |                  ++it;
 1652|       |                  for (const auto end = std::end(value); it != end; ++it) {
 1653|       |                     auto&& [key, entry_val] = *it;
 1654|       |                     if (skip_member<Opts>(entry_val)) {
 1655|       |                        continue;
 1656|       |                     }
 1657|       |
 1658|       |                     // When Opts.skip_null_members, *any* entry may be skipped, meaning separator dumping must be
 1659|       |                     // conditional for every entry.
 1660|       |                     // Alternatively, write separator after each entry except last but then branch is permanent
 1661|       |                     if (not first) {
 1662|       |                        write_object_entry_separator<Opts>(ctx, b, ix);
 1663|       |                     }
 1664|       |
 1665|       |                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1666|       |                     if (bool(ctx.error)) [[unlikely]] {
 1667|       |                        return;
 1668|       |                     }
 1669|       |
 1670|       |                     first = false;
 1671|       |                  }
 1672|       |               }
 1673|  7.02M|               else {
 1674|  7.02M|                  auto write_first_entry = [&](auto&& it) {
 1675|  7.02M|                     auto&& [key, entry_val] = *it;
 1676|  7.02M|                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1677|  7.02M|                  };
 1678|       |
 1679|  7.02M|                  auto it = std::begin(value);
 1680|  7.02M|                  write_first_entry(it);
 1681|  7.02M|                  if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1681:23): [True: 0, False: 7.02M]
  ------------------
 1682|      0|                     return;
 1683|      0|                  }
 1684|  7.02M|                  ++it;
 1685|  22.4M|                  for (const auto end = std::end(value); it != end; ++it) {
  ------------------
  |  Branch (1685:58): [True: 15.4M, False: 7.02M]
  ------------------
 1686|  15.4M|                     auto&& [key, entry_val] = *it;
 1687|  15.4M|                     write_object_entry_separator<Opts>(ctx, b, ix);
 1688|  15.4M|                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1689|  15.4M|                     if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1689:26): [True: 0, False: 15.4M]
  ------------------
 1690|      0|                        return;
 1691|      0|                     }
 1692|  15.4M|                  }
 1693|  7.02M|               }
 1694|  7.02M|            }
 1695|       |
 1696|  7.02M|            if constexpr (!check_closing_handled(Opts)) {
 1697|       |               if constexpr (Opts.prettify) {
 1698|       |                  ctx.depth -= check_indentation_width(Opts);
 1699|       |                  if (!ensure_space(ctx, b, ix + ctx.depth + write_padding_bytes)) [[unlikely]] {
 1700|       |                     return;
 1701|       |                  }
 1702|       |                  std::memcpy(&b[ix], "\n", 1);
 1703|       |                  ++ix;
 1704|       |                  std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
 1705|       |                  ix += ctx.depth;
 1706|       |               }
 1707|  7.02M|            }
 1708|  7.02M|         }
 1709|       |
 1710|  7.13M|         if constexpr (!check_closing_handled(Opts)) {
 1711|  7.13M|            dump('}', b, ix);
 1712|  7.13M|         }
 1713|  7.13M|      }
_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_:
 1674|  7.02M|                  auto write_first_entry = [&](auto&& it) {
 1675|  7.02M|                     auto&& [key, entry_val] = *it;
 1676|  7.02M|                     write_pair_content<Opts>(key, entry_val, ctx, b, ix);
 1677|  7.02M|                  };
_ZN3glz28write_object_entry_separatorITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEELb1ERNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEETkNS_10is_contextERNS_7contextEmQooeqdtT_6formatL_ZNS_4JSONEEeqdtT_6formatL_ZNS_6NDJSONEEEEvOT2_OT1_RT3_:
  158|  15.4M|   {
  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|       |         std::memset(&b[ix], check_indentation_char(Opts), ctx.depth);
  166|       |         ix += ctx.depth;
  167|       |      }
  168|  15.4M|      else {
  169|  15.4M|         if constexpr (minified_check) {
  170|  15.4M|            if (!ensure_space(ctx, b, ix + 1)) [[unlikely]] {
  ------------------
  |  Branch (170:17): [True: 0, False: 15.4M]
  ------------------
  171|      0|               return;
  172|      0|            }
  173|  15.4M|         }
  174|  15.4M|         std::memcpy(&b[ix], ",", 1);
  175|  15.4M|         ++ix;
  176|  15.4M|      }
  177|       |      if constexpr (is_output_streaming<B>) {
  178|       |         flush_buffer(b, ix);
  179|       |      }
  180|  15.4M|   }
_ZN3glz18write_pair_contentITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextENS_7contextERS8_mEEvRKT0_OT1_RT2_OT3_RT4_:
 1386|  22.4M|   {
 1387|       |      if constexpr (str_t<Key> || char_t<Key> || is_named_enum<Key> || mimics_str_t<Key> || custom_str_t<Key> ||
 1388|  22.4M|                    check_quoted_num(Opts)) {
 1389|  22.4M|         to<JSON, core_t<Key>>::template op<Opts>(key, ctx, b, ix);
 1390|       |      }
 1391|       |      else if constexpr (num_t<Key>) {
 1392|       |         serialize<JSON>::op<opt_true<Opts, quoted_num_opt_tag{}>>(key, ctx, b, ix);
 1393|       |      }
 1394|       |      else {
 1395|       |         serialize<JSON>::op<opt_false<Opts, raw_string_opt_tag{}>>(quoted_t<const Key>{key}, ctx, b, ix);
 1396|       |      }
 1397|  22.4M|      if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1397:11): [True: 0, False: 22.4M]
  ------------------
 1398|      0|         return;
 1399|      0|      }
 1400|       |      if constexpr (Opts.prettify) {
 1401|       |         dump(": ", b, ix);
 1402|       |      }
 1403|  22.4M|      else {
 1404|  22.4M|         dump(':', b, ix);
 1405|  22.4M|      }
 1406|       |
 1407|  22.4M|      using V = core_t<decltype(value)>;
 1408|  22.4M|      to<JSON, V>::template op<opening_and_closing_handled_off<Opts>()>(value, ctx, b, ix);
 1409|  22.4M|   }
_ZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_RKS7_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_:
  845|  22.4M|      {
  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|  22.4M|         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|  22.4M|            else {
  945|  22.4M|               const sv str = [&]() -> const sv {
  946|  22.4M|                  if constexpr (array_char_t<T>) {
  947|  22.4M|                     return sv{value.data(), value.size()};
  948|  22.4M|                  }
  949|  22.4M|                  else if constexpr (u8str_t<T>) {
  950|  22.4M|                     return sv{reinterpret_cast<const char*>(value.data()), value.size()};
  951|  22.4M|                  }
  952|  22.4M|                  else {
  953|  22.4M|                     return str_view<T>(value);
  954|  22.4M|                  }
  955|  22.4M|               }();
  956|  22.4M|               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|  22.4M|               else {
  988|       |                  // Using the original sizing
  989|  22.4M|                  if (!ensure_space(ctx, b, ix + 10 + 2 * n)) [[unlikely]] {
  ------------------
  |  Branch (989:23): [True: 0, False: 22.4M]
  ------------------
  990|      0|                     return;
  991|      0|                  }
  992|  22.4M|               }
  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|  22.4M|               else {
 1002|  22.4M|                  std::memcpy(&b[ix], "\"", 1);
 1003|  22.4M|                  ++ix;
 1004|       |
 1005|  22.4M|                  const auto* c = str.data();
 1006|  22.4M|                  const auto* const e = c + n;
 1007|  22.4M|                  const auto start = &b[ix];
 1008|  22.4M|                  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|  22.4M|                  auto write_escape = [&]() {
 1017|  22.4M|                     if constexpr (check_escape_control_characters(Opts)) {
 1018|  22.4M|                        if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
 1019|  22.4M|                           std::memcpy(data, &escaped, 2);
 1020|  22.4M|                           data += 2;
 1021|  22.4M|                        }
 1022|  22.4M|                        else {
 1023|  22.4M|                           char unicode_escape[6] = {'\\', 'u', '0', '0', '0', '0'};
 1024|  22.4M|                           constexpr char hex_digits[] = "0123456789ABCDEF";
 1025|  22.4M|                           unicode_escape[4] = hex_digits[(uint8_t(*c) >> 4) & 0xF];
 1026|  22.4M|                           unicode_escape[5] = hex_digits[uint8_t(*c) & 0xF];
 1027|  22.4M|                           std::memcpy(data, unicode_escape, 6);
 1028|  22.4M|                           data += 6;
 1029|  22.4M|                        }
 1030|  22.4M|                     }
 1031|  22.4M|                     else {
 1032|  22.4M|                        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|  22.4M|                           if (char_escape_table[uint8_t(*c)] == 0) [[unlikely]] {
 1039|  22.4M|                              ctx.error = error_code::invalid_control_character;
 1040|  22.4M|                           }
 1041|  22.4M|                        }
 1042|  22.4M|                        std::memcpy(data, &char_escape_table[uint8_t(*c)], 2);
 1043|  22.4M|                        data += 2;
 1044|  22.4M|                     }
 1045|  22.4M|                     ++c;
 1046|  22.4M|                  };
 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|  22.4M|#if defined(GLZ_USE_SSE2)
 1055|  22.4M|                  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|  22.4M|                  if (n > 7) {
  ------------------
  |  Branch (1061:23): [True: 11.9M, False: 10.4M]
  ------------------
 1062|  34.7M|                     for (const auto end_m7 = e - 7; c < end_m7;) {
  ------------------
  |  Branch (1062:54): [True: 22.7M, False: 11.9M]
  ------------------
 1063|  22.7M|                        std::memcpy(data, c, 8);
 1064|  22.7M|                        uint64_t swar;
 1065|  22.7M|                        std::memcpy(&swar, c, 8);
 1066|       |                        if constexpr (std::endian::native == std::endian::big) {
 1067|       |                           swar = std::byteswap(swar);
 1068|       |                        }
 1069|       |
 1070|  22.7M|                        constexpr uint64_t lo7_mask = repeat_byte8(0b01111111);
 1071|  22.7M|                        const uint64_t lo7 = swar & lo7_mask;
 1072|  22.7M|                        const uint64_t quote = (lo7 ^ repeat_byte8('"')) + lo7_mask;
 1073|  22.7M|                        const uint64_t backslash = (lo7 ^ repeat_byte8('\\')) + lo7_mask;
 1074|  22.7M|                        const uint64_t less_32 = (swar & repeat_byte8(0b01100000)) + lo7_mask;
 1075|  22.7M|                        uint64_t next = ~((quote & backslash & less_32) | swar);
 1076|       |
 1077|  22.7M|                        next &= repeat_byte8(0b10000000);
 1078|  22.7M|                        if (next == 0) {
  ------------------
  |  Branch (1078:29): [True: 3.97M, False: 18.7M]
  ------------------
 1079|  3.97M|                           data += 8;
 1080|  3.97M|                           c += 8;
 1081|  3.97M|                           continue;
 1082|  3.97M|                        }
 1083|       |
 1084|  18.7M|                        const auto length = (countr_zero(next) >> 3);
 1085|  18.7M|                        c += length;
 1086|  18.7M|                        data += length;
 1087|  18.7M|                        write_escape();
 1088|  18.7M|                     }
 1089|  11.9M|                  }
 1090|       |
 1091|       |                  // Scalar tail
 1092|   101M|                  for (; c < e; ++c) {
  ------------------
  |  Branch (1092:26): [True: 79.1M, False: 22.4M]
  ------------------
 1093|  79.1M|                     if (const auto escaped = char_escape_table[uint8_t(*c)]; escaped) {
  ------------------
  |  Branch (1093:79): [True: 4.81M, False: 74.3M]
  ------------------
 1094|  4.81M|                        std::memcpy(data, &escaped, 2);
 1095|  4.81M|                        data += 2;
 1096|  4.81M|                     }
 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|  74.3M|                     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|  74.3M|                        std::memcpy(data, c, 1);
 1118|  74.3M|                        ++data;
 1119|  74.3M|                     }
 1120|  79.1M|                  }
 1121|       |
 1122|  22.4M|                  ix += size_t(data - start);
 1123|       |
 1124|  22.4M|                  std::memcpy(&b[ix], "\"", 1);
 1125|  22.4M|                  ++ix;
 1126|  22.4M|               }
 1127|  22.4M|            }
 1128|  22.4M|         }
 1129|  22.4M|      }
_ZZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_RKS7_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlvE_clEv:
  945|  22.4M|               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|  22.4M|                  else {
  953|  22.4M|                     return str_view<T>(value);
  954|  22.4M|                  }
  955|  22.4M|               }();
_ZZN3glz2toILj10ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS7_RKS7_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_ENKUlvE0_clEv:
 1016|  3.80G|                  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.80G|                     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.80G|                        std::memcpy(data, &char_escape_table[uint8_t(*c)], 2);
 1043|  3.80G|                        data += 2;
 1044|  3.80G|                     }
 1045|  3.80G|                     ++c;
 1046|  3.80G|                  };

_ZN3glz6detail18sse2_string_escapeIcRZNS_2toILj10ENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS9_SD_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_EUlvE0_EEvRPKcSR_RPT_mSL_:
   17|  3.65M|   {
   18|       |      // SSE2: 16 bytes at a time with direct comparison instructions
   19|  3.65M|      if (n > 15) {
  ------------------
  |  Branch (19:11): [True: 1.47M, False: 2.17M]
  ------------------
   20|  1.47M|         const __m128i quote_vec = _mm_set1_epi8('"');
   21|  1.47M|         const __m128i bs_vec = _mm_set1_epi8('\\');
   22|  1.47M|         const __m128i ctrl_mask = _mm_set1_epi8(static_cast<int8_t>(0xE0));
   23|  1.47M|         const __m128i zero = _mm_setzero_si128();
   24|       |
   25|  28.1M|         for (const char* end_m15 = e - 15; c < end_m15;) {
  ------------------
  |  Branch (25:45): [True: 26.6M, False: 1.47M]
  ------------------
   26|  26.6M|            __m128i v = _mm_loadu_si128(reinterpret_cast<const __m128i*>(c));
   27|  26.6M|            _mm_storeu_si128(reinterpret_cast<__m128i*>(data), v);
   28|       |
   29|  26.6M|            const uint32_t mask = static_cast<uint32_t>(
   30|  26.6M|               _mm_movemask_epi8(_mm_or_si128(_mm_or_si128(_mm_cmpeq_epi8(v, quote_vec), _mm_cmpeq_epi8(v, bs_vec)),
   31|  26.6M|                                              _mm_cmpeq_epi8(_mm_and_si128(v, ctrl_mask), zero))));
   32|       |
   33|  26.6M|            if (mask == 0) {
  ------------------
  |  Branch (33:17): [True: 2.47M, False: 24.1M]
  ------------------
   34|  2.47M|               data += 16;
   35|  2.47M|               c += 16;
   36|  2.47M|               continue;
   37|  2.47M|            }
   38|       |
   39|  24.1M|            const uint32_t length = countr_zero(mask);
   40|  24.1M|            c += length;
   41|  24.1M|            data += length;
   42|  24.1M|            write_escape();
   43|  24.1M|         }
   44|  1.47M|      }
   45|  3.65M|   }
_ZN3glz6detail18sse2_string_escapeIcRZNS_2toILj10ENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb1ELb1EEERS9_RKS9_TkNS_10is_contextERNS_7contextEmEEvOT1_OT2_OT0_RT3_EUlvE0_EEvRPKcST_RPT_mSN_:
   17|  22.4M|   {
   18|       |      // SSE2: 16 bytes at a time with direct comparison instructions
   19|  22.4M|      if (n > 15) {
  ------------------
  |  Branch (19:11): [True: 8.82M, False: 13.6M]
  ------------------
   20|  8.82M|         const __m128i quote_vec = _mm_set1_epi8('"');
   21|  8.82M|         const __m128i bs_vec = _mm_set1_epi8('\\');
   22|  8.82M|         const __m128i ctrl_mask = _mm_set1_epi8(static_cast<int8_t>(0xE0));
   23|  8.82M|         const __m128i zero = _mm_setzero_si128();
   24|       |
   25|  3.82G|         for (const char* end_m15 = e - 15; c < end_m15;) {
  ------------------
  |  Branch (25:45): [True: 3.81G, False: 8.82M]
  ------------------
   26|  3.81G|            __m128i v = _mm_loadu_si128(reinterpret_cast<const __m128i*>(c));
   27|  3.81G|            _mm_storeu_si128(reinterpret_cast<__m128i*>(data), v);
   28|       |
   29|  3.81G|            const uint32_t mask = static_cast<uint32_t>(
   30|  3.81G|               _mm_movemask_epi8(_mm_or_si128(_mm_or_si128(_mm_cmpeq_epi8(v, quote_vec), _mm_cmpeq_epi8(v, bs_vec)),
   31|  3.81G|                                              _mm_cmpeq_epi8(_mm_and_si128(v, ctrl_mask), zero))));
   32|       |
   33|  3.81G|            if (mask == 0) {
  ------------------
  |  Branch (33:17): [True: 26.9M, False: 3.78G]
  ------------------
   34|  26.9M|               data += 16;
   35|  26.9M|               c += 16;
   36|  26.9M|               continue;
   37|  26.9M|            }
   38|       |
   39|  3.78G|            const uint32_t length = countr_zero(mask);
   40|  3.78G|            c += length;
   41|  3.78G|            data += length;
   42|  3.78G|            write_escape();
   43|  3.78G|         }
   44|  8.82M|      }
   45|  22.4M|   }

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

_ZN3glz4dumpILb1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvNS1_17basic_string_viewIcS4_EERT0_Rm:
  140|   142k|   {
  141|   142k|      const auto n = str.size();
  142|   142k|      if constexpr (vector_like<B>) {
  143|   142k|         if constexpr (Checked) {
  144|   142k|            const auto k = ix + n;
  145|   142k|            if (ix + n > b.size()) [[unlikely]] {
  ------------------
  |  Branch (145:17): [True: 0, False: 142k]
  ------------------
  146|      0|               b.resize(2 * k);
  147|      0|            }
  148|   142k|         }
  149|   142k|      }
  150|   142k|      std::memcpy(&b[ix], str.data(), n);
  151|   142k|      ix += n;
  152|   142k|   }
_ZN3glz4dumpILb1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEETkNS_10byte_sizedEcEEvT1_RT0_Rm:
   98|  39.6M|   {
   99|  39.6M|      if constexpr (Checked && vector_like<B>) {
  100|  39.6M|         if (ix == b.size()) [[unlikely]] {
  ------------------
  |  Branch (100:14): [True: 392, False: 39.6M]
  ------------------
  101|    392|            b.resize(b.size() == 0 ? 128 : b.size() * 2);
  ------------------
  |  Branch (101:22): [True: 0, False: 392]
  ------------------
  102|    392|         }
  103|  39.6M|      }
  104|  39.6M|      assign_maybe_cast(c, b, ix);
  105|  39.6M|      ++ix;
  106|  39.6M|   }
_ZN3glz17assign_maybe_castITkNS_10byte_sizedEcNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvT_RT0_Rm:
   55|  39.6M|   {
   56|  39.6M|      using V = std::decay_t<decltype(b[0])>;
   57|  39.6M|      using C = std::decay_t<decltype(c)>;
   58|  39.6M|      if constexpr (std::same_as<V, C>) {
   59|  39.6M|         b[ix] = c;
   60|       |      }
   61|       |      else {
   62|       |         b[ix] = static_cast<V>(c);
   63|       |      }
   64|  39.6M|   }

_ZN3glz10fast_float10from_charsIdciEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_12chars_formatE:
 4237|  1.42M|           chars_format fmt /*= chars_format::general*/) noexcept {
 4238|  1.42M|  return from_chars_caller<T>::call(first, last, value,
 4239|  1.42M|                                    parse_options_t<UC>(fmt));
 4240|  1.42M|}
_ZN3glz10fast_float17from_chars_callerIdE4callIcEENS0_19from_chars_result_tIT_EEPKS5_S8_RdNS0_15parse_options_tIS5_EE:
 4195|  1.42M|       parse_options_t<UC> options) noexcept {
 4196|  1.42M|    return from_chars_advanced(first, last, value, options);
 4197|  1.42M|  }
_ZN3glz10fast_float19from_chars_advancedIdcEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_15parse_options_tIS3_EE:
 4443|  1.42M|                    parse_options_t<UC> options) noexcept {
 4444|  1.42M|  return from_chars_advanced_caller<
 4445|  1.42M|      size_t(is_supported_float_type<T>::value) +
 4446|  1.42M|      2 * size_t(is_supported_integer_type<T>::value)>::call(first, last, value,
 4447|  1.42M|                                                             options);
 4448|  1.42M|}
_ZN3glz10fast_float26from_chars_advanced_callerILm1EE4callIdcEENS0_19from_chars_result_tIT0_EEPKS5_S8_RT_NS0_15parse_options_tIS5_EE:
 4426|  1.42M|       parse_options_t<UC> options) noexcept {
 4427|  1.42M|    return from_chars_float_advanced(first, last, value, options);
 4428|  1.42M|  }
_ZN3glz10fast_float25from_chars_float_advancedIdcEENS0_19from_chars_result_tIT0_EEPKS3_S6_RT_NS0_15parse_options_tIS3_EE:
 4338|  1.42M|                          parse_options_t<UC> options) noexcept {
 4339|       |
 4340|  1.42M|  static_assert(is_supported_float_type<T>::value,
 4341|  1.42M|                "only some floating-point types are supported");
 4342|  1.42M|  static_assert(is_supported_char_type<UC>::value,
 4343|  1.42M|                "only char, wchar_t, char16_t and char32_t are supported");
 4344|       |
 4345|  1.42M|  chars_format const fmt = detail::adjust_for_feature_macros(options.format);
 4346|       |
 4347|  1.42M|  from_chars_result_t<UC> answer;
 4348|  1.42M|  if (uint64_t(fmt & chars_format::skip_white_space)) {
  ------------------
  |  Branch (4348:7): [True: 0, False: 1.42M]
  ------------------
 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|  1.42M|  if (first == last) {
  ------------------
  |  Branch (4353:7): [True: 756, False: 1.42M]
  ------------------
 4354|    756|    answer.ec = std::errc::invalid_argument;
 4355|    756|    answer.ptr = first;
 4356|    756|    return answer;
 4357|    756|  }
 4358|  1.42M|  parsed_number_string_t<UC> pns =
 4359|  1.42M|      uint64_t(fmt & detail::basic_json_fmt)
  ------------------
  |  Branch (4359:7): [True: 0, False: 1.42M]
  ------------------
 4360|  1.42M|          ? parse_number_string<true, UC>(first, last, options)
 4361|  1.42M|          : parse_number_string<false, UC>(first, last, options);
 4362|  1.42M|  if (!pns.valid) {
  ------------------
  |  Branch (4362:7): [True: 375k, False: 1.05M]
  ------------------
 4363|   375k|    if (uint64_t(fmt & chars_format::no_infnan)) {
  ------------------
  |  Branch (4363:9): [True: 0, False: 375k]
  ------------------
 4364|      0|      answer.ec = std::errc::invalid_argument;
 4365|      0|      answer.ptr = first;
 4366|      0|      return answer;
 4367|   375k|    } else {
 4368|   375k|      return detail::parse_infnan(first, last, value, fmt);
 4369|   375k|    }
 4370|   375k|  }
 4371|       |
 4372|       |  // call overload that takes parsed_number_string_t directly.
 4373|  1.05M|  return from_chars_advanced(pns, value);
 4374|  1.42M|}
_ZN3glz10fast_float6detail25adjust_for_feature_macrosENS0_12chars_formatE:
 1375|  2.85M|constexpr chars_format adjust_for_feature_macros(chars_format fmt) {
 1376|  2.85M|  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|  2.85M|      ;
 1384|  2.85M|}
_ZN3glz10fast_floatanENS0_12chars_formatES1_:
 1340|  9.17M|constexpr chars_format operator&(chars_format lhs, chars_format rhs) noexcept {
 1341|  9.17M|  using int_type = std::underlying_type<chars_format>::type;
 1342|  9.17M|  return static_cast<chars_format>(static_cast<int_type>(lhs) &
 1343|  9.17M|                                   static_cast<int_type>(rhs));
 1344|  9.17M|}
_ZN3glz10fast_float4spanIKcEC2Ev:
  438|  3.60M|  constexpr span() : ptr(nullptr), length(0) {}
_ZN3glz10fast_float18report_parse_errorIcEENS0_22parsed_number_string_tIT_EEPKS3_NS0_11parse_errorE:
 1727|   375k|report_parse_error(UC const *p, parse_error error) {
 1728|   375k|  parsed_number_string_t<UC> answer;
 1729|   375k|  answer.valid = false;
 1730|   375k|  answer.lastmatch = p;
 1731|   375k|  answer.error = error;
 1732|   375k|  return answer;
 1733|   375k|}
_ZN3glz10fast_float10is_integerIcEEbT_:
 1481|  1.42M|fastfloat_really_inline constexpr bool is_integer(UC c) noexcept {
 1482|  1.42M|  return !(c > UC('9') || c < UC('0'));
  ------------------
  |  Branch (1482:12): [True: 2.14k, False: 1.42M]
  |  Branch (1482:27): [True: 8.80k, False: 1.41M]
  ------------------
 1483|  1.42M|}
_ZN3glz10fast_float11digit_valueIcEEmT_:
 1489|  30.2M|fastfloat_really_inline constexpr uint64_t digit_value(UC c) noexcept {
 1490|  30.2M|  return uint64_t(uint8_t(c) - uint8_t('0'));
 1491|  30.2M|}
_ZN3glz10fast_float4spanIKcEC2EPS2_m:
  436|  1.62M|  constexpr span(T const *_ptr, size_t _length) : ptr(_ptr), length(_length) {}
_ZN3glz10fast_float26loop_parse_if_eight_digitsERPKcS2_Rm:
 1679|   198k|                           uint64_t &i) {
 1680|       |  // optimizes better than parse_if_eight_digits_unrolled() for UC = char.
 1681|   488k|  while ((std::distance(p, pend) >= 8) &&
  ------------------
  |  Branch (1681:10): [True: 334k, False: 154k]
  ------------------
 1682|   334k|         is_made_of_eight_digits_fast(read8_to_u64(p))) {
  ------------------
  |  Branch (1682:10): [True: 289k, False: 44.6k]
  ------------------
 1683|   289k|    i = i * 100000000 +
 1684|   289k|        parse_eight_digits_unrolled(read8_to_u64(
 1685|   289k|            p)); // in rare cases, this will overflow, but that's ok
 1686|   289k|    p += 8;
 1687|   289k|  }
 1688|   198k|}
_ZN3glz10fast_float28is_made_of_eight_digits_fastEm:
 1597|   334k|is_made_of_eight_digits_fast(uint64_t val) noexcept {
 1598|   334k|  return !((((val + 0x4646464646464646) | (val - 0x3030303030303030)) &
 1599|   334k|            0x8080808080808080));
 1600|   334k|}
_ZN3glz10fast_float12read8_to_u64IcEEmPKT_:
 1503|   737k|read8_to_u64(UC const *chars) {
 1504|   737k|  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|   737k|  uint64_t val;
 1513|   737k|  ::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|   737k|  return val;
 1519|   737k|}
_ZN3glz10fast_float27parse_eight_digits_unrolledEm:
 1575|   403k|parse_eight_digits_unrolled(uint64_t val) {
 1576|   403k|  uint64_t const mask = 0x000000FF000000FF;
 1577|   403k|  uint64_t const mul1 = 0x000F424000000064; // 100 + (1000000ULL << 32)
 1578|   403k|  uint64_t const mul2 = 0x0000271000000001; // 1 + (10000ULL << 32)
 1579|   403k|  val -= 0x3030303030303030;
 1580|   403k|  val = (val * 10) + (val >> 8); // val = (val * 2561) >> 8;
 1581|   403k|  val = (((val & mask) * mul1) + (((val >> 16) & mask) * mul2)) >> 32;
 1582|   403k|  return uint32_t(val);
 1583|   403k|}
_ZNK3glz10fast_float4spanIKcE3lenEv:
  440|   429k|  constexpr size_t len() const noexcept { return length; }
_ZN3glz10fast_float19parse_number_stringILb0EcEENS0_22parsed_number_string_tIT0_EEPKS3_S6_NS0_15parse_options_tIS3_EE:
 1740|  1.42M|                    parse_options_t<UC> options) noexcept {
 1741|  1.42M|  chars_format const fmt = detail::adjust_for_feature_macros(options.format);
 1742|  1.42M|  UC const decimal_point = options.decimal_point;
 1743|       |
 1744|  1.42M|  parsed_number_string_t<UC> answer;
 1745|  1.42M|  answer.valid = false;
 1746|  1.42M|  answer.too_many_digits = false;
 1747|       |  // assume p < pend, so dereference without checks;
 1748|  1.42M|  answer.negative = (*p == UC('-'));
 1749|       |  // C++17 20.19.3.(7.1) explicitly forbids '+' sign here
 1750|  1.42M|  if ((*p == UC('-')) || (uint64_t(fmt & chars_format::allow_leading_plus) &&
  ------------------
  |  Branch (1750:7): [True: 41.0k, False: 1.38M]
  |  Branch (1750:27): [True: 0, False: 1.38M]
  ------------------
 1751|  41.0k|                          !basic_json_fmt && *p == UC('+'))) {
  ------------------
  |  Branch (1751:27): [True: 0, Folded]
  |  Branch (1751:46): [True: 0, False: 0]
  ------------------
 1752|  41.0k|    ++p;
 1753|  41.0k|    if (p == pend) {
  ------------------
  |  Branch (1753:9): [True: 2.03k, False: 39.0k]
  ------------------
 1754|  2.03k|      return report_parse_error<UC>(
 1755|  2.03k|          p, parse_error::missing_integer_or_dot_after_sign);
 1756|  2.03k|    }
 1757|  39.0k|    GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  39.0k|#define GLZ_FASTFLOAT_IF_CONSTEXPR17(x) if constexpr (x)
  ------------------
 1758|  39.0k|      if (!is_integer(*p)) { // a sign must be followed by an integer
 1759|  39.0k|        return report_parse_error<UC>(p,
 1760|  39.0k|                                      parse_error::missing_integer_after_sign);
 1761|  39.0k|      }
 1762|  39.0k|    }
 1763|  39.0k|    else {
 1764|  39.0k|      if (!is_integer(*p) &&
  ------------------
  |  Branch (1764:11): [True: 6.96k, False: 32.0k]
  ------------------
 1765|  6.96k|          (*p !=
  ------------------
  |  Branch (1765:11): [True: 3.06k, False: 3.90k]
  ------------------
 1766|  6.96k|           decimal_point)) { // a sign must be followed by an integer or the dot
 1767|  3.06k|        return report_parse_error<UC>(
 1768|  3.06k|            p, parse_error::missing_integer_or_dot_after_sign);
 1769|  3.06k|      }
 1770|  39.0k|    }
 1771|  39.0k|  }
 1772|  1.42M|  UC const *const start_digits = p;
 1773|       |
 1774|  1.42M|  uint64_t i = 0; // an unsigned int avoids signed overflows (which are bad)
 1775|       |
 1776|  1.42M|  uint64_t digit;
 1777|  30.6M|  while ((p != pend) && (digit = digit_value(*p)) <= 9) {
  ------------------
  |  Branch (1777:10): [True: 30.1M, False: 567k]
  |  Branch (1777:25): [True: 29.2M, False: 857k]
  ------------------
 1778|       |    // a multiplication by 10 is cheaper than an arbitrary integer
 1779|       |    // multiplication
 1780|  29.2M|    i = 10 * i + digit; // might overflow, we will handle the overflow later
 1781|  29.2M|    ++p;
 1782|  29.2M|  }
 1783|  1.42M|  UC const *const end_of_integer_part = p;
 1784|  1.42M|  int64_t digit_count = int64_t(end_of_integer_part - start_digits);
 1785|  1.42M|  answer.integer = span<UC const>(start_digits, size_t(digit_count));
 1786|  1.42M|  GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  1.42M|#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|  1.42M|  int64_t exponent = 0;
 1798|  1.42M|  bool const has_decimal_point = (p != pend) && (*p == decimal_point);
  ------------------
  |  Branch (1798:34): [True: 857k, False: 567k]
  |  Branch (1798:49): [True: 198k, False: 659k]
  ------------------
 1799|  1.42M|  if (has_decimal_point) {
  ------------------
  |  Branch (1799:7): [True: 198k, False: 1.22M]
  ------------------
 1800|   198k|    ++p;
 1801|   198k|    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|   198k|    loop_parse_if_eight_digits(p, pend, i);
 1805|       |
 1806|   241k|    while ((p != pend) && (digit = digit_value(*p)) <= 9) {
  ------------------
  |  Branch (1806:12): [True: 174k, False: 67.3k]
  |  Branch (1806:27): [True: 43.0k, False: 131k]
  ------------------
 1807|  43.0k|      ++p;
 1808|  43.0k|      i = i * 10 + digit; // in rare cases, this will overflow, but that's ok
 1809|  43.0k|    }
 1810|   198k|    exponent = before - p;
 1811|   198k|    answer.fraction = span<UC const>(before, size_t(p - before));
 1812|   198k|    digit_count -= exponent;
 1813|   198k|  }
 1814|  1.42M|  GLZ_FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
  ------------------
  |  |  127|  1.42M|#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|  1.42M|  else if (digit_count == 0) { // we must have encountered at least one integer!
  ------------------
  |  Branch (1821:12): [True: 370k, False: 1.05M]
  ------------------
 1822|   370k|    return report_parse_error<UC>(p, parse_error::no_digits_in_mantissa);
 1823|   370k|  }
 1824|  1.05M|  int64_t exp_number = 0; // explicit exponential part
 1825|  1.42M|  if ((uint64_t(fmt & chars_format::scientific) && (p != pend) &&
  ------------------
  |  Branch (1825:8): [True: 1.05M, False: 373k]
  |  Branch (1825:52): [True: 481k, False: 570k]
  ------------------
 1826|   481k|       ((UC('e') == *p) || (UC('E') == *p))) ||
  ------------------
  |  Branch (1826:9): [True: 1.49k, False: 479k]
  |  Branch (1826:28): [True: 4.12k, False: 475k]
  ------------------
 1827|  1.04M|      (uint64_t(fmt & detail::basic_fortran_fmt) && (p != pend) &&
  ------------------
  |  Branch (1827:8): [True: 0, False: 1.04M]
  |  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|  5.62k|        (UC('D') == *p)))) {
  ------------------
  |  Branch (1829:9): [True: 0, False: 0]
  ------------------
 1830|  5.62k|    UC const *location_of_e = p;
 1831|  5.62k|    if ((UC('e') == *p) || (UC('E') == *p) || (UC('d') == *p) ||
  ------------------
  |  Branch (1831:9): [True: 1.49k, False: 4.12k]
  |  Branch (1831:28): [True: 4.12k, False: 0]
  |  Branch (1831:47): [True: 0, False: 0]
  ------------------
 1832|  5.62k|        (UC('D') == *p)) {
  ------------------
  |  Branch (1832:9): [True: 0, False: 0]
  ------------------
 1833|  5.62k|      ++p;
 1834|  5.62k|    }
 1835|  5.62k|    bool neg_exp = false;
 1836|  5.62k|    if ((p != pend) && (UC('-') == *p)) {
  ------------------
  |  Branch (1836:9): [True: 5.05k, False: 568]
  |  Branch (1836:24): [True: 1.08k, False: 3.97k]
  ------------------
 1837|  1.08k|      neg_exp = true;
 1838|  1.08k|      ++p;
 1839|  4.53k|    } else if ((p != pend) &&
  ------------------
  |  Branch (1839:16): [True: 3.97k, False: 568]
  ------------------
 1840|  3.97k|               (UC('+') ==
  ------------------
  |  Branch (1840:16): [True: 76, False: 3.89k]
  ------------------
 1841|  3.97k|                *p)) { // '+' on exponent is allowed by C++17 20.19.3.(7.1)
 1842|     76|      ++p;
 1843|     76|    }
 1844|  5.62k|    if ((p == pend) || !is_integer(*p)) {
  ------------------
  |  Branch (1844:9): [True: 568, False: 5.05k]
  |  Branch (1844:24): [True: 1.07k, False: 3.98k]
  ------------------
 1845|  1.64k|      if (!uint64_t(fmt & chars_format::fixed)) {
  ------------------
  |  Branch (1845:11): [True: 0, False: 1.64k]
  ------------------
 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|  1.64k|      p = location_of_e;
 1853|  3.98k|    } else {
 1854|  1.38M|      while ((p != pend) && is_integer(*p)) {
  ------------------
  |  Branch (1854:14): [True: 1.38M, False: 1.06k]
  |  Branch (1854:29): [True: 1.37M, False: 2.91k]
  ------------------
 1855|  1.37M|        uint8_t exp_digit = uint8_t(*p - UC('0'));
 1856|  1.37M|        if (exp_number < 0x10000000) {
  ------------------
  |  Branch (1856:13): [True: 310k, False: 1.06M]
  ------------------
 1857|   310k|          exp_number = 10 * exp_number + exp_digit;
 1858|   310k|        }
 1859|  1.37M|        ++p;
 1860|  1.37M|      }
 1861|  3.98k|      if (neg_exp) {
  ------------------
  |  Branch (1861:11): [True: 1.08k, False: 2.90k]
  ------------------
 1862|  1.08k|        exp_number = -exp_number;
 1863|  1.08k|      }
 1864|  3.98k|      exponent += exp_number;
 1865|  3.98k|    }
 1866|  1.41M|  } else {
 1867|       |    // If it scientific and not fixed, we have to bail out.
 1868|  1.41M|    if (uint64_t(fmt & chars_format::scientific) &&
  ------------------
  |  Branch (1868:9): [True: 1.04M, False: 373k]
  ------------------
 1869|  1.04M|        !uint64_t(fmt & chars_format::fixed)) {
  ------------------
  |  Branch (1869:9): [True: 0, False: 1.04M]
  ------------------
 1870|      0|      return report_parse_error<UC>(p, parse_error::missing_exponential_part);
 1871|      0|    }
 1872|  1.41M|  }
 1873|  1.42M|  answer.lastmatch = p;
 1874|  1.42M|  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|  1.42M|  if (digit_count > 19) { // this is uncommon
  ------------------
  |  Branch (1881:7): [True: 436k, False: 988k]
  ------------------
 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|   436k|    UC const *start = start_digits;
 1887|  12.1M|    while ((start != pend) && (*start == UC('0') || *start == decimal_point)) {
  ------------------
  |  Branch (1887:12): [True: 12.1M, False: 1.30k]
  |  Branch (1887:32): [True: 11.7M, False: 442k]
  |  Branch (1887:53): [True: 7.95k, False: 434k]
  ------------------
 1888|  11.7M|      if (*start == UC('0')) {
  ------------------
  |  Branch (1888:11): [True: 11.7M, False: 7.95k]
  ------------------
 1889|  11.7M|        digit_count--;
 1890|  11.7M|      }
 1891|  11.7M|      start++;
 1892|  11.7M|    }
 1893|       |
 1894|   436k|    if (digit_count > 19) {
  ------------------
  |  Branch (1894:9): [True: 411k, False: 25.1k]
  ------------------
 1895|   411k|      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|   411k|      i = 0;
 1900|   411k|      p = answer.integer.ptr;
 1901|   411k|      UC const *int_end = p + answer.integer.len();
 1902|   411k|      uint64_t const minimal_nineteen_digit_integer{1000000000000000000};
 1903|  18.5M|      while ((i < minimal_nineteen_digit_integer) && (p != int_end)) {
  ------------------
  |  Branch (1903:14): [True: 18.1M, False: 405k]
  |  Branch (1903:54): [True: 18.1M, False: 5.45k]
  ------------------
 1904|  18.1M|        i = i * 10 + uint64_t(*p - UC('0'));
 1905|  18.1M|        ++p;
 1906|  18.1M|      }
 1907|   411k|      if (i >= minimal_nineteen_digit_integer) { // We have a big integers
  ------------------
  |  Branch (1907:11): [True: 405k, False: 5.45k]
  ------------------
 1908|   405k|        exponent = end_of_integer_part - p + exp_number;
 1909|   405k|      } else { // We have a value with a fractional component.
 1910|  5.45k|        p = answer.fraction.ptr;
 1911|  5.45k|        UC const *frac_end = p + answer.fraction.len();
 1912|   294k|        while ((i < minimal_nineteen_digit_integer) && (p != frac_end)) {
  ------------------
  |  Branch (1912:16): [True: 289k, False: 5.45k]
  |  Branch (1912:56): [True: 289k, False: 0]
  ------------------
 1913|   289k|          i = i * 10 + uint64_t(*p - UC('0'));
 1914|   289k|          ++p;
 1915|   289k|        }
 1916|  5.45k|        exponent = answer.fraction.ptr - p + exp_number;
 1917|  5.45k|      }
 1918|       |      // We have now corrected both exponent and i, to a truncated value
 1919|   411k|    }
 1920|   436k|  }
 1921|  1.42M|  answer.exponent = exponent;
 1922|  1.42M|  answer.mantissa = i;
 1923|  1.42M|  return answer;
 1924|  1.42M|}
_ZN3glz10fast_float6detail12parse_infnanIdcEENS0_19from_chars_result_tIT0_EEPKS4_S7_RT_NS0_12chars_formatE:
 4076|   375k|                                       T &value, chars_format fmt) noexcept {
 4077|   375k|  from_chars_result_t<UC> answer{};
 4078|   375k|  answer.ptr = first;
 4079|   375k|  answer.ec = std::errc(); // be optimistic
 4080|       |  // assume first < last, so dereference without checks;
 4081|   375k|  bool const minusSign = (*first == UC('-'));
 4082|       |  // C++17 20.19.3.(7.1) explicitly forbids '+' sign here
 4083|   375k|  if ((*first == UC('-')) ||
  ------------------
  |  Branch (4083:7): [True: 5.71k, False: 370k]
  ------------------
 4084|   370k|      (uint64_t(fmt & chars_format::allow_leading_plus) &&
  ------------------
  |  Branch (4084:8): [True: 0, False: 370k]
  ------------------
 4085|  5.71k|       (*first == UC('+')))) {
  ------------------
  |  Branch (4085:8): [True: 0, False: 0]
  ------------------
 4086|  5.71k|    ++first;
 4087|  5.71k|  }
 4088|   375k|  if (last - first >= 3) {
  ------------------
  |  Branch (4088:7): [True: 269k, False: 106k]
  ------------------
 4089|   269k|    if (fastfloat_strncasecmp(first, str_const_nan<UC>(), 3)) {
  ------------------
  |  Branch (4089:9): [True: 30.9k, False: 238k]
  ------------------
 4090|  30.9k|      answer.ptr = (first += 3);
 4091|  30.9k|      value = minusSign ? -std::numeric_limits<T>::quiet_NaN()
  ------------------
  |  Branch (4091:15): [True: 284, False: 30.6k]
  ------------------
 4092|  30.9k|                        : 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|  30.9k|      if (first != last && *first == UC('(')) {
  ------------------
  |  Branch (4095:11): [True: 30.6k, False: 234]
  |  Branch (4095:28): [True: 20.3k, False: 10.3k]
  ------------------
 4096|   168k|        for (UC const *ptr = first + 1; ptr != last; ++ptr) {
  ------------------
  |  Branch (4096:41): [True: 166k, False: 1.77k]
  ------------------
 4097|   166k|          if (*ptr == UC(')')) {
  ------------------
  |  Branch (4097:15): [True: 462, False: 166k]
  ------------------
 4098|    462|            answer.ptr = ptr + 1; // valid nan(n-char-seq-opt)
 4099|    462|            break;
 4100|   166k|          } else if (!((UC('a') <= *ptr && *ptr <= UC('z')) ||
  ------------------
  |  Branch (4100:25): [True: 17.5k, False: 148k]
  |  Branch (4100:44): [True: 17.2k, False: 286]
  ------------------
 4101|   149k|                       (UC('A') <= *ptr && *ptr <= UC('Z')) ||
  ------------------
  |  Branch (4101:25): [True: 78.3k, False: 70.6k]
  |  Branch (4101:44): [True: 78.0k, False: 302]
  ------------------
 4102|  70.9k|                       (UC('0') <= *ptr && *ptr <= UC('9')) || *ptr == UC('_')))
  ------------------
  |  Branch (4102:25): [True: 53.3k, False: 17.5k]
  |  Branch (4102:44): [True: 52.8k, False: 496]
  |  Branch (4102:64): [True: 0, False: 18.0k]
  ------------------
 4103|  18.0k|            break; // forbidden char, not nan(n-char-seq-opt)
 4104|   166k|        }
 4105|  20.3k|      }
 4106|  30.9k|      return answer;
 4107|  30.9k|    }
 4108|   238k|    if (fastfloat_strncasecmp(first, str_const_inf<UC>(), 3)) {
  ------------------
  |  Branch (4108:9): [True: 870, False: 237k]
  ------------------
 4109|    870|      if ((last - first >= 8) &&
  ------------------
  |  Branch (4109:11): [True: 516, False: 354]
  ------------------
 4110|    516|          fastfloat_strncasecmp(first + 3, str_const_inf<UC>() + 3, 5)) {
  ------------------
  |  Branch (4110:11): [True: 70, False: 446]
  ------------------
 4111|     70|        answer.ptr = first + 8;
 4112|    800|      } else {
 4113|    800|        answer.ptr = first + 3;
 4114|    800|      }
 4115|    870|      value = minusSign ? -std::numeric_limits<T>::infinity()
  ------------------
  |  Branch (4115:15): [True: 252, False: 618]
  ------------------
 4116|    870|                        : std::numeric_limits<T>::infinity();
 4117|    870|      return answer;
 4118|    870|    }
 4119|   238k|  }
 4120|   344k|  answer.ec = std::errc::invalid_argument;
 4121|   344k|  return answer;
 4122|   375k|}
_ZN3glz10fast_float21fastfloat_strncasecmpIcEEbPKT_S4_m:
  417|   508k|                      size_t length) {
  418|   791k|  for (size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (418:22): [True: 759k, False: 31.8k]
  ------------------
  419|   759k|    UC const actual = actual_mixedcase[i];
  420|   759k|    if ((actual < 256 ? actual | 32 : actual) != expected_lowercase[i]) {
  ------------------
  |  Branch (420:9): [True: 476k, False: 283k]
  |  Branch (420:10): [True: 759k, False: 0]
  ------------------
  421|   476k|      return false;
  422|   476k|    }
  423|   759k|  }
  424|  31.8k|  return true;
  425|   508k|}
_ZN3glz10fast_float13str_const_nanIcEEPKT_v:
 1186|   269k|template <> constexpr char const *str_const_nan<char>() { return "nan"; }
_ZN3glz10fast_float13str_const_infIcEEPKT_v:
 1206|   239k|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|  1.05M|from_chars_advanced(parsed_number_string_t<UC> &pns, T &value) noexcept {
 4250|       |
 4251|  1.05M|  static_assert(is_supported_float_type<T>::value,
 4252|  1.05M|                "only some floating-point types are supported");
 4253|  1.05M|  static_assert(is_supported_char_type<UC>::value,
 4254|  1.05M|                "only char, wchar_t, char16_t and char32_t are supported");
 4255|       |
 4256|  1.05M|  from_chars_result_t<UC> answer;
 4257|       |
 4258|  1.05M|  answer.ec = std::errc(); // be optimistic
 4259|  1.05M|  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|  1.05M|  if (binary_format<T>::min_exponent_fast_path() <= pns.exponent &&
  ------------------
  |  Branch (4265:7): [True: 1.04M, False: 5.18k]
  ------------------
 4266|  1.04M|      pns.exponent <= binary_format<T>::max_exponent_fast_path() &&
  ------------------
  |  Branch (4266:7): [True: 1.04M, False: 4.29k]
  ------------------
 4267|  1.04M|      !pns.too_many_digits) {
  ------------------
  |  Branch (4267:7): [True: 636k, False: 405k]
  ------------------
 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|   636k|    if (!cpp20_and_in_constexpr() && detail::rounds_to_nearest()) {
  ------------------
  |  Branch (4275:9): [True: 636k, Folded]
  |  Branch (4275:38): [True: 636k, False: 0]
  ------------------
 4276|       |      // We have that fegetround() == FE_TONEAREST.
 4277|       |      // Next is Clinger's fast path.
 4278|   636k|      if (pns.mantissa <= binary_format<T>::max_mantissa_fast_path()) {
  ------------------
  |  Branch (4278:11): [True: 622k, False: 13.8k]
  ------------------
 4279|   622k|        value = T(pns.mantissa);
 4280|   622k|        if (pns.exponent < 0) {
  ------------------
  |  Branch (4280:13): [True: 13.2k, False: 609k]
  ------------------
 4281|  13.2k|          value = value / binary_format<T>::exact_power_of_ten(-pns.exponent);
 4282|   609k|        } else {
 4283|   609k|          value = value * binary_format<T>::exact_power_of_ten(pns.exponent);
 4284|   609k|        }
 4285|   622k|        if (pns.negative) {
  ------------------
  |  Branch (4285:13): [True: 32.9k, False: 589k]
  ------------------
 4286|  32.9k|          value = -value;
 4287|  32.9k|        }
 4288|   622k|        return answer;
 4289|   622k|      }
 4290|   636k|    } 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|   636k|  }
 4313|   428k|  adjusted_mantissa am =
 4314|   428k|      compute_float<binary_format<T>>(pns.exponent, pns.mantissa);
 4315|   428k|  if (pns.too_many_digits && am.power2 >= 0) {
  ------------------
  |  Branch (4315:7): [True: 411k, False: 17.2k]
  |  Branch (4315:30): [True: 411k, False: 0]
  ------------------
 4316|   411k|    if (am != compute_float<binary_format<T>>(pns.exponent, pns.mantissa + 1)) {
  ------------------
  |  Branch (4316:9): [True: 7.99k, False: 403k]
  ------------------
 4317|  7.99k|      am = compute_error<binary_format<T>>(pns.exponent, pns.mantissa);
 4318|  7.99k|    }
 4319|   411k|  }
 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|   428k|  if (am.power2 < 0) {
  ------------------
  |  Branch (4323:7): [True: 7.99k, False: 420k]
  ------------------
 4324|  7.99k|    am = digit_comp<T>(pns, am);
 4325|  7.99k|  }
 4326|   428k|  to_float(pns.negative, am, value);
 4327|       |  // Test for over/underflow.
 4328|   428k|  if ((pns.mantissa != 0 && am.mantissa == 0 && am.power2 == 0) ||
  ------------------
  |  Branch (4328:8): [True: 427k, False: 492]
  |  Branch (4328:29): [True: 4.08k, False: 423k]
  |  Branch (4328:49): [True: 464, False: 3.62k]
  ------------------
 4329|   427k|      am.power2 == binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (4329:7): [True: 1.83k, False: 426k]
  ------------------
 4330|  2.30k|    answer.ec = std::errc::result_out_of_range;
 4331|  2.30k|  }
 4332|   428k|  return answer;
 4333|  1.05M|}
_ZN3glz10fast_float13binary_formatIdE22min_exponent_fast_pathEv:
  695|  1.05M|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|  1.05M|  return -22;
  700|  1.05M|#endif
  701|  1.05M|}
_ZN3glz10fast_float13binary_formatIdE22max_exponent_fast_pathEv:
  767|  1.04M|inline constexpr int binary_format<double>::max_exponent_fast_path() {
  768|  1.04M|  return 22;
  769|  1.04M|}
_ZN3glz10fast_float6detail17rounds_to_nearestEv:
 4129|   636k|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|   636k|  static float volatile fmin = (std::numeric_limits<float>::min)();
 4151|   636k|  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|   636k|#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|   636k|  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|   636k|}
_ZN3glz10fast_float13binary_formatIdE22max_mantissa_fast_pathEv:
  777|   636k|inline constexpr uint64_t binary_format<double>::max_mantissa_fast_path() {
  778|   636k|  return uint64_t(2) << mantissa_explicit_bits();
  779|   636k|}
_ZN3glz10fast_float13binary_formatIdE22mantissa_explicit_bitsEv:
  713|  3.63M|inline constexpr int binary_format<double>::mantissa_explicit_bits() {
  714|  3.63M|  return 52;
  715|  3.63M|}
_ZN3glz10fast_float13binary_formatIdE18exact_power_of_tenEl:
 1057|   622k|binary_format<double>::exact_power_of_ten(int64_t power) {
 1058|       |  // Work around clang bug https://godbolt.org/z/zedh7rrhc
 1059|   622k|  return (void)powers_of_ten[0], powers_of_ten[power];
 1060|   622k|}
_ZN3glz10fast_float13compute_floatINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElm:
 2852|   839k|compute_float(int64_t q, uint64_t w) noexcept {
 2853|   839k|  adjusted_mantissa answer;
 2854|   839k|  if ((w == 0) || (q < binary::smallest_power_of_ten())) {
  ------------------
  |  Branch (2854:7): [True: 492, False: 839k]
  |  Branch (2854:19): [True: 534, False: 838k]
  ------------------
 2855|  1.02k|    answer.power2 = 0;
 2856|  1.02k|    answer.mantissa = 0;
 2857|       |    // result should be zero
 2858|  1.02k|    return answer;
 2859|  1.02k|  }
 2860|   838k|  if (q > binary::largest_power_of_ten()) {
  ------------------
  |  Branch (2860:7): [True: 2.40k, False: 836k]
  ------------------
 2861|       |    // we want to get infinity:
 2862|  2.40k|    answer.power2 = binary::infinite_power();
 2863|  2.40k|    answer.mantissa = 0;
 2864|  2.40k|    return answer;
 2865|  2.40k|  }
 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|   836k|  int lz = leading_zeroes(w);
 2871|   836k|  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|   836k|  value128 product =
 2880|   836k|      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|   836k|  int upperbit = int(product.high >> 63);
 2891|   836k|  int shift = upperbit + 64 - binary::mantissa_explicit_bits() - 3;
 2892|       |
 2893|   836k|  answer.mantissa = product.high >> shift;
 2894|       |
 2895|   836k|  answer.power2 = int32_t(detail::power(int32_t(q)) + upperbit - lz -
 2896|   836k|                          binary::minimum_exponent());
 2897|   836k|  if (answer.power2 <= 0) { // we have a subnormal?
  ------------------
  |  Branch (2897:7): [True: 1.30k, False: 834k]
  ------------------
 2898|       |    // Here have that answer.power2 <= 0 so -answer.power2 >= 0
 2899|  1.30k|    if (-answer.power2 + 1 >=
  ------------------
  |  Branch (2899:9): [True: 62, False: 1.24k]
  ------------------
 2900|  1.30k|        64) { // if we have more than 64 bits below the minimum exponent, you
 2901|       |              // have a zero for sure.
 2902|     62|      answer.power2 = 0;
 2903|     62|      answer.mantissa = 0;
 2904|       |      // result should be zero
 2905|     62|      return answer;
 2906|     62|    }
 2907|       |    // next line is safe because -answer.power2 + 1 < 64
 2908|  1.24k|    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|  1.24k|    answer.mantissa += (answer.mantissa & 1); // round up
 2913|  1.24k|    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|  1.24k|    answer.power2 =
 2922|  1.24k|        (answer.mantissa < (uint64_t(1) << binary::mantissa_explicit_bits()))
  ------------------
  |  Branch (2922:9): [True: 1.24k, False: 0]
  ------------------
 2923|  1.24k|            ? 0
 2924|  1.24k|            : 1;
 2925|  1.24k|    return answer;
 2926|  1.30k|  }
 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|   834k|  if ((product.low <= 1) && (q >= binary::min_exponent_round_to_even()) &&
  ------------------
  |  Branch (2931:7): [True: 313k, False: 521k]
  |  Branch (2931:29): [True: 312k, False: 612]
  ------------------
 2932|   312k|      (q <= binary::max_exponent_round_to_even()) &&
  ------------------
  |  Branch (2932:7): [True: 312k, False: 98]
  ------------------
 2933|   312k|      ((answer.mantissa & 3) == 1)) { // we may fall between two floats!
  ------------------
  |  Branch (2933:7): [True: 269k, False: 43.4k]
  ------------------
 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|   269k|    if ((answer.mantissa << shift) == product.high) {
  ------------------
  |  Branch (2939:9): [True: 3.20k, False: 265k]
  ------------------
 2940|  3.20k|      answer.mantissa &= ~uint64_t(1); // flip it so that we do not round up
 2941|  3.20k|    }
 2942|   269k|  }
 2943|       |
 2944|   834k|  answer.mantissa += (answer.mantissa & 1); // round up
 2945|   834k|  answer.mantissa >>= 1;
 2946|   834k|  if (answer.mantissa >= (uint64_t(2) << binary::mantissa_explicit_bits())) {
  ------------------
  |  Branch (2946:7): [True: 848, False: 833k]
  ------------------
 2947|    848|    answer.mantissa = (uint64_t(1) << binary::mantissa_explicit_bits());
 2948|    848|    answer.power2++; // undo previous addition
 2949|    848|  }
 2950|       |
 2951|   834k|  answer.mantissa &= ~(uint64_t(1) << binary::mantissa_explicit_bits());
 2952|   834k|  if (answer.power2 >= binary::infinite_power()) { // infinity
  ------------------
  |  Branch (2952:7): [True: 60, False: 834k]
  ------------------
 2953|     60|    answer.power2 = binary::infinite_power();
 2954|     60|    answer.mantissa = 0;
 2955|     60|  }
 2956|   834k|  return answer;
 2957|   836k|}
_ZN3glz10fast_float17adjusted_mantissaC2Ev:
  568|   855k|  adjusted_mantissa() = default;
_ZN3glz10fast_float13binary_formatIdE21smallest_power_of_tenEv:
 1077|   839k|inline constexpr int binary_format<double>::smallest_power_of_ten() {
 1078|   839k|  return -342;
 1079|   839k|}
_ZN3glz10fast_float13binary_formatIdE20largest_power_of_tenEv:
 1068|   838k|template <> inline constexpr int binary_format<double>::largest_power_of_ten() {
 1069|   838k|  return 308;
 1070|   838k|}
_ZN3glz10fast_float14leading_zeroesEm:
  488|   851k|leading_zeroes(uint64_t input_num) {
  489|   851k|  assert(input_num > 0);
  ------------------
  |  Branch (489:3): [True: 851k, False: 0]
  ------------------
  490|   851k|  if (cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (490:7): [Folded, False: 851k]
  ------------------
  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|   851k|  return __builtin_clzll(input_num);
  505|   851k|#endif
  506|   851k|}
_ZN3glz10fast_float29compute_product_approximationILi55EEENS0_8value128Elm:
 2771|   844k|compute_product_approximation(int64_t q, uint64_t w) {
 2772|   844k|  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|   844k|  value128 firstproduct =
 2777|   844k|      full_multiplication(w, powers::power_of_five_128[index]);
 2778|   844k|  static_assert((bit_precision >= 0) && (bit_precision <= 64),
 2779|   844k|                " precision should  be in (0,64]");
 2780|   844k|  constexpr uint64_t precision_mask =
 2781|   844k|      (bit_precision < 64) ? (uint64_t(0xFFFFFFFFFFFFFFFF) >> bit_precision)
  ------------------
  |  Branch (2781:7): [True: 0, Folded]
  ------------------
 2782|   844k|                           : uint64_t(0xFFFFFFFFFFFFFFFF);
 2783|   844k|  if ((firstproduct.high & precision_mask) ==
  ------------------
  |  Branch (2783:7): [True: 5.05k, False: 839k]
  ------------------
 2784|   844k|      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|  5.05k|    value128 secondproduct =
 2789|  5.05k|        full_multiplication(w, powers::power_of_five_128[index + 1]);
 2790|  5.05k|    firstproduct.low += secondproduct.high;
 2791|  5.05k|    if (secondproduct.high > firstproduct.low) {
  ------------------
  |  Branch (2791:9): [True: 1.36k, False: 3.69k]
  ------------------
 2792|  1.36k|      firstproduct.high++;
 2793|  1.36k|    }
 2794|  5.05k|  }
 2795|   844k|  return firstproduct;
 2796|   844k|}
_ZN3glz10fast_float19full_multiplicationEmm:
  540|   849k|full_multiplication(uint64_t a, uint64_t b) {
  541|   849k|  if (cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (541:7): [Folded, False: 849k]
  ------------------
  542|      0|    value128 answer;
  543|      0|    answer.low = umul128_generic(a, b, &answer.high);
  544|      0|    return answer;
  545|      0|  }
  546|   849k|  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|   849k|  answer.low = uint64_t(r);
  558|   849k|  answer.high = uint64_t(r >> 64);
  559|       |#else
  560|       |  answer.low = umul128_generic(a, b, &answer.high);
  561|       |#endif
  562|   849k|  return answer;
  563|   849k|}
_ZN3glz10fast_float8value128C2Ev:
  454|   849k|  constexpr value128() : low(0), high(0) {}
_ZN3glz10fast_float6detail5powerEi:
 2814|   844k|constexpr fastfloat_really_inline int32_t power(int32_t q) noexcept {
 2815|   844k|  return (((152170 + 65536) * q) >> 16) + 63;
 2816|   844k|}
_ZN3glz10fast_float13binary_formatIdE16minimum_exponentEv:
  742|   852k|template <> inline constexpr int binary_format<double>::minimum_exponent() {
  743|   852k|  return -1023;
  744|   852k|}
_ZN3glz10fast_float13binary_formatIdE26min_exponent_round_to_evenEv:
  733|   313k|inline constexpr int binary_format<double>::min_exponent_round_to_even() {
  734|   313k|  return -4;
  735|   313k|}
_ZN3glz10fast_float13binary_formatIdE26max_exponent_round_to_evenEv:
  723|   312k|inline constexpr int binary_format<double>::max_exponent_round_to_even() {
  724|   312k|  return 23;
  725|   312k|}
_ZNK3glz10fast_float17adjusted_mantissaneERKS1_:
  574|   411k|  constexpr bool operator!=(adjusted_mantissa const &o) const {
  575|   411k|    return mantissa != o.mantissa || power2 != o.power2;
  ------------------
  |  Branch (575:12): [True: 7.99k, False: 403k]
  |  Branch (575:38): [True: 0, False: 403k]
  ------------------
  576|   411k|  }
_ZN3glz10fast_float13compute_errorINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElm:
 2837|  7.99k|compute_error(int64_t q, uint64_t w) noexcept {
 2838|  7.99k|  int lz = leading_zeroes(w);
 2839|  7.99k|  w <<= lz;
 2840|  7.99k|  value128 product =
 2841|  7.99k|      compute_product_approximation<binary::mantissa_explicit_bits() + 3>(q, w);
 2842|  7.99k|  return compute_error_scaled<binary>(q, product.high, lz);
 2843|  7.99k|}
_ZN3glz10fast_float20compute_error_scaledINS0_13binary_formatIdEEEENS0_17adjusted_mantissaElmi:
 2823|  7.99k|compute_error_scaled(int64_t q, uint64_t w, int lz) noexcept {
 2824|  7.99k|  int hilz = int(w >> 63) ^ 1;
 2825|  7.99k|  adjusted_mantissa answer;
 2826|  7.99k|  answer.mantissa = w << hilz;
 2827|  7.99k|  int bias = binary::mantissa_explicit_bits() - binary::minimum_exponent();
 2828|  7.99k|  answer.power2 = int32_t(detail::power(int32_t(q)) + bias - hilz - lz - 62 +
 2829|  7.99k|                          invalid_am_bias);
 2830|  7.99k|  return answer;
 2831|  7.99k|}
_ZN3glz10fast_float10digit_compIdcEENS0_17adjusted_mantissaERNS0_22parsed_number_string_tIT0_EES2_:
 4034|  7.99k|digit_comp(parsed_number_string_t<UC> &num, adjusted_mantissa am) noexcept {
 4035|       |  // remove the invalid exponent bias
 4036|  7.99k|  am.power2 -= invalid_am_bias;
 4037|       |
 4038|  7.99k|  int32_t sci_exp = scientific_exponent(num);
 4039|  7.99k|  size_t max_digits = binary_format<T>::max_digits();
 4040|  7.99k|  size_t digits = 0;
 4041|  7.99k|  bigint bigmant;
 4042|  7.99k|  parse_mantissa(bigmant, num, max_digits, digits);
 4043|       |  // can't underflow, since digits is at most max_digits.
 4044|  7.99k|  int32_t exponent = sci_exp + 1 - int32_t(digits);
 4045|  7.99k|  if (exponent >= 0) {
  ------------------
  |  Branch (4045:7): [True: 3.65k, False: 4.33k]
  ------------------
 4046|  3.65k|    return positive_digit_comp<T>(bigmant, exponent);
 4047|  4.33k|  } else {
 4048|  4.33k|    return negative_digit_comp<T>(bigmant, am, exponent);
 4049|  4.33k|  }
 4050|  7.99k|}
_ZN3glz10fast_float19scientific_exponentIcEEiRNS0_22parsed_number_string_tIT_EE:
 3640|  7.99k|scientific_exponent(parsed_number_string_t<UC> &num) noexcept {
 3641|  7.99k|  uint64_t mantissa = num.mantissa;
 3642|  7.99k|  int32_t exponent = int32_t(num.exponent);
 3643|  39.9k|  while (mantissa >= 10000) {
  ------------------
  |  Branch (3643:10): [True: 31.9k, False: 7.99k]
  ------------------
 3644|  31.9k|    mantissa /= 10000;
 3645|  31.9k|    exponent += 4;
 3646|  31.9k|  }
 3647|  15.9k|  while (mantissa >= 100) {
  ------------------
  |  Branch (3647:10): [True: 7.99k, False: 7.99k]
  ------------------
 3648|  7.99k|    mantissa /= 100;
 3649|  7.99k|    exponent += 2;
 3650|  7.99k|  }
 3651|  7.99k|  while (mantissa >= 10) {
  ------------------
  |  Branch (3651:10): [True: 0, False: 7.99k]
  ------------------
 3652|      0|    mantissa /= 10;
 3653|      0|    exponent += 1;
 3654|      0|  }
 3655|  7.99k|  return exponent;
 3656|  7.99k|}
_ZN3glz10fast_float13binary_formatIdE10max_digitsEv:
 1085|  7.99k|template <> inline constexpr size_t binary_format<double>::max_digits() {
 1086|  7.99k|  return 769;
 1087|  7.99k|}
_ZN3glz10fast_float6bigintC2Ev:
 3399|  7.99k|  GLZ_FASTFLOAT_CONSTEXPR20 bigint() : vec() {}
_ZN3glz10fast_float8stackvecILt62EEC2Ev:
 3006|  39.7k|  stackvec() = default;
_ZN3glz10fast_float14parse_mantissaIcEEvRNS0_6bigintERNS0_22parsed_number_string_tIT_EEmRm:
 3859|  7.99k|               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|  7.99k|  size_t counter = 0;
 3864|  7.99k|  digits = 0;
 3865|  7.99k|  limb value = 0;
 3866|  7.99k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3867|  7.99k|  size_t step = 19;
 3868|       |#else
 3869|       |  size_t step = 9;
 3870|       |#endif
 3871|       |
 3872|       |  // process all integer digits.
 3873|  7.99k|  UC const *p = num.integer.ptr;
 3874|  7.99k|  UC const *pend = p + num.integer.len();
 3875|  7.99k|  skip_zeros(p, pend);
 3876|       |  // process all digits, in increments of step per loop
 3877|  18.1k|  while (p != pend) {
  ------------------
  |  Branch (3877:10): [True: 10.1k, False: 7.99k]
  ------------------
 3878|  22.4k|    while ((std::distance(p, pend) >= 8) && (step - counter >= 8) &&
  ------------------
  |  Branch (3878:12): [True: 16.1k, False: 6.37k]
  |  Branch (3878:45): [True: 12.3k, False: 3.79k]
  ------------------
 3879|  12.3k|           (max_digits - digits >= 8)) {
  ------------------
  |  Branch (3879:12): [True: 12.3k, False: 0]
  ------------------
 3880|  12.3k|      parse_eight_digits(p, value, counter, digits);
 3881|  12.3k|    }
 3882|  42.8k|    while (counter < step && p != pend && digits < max_digits) {
  ------------------
  |  Branch (3882:12): [True: 37.7k, False: 5.12k]
  |  Branch (3882:30): [True: 32.7k, False: 5.04k]
  |  Branch (3882:43): [True: 32.7k, False: 0]
  ------------------
 3883|  32.7k|      parse_one_digit(p, value, counter, digits);
 3884|  32.7k|    }
 3885|  10.1k|    if (digits == max_digits) {
  ------------------
  |  Branch (3885:9): [True: 0, False: 10.1k]
  ------------------
 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|  10.1k|    } else {
 3897|  10.1k|      add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3898|  10.1k|      counter = 0;
 3899|  10.1k|      value = 0;
 3900|  10.1k|    }
 3901|  10.1k|  }
 3902|       |
 3903|       |  // add our fraction digits, if they're available.
 3904|  7.99k|  if (num.fraction.ptr != nullptr) {
  ------------------
  |  Branch (3904:7): [True: 4.45k, False: 3.53k]
  ------------------
 3905|  4.45k|    p = num.fraction.ptr;
 3906|  4.45k|    pend = p + num.fraction.len();
 3907|  4.45k|    if (digits == 0) {
  ------------------
  |  Branch (3907:9): [True: 2.94k, False: 1.51k]
  ------------------
 3908|  2.94k|      skip_zeros(p, pend);
 3909|  2.94k|    }
 3910|       |    // process all digits, in increments of step per loop
 3911|  56.8k|    while (p != pend) {
  ------------------
  |  Branch (3911:12): [True: 53.1k, False: 3.65k]
  ------------------
 3912|   154k|      while ((std::distance(p, pend) >= 8) && (step - counter >= 8) &&
  ------------------
  |  Branch (3912:14): [True: 150k, False: 4.58k]
  |  Branch (3912:47): [True: 101k, False: 48.1k]
  ------------------
 3913|   101k|             (max_digits - digits >= 8)) {
  ------------------
  |  Branch (3913:14): [True: 101k, False: 420]
  ------------------
 3914|   101k|        parse_eight_digits(p, value, counter, digits);
 3915|   101k|      }
 3916|   211k|      while (counter < step && p != pend && digits < max_digits) {
  ------------------
  |  Branch (3916:14): [True: 162k, False: 48.9k]
  |  Branch (3916:32): [True: 158k, False: 3.50k]
  |  Branch (3916:45): [True: 158k, False: 738]
  ------------------
 3917|   158k|        parse_one_digit(p, value, counter, digits);
 3918|   158k|      }
 3919|  53.1k|      if (digits == max_digits) {
  ------------------
  |  Branch (3919:11): [True: 800, False: 52.3k]
  ------------------
 3920|       |        // add the temporary value, then check if we've truncated any digits
 3921|    800|        add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3922|    800|        bool truncated = is_truncated(p, pend);
 3923|    800|        if (truncated) {
  ------------------
  |  Branch (3923:13): [True: 354, False: 446]
  ------------------
 3924|    354|          round_up_bigint(result, digits);
 3925|    354|        }
 3926|    800|        return;
 3927|  52.3k|      } else {
 3928|  52.3k|        add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3929|  52.3k|        counter = 0;
 3930|  52.3k|        value = 0;
 3931|  52.3k|      }
 3932|  53.1k|    }
 3933|  4.45k|  }
 3934|       |
 3935|  7.19k|  if (counter != 0) {
  ------------------
  |  Branch (3935:7): [True: 0, False: 7.19k]
  ------------------
 3936|      0|    add_native(result, limb(powers_of_ten_uint64[counter]), value);
 3937|      0|  }
 3938|  7.19k|}
_ZN3glz10fast_float10skip_zerosIcEEvRPKT_S4_:
 3773|  10.9k|skip_zeros(UC const *&first, UC const *last) noexcept {
 3774|  10.9k|  uint64_t val;
 3775|  32.1k|  while (!cpp20_and_in_constexpr() &&
  ------------------
  |  Branch (3775:10): [True: 32.1k, Folded]
  ------------------
 3776|  32.1k|         std::distance(first, last) >= int_cmp_len<UC>()) {
  ------------------
  |  Branch (3776:10): [True: 29.0k, False: 3.14k]
  ------------------
 3777|  29.0k|    ::memcpy(&val, first, sizeof(uint64_t));
 3778|  29.0k|    if (val != int_cmp_zeros<UC>()) {
  ------------------
  |  Branch (3778:9): [True: 7.78k, False: 21.2k]
  ------------------
 3779|  7.78k|      break;
 3780|  7.78k|    }
 3781|  21.2k|    first += int_cmp_len<UC>();
 3782|  21.2k|  }
 3783|  24.6k|  while (first != last) {
  ------------------
  |  Branch (3783:10): [True: 21.6k, False: 2.94k]
  ------------------
 3784|  21.6k|    if (*first != UC('0')) {
  ------------------
  |  Branch (3784:9): [True: 7.99k, False: 13.6k]
  ------------------
 3785|  7.99k|      break;
 3786|  7.99k|    }
 3787|  13.6k|    first++;
 3788|  13.6k|  }
 3789|  10.9k|}
_ZN3glz10fast_float11int_cmp_lenIcEEiv:
 1180|  58.3k|template <typename UC> constexpr int int_cmp_len() {
 1181|  58.3k|  return sizeof(uint64_t) / sizeof(UC);
 1182|  58.3k|}
_ZN3glz10fast_float13int_cmp_zerosIcEEmv:
 1170|  31.3k|template <typename UC> constexpr uint64_t int_cmp_zeros() {
 1171|  31.3k|  static_assert((sizeof(UC) == 1) || (sizeof(UC) == 2) || (sizeof(UC) == 4),
 1172|  31.3k|                "Unsupported character size");
 1173|  31.3k|  return (sizeof(UC) == 1) ? 0x3030303030303030
  ------------------
  |  Branch (1173:10): [True: 31.3k, Folded]
  ------------------
 1174|  31.3k|         : (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|  31.3k|}
_ZN3glz10fast_float18parse_eight_digitsIcEEvRPKT_RmS6_S6_:
 3824|   113k|                   size_t &count) noexcept {
 3825|   113k|  value = value * 100000000 + parse_eight_digits_unrolled(p);
 3826|   113k|  p += 8;
 3827|   113k|  counter += 8;
 3828|   113k|  count += 8;
 3829|   113k|}
_ZN3glz10fast_float27parse_eight_digits_unrolledIcEEjPKT_:
 1588|   113k|parse_eight_digits_unrolled(UC const *chars) noexcept {
 1589|   113k|  if (cpp20_and_in_constexpr() || !has_simd_opt<UC>()) {
  ------------------
  |  Branch (1589:7): [Folded, False: 0]
  |  Branch (1589:35): [True: 0, Folded]
  ------------------
 1590|   113k|    return parse_eight_digits_unrolled(read8_to_u64(chars)); // truncation okay
 1591|   113k|  }
 1592|      0|  return parse_eight_digits_unrolled(simd_read8_to_u64(chars));
 1593|   113k|}
_ZN3glz10fast_float15parse_one_digitIcEEvRPKT_RmS6_S6_:
 3834|   190k|                size_t &count) noexcept {
 3835|   190k|  value = value * 10 + limb(*p - UC('0'));
 3836|   190k|  p++;
 3837|   190k|  counter++;
 3838|   190k|  count++;
 3839|   190k|}
_ZN3glz10fast_float10add_nativeERNS0_6bigintEmm:
 3842|  63.7k|add_native(bigint &big, limb power, limb value) noexcept {
 3843|  63.7k|  big.mul(power);
 3844|  63.7k|  big.add(value);
 3845|  63.7k|}
_ZN3glz10fast_float6bigint3mulEm:
 3552|  63.7k|  GLZ_FASTFLOAT_CONSTEXPR20 bool mul(limb y) noexcept { return small_mul(vec, y); }
_ZN3glz10fast_float9small_mulILt62EEEbRNS0_8stackvecIXT_EEEm:
 3249|   107k|                                            limb y) noexcept {
 3250|   107k|  limb carry = 0;
 3251|  1.32M|  for (size_t index = 0; index < vec.len(); index++) {
  ------------------
  |  Branch (3251:26): [True: 1.22M, False: 107k]
  ------------------
 3252|  1.22M|    vec[index] = scalar_mul(vec[index], y, carry);
 3253|  1.22M|  }
 3254|   107k|  if (carry != 0) {
  ------------------
  |  Branch (3254:7): [True: 95.5k, False: 11.7k]
  ------------------
 3255|  95.5k|    GLZ_FASTFLOAT_TRY(vec.try_push(carry));
  ------------------
  |  |  354|  95.5k|  {                                                                            \
  |  |  355|  95.5k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 95.5k]
  |  |  ------------------
  |  |  356|  95.5k|      return false;                                                            \
  |  |  357|  95.5k|  }
  ------------------
 3256|  95.5k|  }
 3257|   107k|  return true;
 3258|   107k|}
_ZNK3glz10fast_float8stackvecILt62EE3lenEv:
 3039|  1.83M|  constexpr size_t len() const noexcept { return length; }
_ZN3glz10fast_float10scalar_mulEmmRm:
 3196|  1.22M|scalar_mul(limb x, limb y, limb &carry) noexcept {
 3197|  1.22M|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3198|  1.22M|#if defined(__SIZEOF_INT128__)
 3199|       |  // GCC and clang both define it as an extension.
 3200|  1.22M|  __uint128_t z = __uint128_t(x) * __uint128_t(y) + __uint128_t(carry);
 3201|  1.22M|  carry = limb(z >> limb_bits);
 3202|  1.22M|  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|  1.22M|}
_ZN3glz10fast_float8stackvecILt62EEixEm:
 3017|  3.23M|  GLZ_FASTFLOAT_CONSTEXPR14 limb &operator[](size_t index) noexcept {
 3018|  3.23M|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  3.23M|  { ((void)(x)); }
  ------------------
 3019|  3.23M|    return data[index];
 3020|  3.23M|  }
_ZN3glz10fast_float8stackvecILt62EE8try_pushEm:
 3052|   104k|  GLZ_FASTFLOAT_CONSTEXPR14 bool try_push(limb value) noexcept {
 3053|   104k|    if (len() < capacity()) {
  ------------------
  |  Branch (3053:9): [True: 104k, False: 0]
  ------------------
 3054|   104k|      push_unchecked(value);
 3055|   104k|      return true;
 3056|   104k|    } else {
 3057|      0|      return false;
 3058|      0|    }
 3059|   104k|  }
_ZNK3glz10fast_float8stackvecILt62EE8capacityEv:
 3043|   169k|  constexpr size_t capacity() const noexcept { return size; }
_ZN3glz10fast_float8stackvecILt62EE14push_uncheckedEm:
 3046|   109k|  GLZ_FASTFLOAT_CONSTEXPR14 void push_unchecked(limb value) noexcept {
 3047|   109k|    data[length] = value;
 3048|   109k|    length++;
 3049|   109k|  }
_ZN3glz10fast_float6bigint3addEm:
 3554|  63.7k|  GLZ_FASTFLOAT_CONSTEXPR20 bool add(limb y) noexcept { return small_add(vec, y); }
_ZN3glz10fast_float9small_addILt62EEEbRNS0_8stackvecIXT_EEEm:
 3242|  63.7k|small_add(stackvec<size> &vec, limb y) noexcept {
 3243|  63.7k|  return small_add_from(vec, y, 0);
 3244|  63.7k|}
_ZN3glz10fast_float14small_add_fromILt62EEEbRNS0_8stackvecIXT_EEEmm:
 3224|  63.7k|                                                 size_t start) noexcept {
 3225|  63.7k|  size_t index = start;
 3226|  63.7k|  limb carry = y;
 3227|  63.7k|  bool overflow;
 3228|   100k|  while (carry != 0 && index < vec.len()) {
  ------------------
  |  Branch (3228:10): [True: 44.9k, False: 55.6k]
  |  Branch (3228:24): [True: 36.9k, False: 8.04k]
  ------------------
 3229|  36.9k|    vec[index] = scalar_add(vec[index], carry, overflow);
 3230|  36.9k|    carry = limb(overflow);
 3231|  36.9k|    index += 1;
 3232|  36.9k|  }
 3233|  63.7k|  if (carry != 0) {
  ------------------
  |  Branch (3233:7): [True: 8.04k, False: 55.6k]
  ------------------
 3234|  8.04k|    GLZ_FASTFLOAT_TRY(vec.try_push(carry));
  ------------------
  |  |  354|  8.04k|  {                                                                            \
  |  |  355|  8.04k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 8.04k]
  |  |  ------------------
  |  |  356|  8.04k|      return false;                                                            \
  |  |  357|  8.04k|  }
  ------------------
 3235|  8.04k|  }
 3236|  63.7k|  return true;
 3237|  63.7k|}
_ZN3glz10fast_float10scalar_addEmmRb:
 3176|   497k|scalar_add(limb x, limb y, bool &overflow) noexcept {
 3177|   497k|  limb z;
 3178|       |// gcc and clang
 3179|   497k|#if defined(__has_builtin)
 3180|   497k|#if __has_builtin(__builtin_add_overflow)
 3181|   497k|  if (!cpp20_and_in_constexpr()) {
  ------------------
  |  Branch (3181:7): [True: 497k, Folded]
  ------------------
 3182|   497k|    overflow = __builtin_add_overflow(x, y, &z);
 3183|   497k|    return z;
 3184|   497k|  }
 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|   497k|}
_ZN3glz10fast_float12is_truncatedIcEEbPKT_S4_:
 3795|    800|is_truncated(UC const *first, UC const *last) noexcept {
 3796|       |  // do 8-bit optimizations, can just compare to 8 literal 0s.
 3797|    800|  uint64_t val;
 3798|  2.87k|  while (!cpp20_and_in_constexpr() &&
  ------------------
  |  Branch (3798:10): [True: 2.87k, Folded]
  ------------------
 3799|  2.87k|         std::distance(first, last) >= int_cmp_len<UC>()) {
  ------------------
  |  Branch (3799:10): [True: 2.34k, False: 530]
  ------------------
 3800|  2.34k|    ::memcpy(&val, first, sizeof(uint64_t));
 3801|  2.34k|    if (val != int_cmp_zeros<UC>()) {
  ------------------
  |  Branch (3801:9): [True: 270, False: 2.07k]
  ------------------
 3802|    270|      return true;
 3803|    270|    }
 3804|  2.07k|    first += int_cmp_len<UC>();
 3805|  2.07k|  }
 3806|  1.84k|  while (first != last) {
  ------------------
  |  Branch (3806:10): [True: 1.39k, False: 446]
  ------------------
 3807|  1.39k|    if (*first != UC('0')) {
  ------------------
  |  Branch (3807:9): [True: 84, False: 1.31k]
  ------------------
 3808|     84|      return true;
 3809|     84|    }
 3810|  1.31k|    ++first;
 3811|  1.31k|  }
 3812|    446|  return false;
 3813|    530|}
_ZN3glz10fast_float15round_up_bigintERNS0_6bigintERm:
 3848|    354|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|    354|  add_native(big, 10, 1);
 3852|    354|  count++;
 3853|    354|}
_ZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEi:
 3942|  3.65k|positive_digit_comp(bigint &bigmant, int32_t exponent) noexcept {
 3943|  3.65k|  GLZ_FASTFLOAT_ASSERT(bigmant.pow10(uint32_t(exponent)));
  ------------------
  |  |  344|  3.65k|  { ((void)(x)); }
  ------------------
 3944|  3.65k|  adjusted_mantissa answer;
 3945|  3.65k|  bool truncated;
 3946|  3.65k|  answer.mantissa = bigmant.hi64(truncated);
 3947|  3.65k|  int bias = binary_format<T>::mantissa_explicit_bits() -
 3948|  3.65k|             binary_format<T>::minimum_exponent();
 3949|  3.65k|  answer.power2 = bigmant.bit_length() - 64 + bias;
 3950|       |
 3951|  3.65k|  round<T>(answer, [truncated](adjusted_mantissa &a, int32_t shift) {
 3952|  3.65k|    round_nearest_tie_even(
 3953|  3.65k|        a, shift,
 3954|  3.65k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  3.65k|          return is_above || (is_halfway && truncated) ||
 3956|  3.65k|                 (is_odd && is_halfway);
 3957|  3.65k|        });
 3958|  3.65k|  });
 3959|       |
 3960|  3.65k|  return answer;
 3961|  3.65k|}
_ZN3glz10fast_float6bigint5pow10Ej:
 3591|  3.65k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow10(uint32_t exp) noexcept {
 3592|  3.65k|    GLZ_FASTFLOAT_TRY(pow5(exp));
  ------------------
  |  |  354|  3.65k|  {                                                                            \
  |  |  355|  3.65k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 3.65k]
  |  |  ------------------
  |  |  356|  3.65k|      return false;                                                            \
  |  |  357|  3.65k|  }
  ------------------
 3593|  3.65k|    return pow2(exp);
 3594|  3.65k|  }
_ZN3glz10fast_float6bigint4pow5Ej:
 3560|  7.99k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow5(uint32_t exp) noexcept {
 3561|       |    // multiply by a power of 5
 3562|  7.99k|    size_t large_length = sizeof(large_power_of_5) / sizeof(limb);
 3563|  7.99k|    limb_span large = limb_span(large_power_of_5, large_length);
 3564|  14.8k|    while (exp >= large_step) {
  ------------------
  |  Branch (3564:12): [True: 6.86k, False: 7.99k]
  ------------------
 3565|  6.86k|      GLZ_FASTFLOAT_TRY(large_mul(vec, large));
  ------------------
  |  |  354|  6.86k|  {                                                                            \
  |  |  355|  6.86k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 6.86k]
  |  |  ------------------
  |  |  356|  6.86k|      return false;                                                            \
  |  |  357|  6.86k|  }
  ------------------
 3566|  6.86k|      exp -= large_step;
 3567|  6.86k|    }
 3568|  7.99k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3569|  7.99k|    uint32_t small_step = 27;
 3570|  7.99k|    limb max_native = 7450580596923828125UL;
 3571|       |#else
 3572|       |    uint32_t small_step = 13;
 3573|       |    limb max_native = 1220703125U;
 3574|       |#endif
 3575|  13.1k|    while (exp >= small_step) {
  ------------------
  |  Branch (3575:12): [True: 5.12k, False: 7.99k]
  ------------------
 3576|  5.12k|      GLZ_FASTFLOAT_TRY(small_mul(vec, max_native));
  ------------------
  |  |  354|  5.12k|  {                                                                            \
  |  |  355|  5.12k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 5.12k]
  |  |  ------------------
  |  |  356|  5.12k|      return false;                                                            \
  |  |  357|  5.12k|  }
  ------------------
 3577|  5.12k|      exp -= small_step;
 3578|  5.12k|    }
 3579|  7.99k|    if (exp != 0) {
  ------------------
  |  Branch (3579:9): [True: 4.17k, False: 3.81k]
  ------------------
 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|  4.17k|      GLZ_FASTFLOAT_TRY(small_mul(
  ------------------
  |  |  354|  4.17k|  {                                                                            \
  |  |  355|  4.17k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 4.17k]
  |  |  ------------------
  |  |  356|  4.17k|      return false;                                                            \
  |  |  357|  4.17k|  }
  ------------------
 3584|  4.17k|          vec, limb(((void)small_power_of_5[0], small_power_of_5[exp]))));
 3585|  4.17k|    }
 3586|       |
 3587|  7.99k|    return true;
 3588|  7.99k|  }
_ZN3glz10fast_float4spanImEC2EPKmm:
  436|  49.1k|  constexpr span(T const *_ptr, size_t _length) : ptr(_ptr), length(_length) {}
_ZN3glz10fast_float9large_mulILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEE:
 3329|  6.86k|GLZ_FASTFLOAT_CONSTEXPR20 bool large_mul(stackvec<size> &x, limb_span y) noexcept {
 3330|  6.86k|  if (y.len() == 1) {
  ------------------
  |  Branch (3330:7): [True: 0, False: 6.86k]
  ------------------
 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|  6.86k|  } else {
 3333|  6.86k|    GLZ_FASTFLOAT_TRY(long_mul(x, y));
  ------------------
  |  |  354|  6.86k|  {                                                                            \
  |  |  355|  6.86k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 6.86k]
  |  |  ------------------
  |  |  356|  6.86k|      return false;                                                            \
  |  |  357|  6.86k|  }
  ------------------
 3334|  6.86k|  }
 3335|  6.86k|  return true;
 3336|  6.86k|}
_ZNK3glz10fast_float4spanImE3lenEv:
  440|   551k|  constexpr size_t len() const noexcept { return length; }
_ZNK3glz10fast_float4spanImEixEm:
  442|   351k|  GLZ_FASTFLOAT_CONSTEXPR14 const T &operator[](size_t index) const noexcept {
  443|   351k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|   351k|  { ((void)(x)); }
  ------------------
  444|   351k|    return ptr[index];
  445|   351k|  }
_ZN3glz10fast_float8long_mulILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEE:
 3301|  6.86k|GLZ_FASTFLOAT_CONSTEXPR20 bool long_mul(stackvec<size> &x, limb_span y) noexcept {
 3302|  6.86k|  limb_span xs = limb_span(x.data, x.len());
 3303|  6.86k|  stackvec<size> z(xs);
 3304|  6.86k|  limb_span zs = limb_span(z.data, z.len());
 3305|       |
 3306|  6.86k|  if (y.len() != 0) {
  ------------------
  |  Branch (3306:7): [True: 6.86k, False: 0]
  ------------------
 3307|  6.86k|    limb y0 = y[0];
 3308|  6.86k|    GLZ_FASTFLOAT_TRY(small_mul(x, y0));
  ------------------
  |  |  354|  6.86k|  {                                                                            \
  |  |  355|  6.86k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 6.86k]
  |  |  ------------------
  |  |  356|  6.86k|      return false;                                                            \
  |  |  357|  6.86k|  }
  ------------------
 3309|  34.3k|    for (size_t index = 1; index < y.len(); index++) {
  ------------------
  |  Branch (3309:28): [True: 27.4k, False: 6.86k]
  ------------------
 3310|  27.4k|      limb yi = y[index];
 3311|  27.4k|      stackvec<size> zi;
 3312|  27.4k|      if (yi != 0) {
  ------------------
  |  Branch (3312:11): [True: 27.4k, False: 0]
  ------------------
 3313|       |        // re-use the same buffer throughout
 3314|  27.4k|        zi.set_len(0);
 3315|  27.4k|        GLZ_FASTFLOAT_TRY(zi.try_extend(zs));
  ------------------
  |  |  354|  27.4k|  {                                                                            \
  |  |  355|  27.4k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 27.4k]
  |  |  ------------------
  |  |  356|  27.4k|      return false;                                                            \
  |  |  357|  27.4k|  }
  ------------------
 3316|  27.4k|        GLZ_FASTFLOAT_TRY(small_mul(zi, yi));
  ------------------
  |  |  354|  27.4k|  {                                                                            \
  |  |  355|  27.4k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 27.4k]
  |  |  ------------------
  |  |  356|  27.4k|      return false;                                                            \
  |  |  357|  27.4k|  }
  ------------------
 3317|  27.4k|        limb_span zis = limb_span(zi.data, zi.len());
 3318|  27.4k|        GLZ_FASTFLOAT_TRY(large_add_from(x, zis, index));
  ------------------
  |  |  354|  27.4k|  {                                                                            \
  |  |  355|  27.4k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 27.4k]
  |  |  ------------------
  |  |  356|  27.4k|      return false;                                                            \
  |  |  357|  27.4k|  }
  ------------------
 3319|  27.4k|      }
 3320|  27.4k|    }
 3321|  6.86k|  }
 3322|       |
 3323|  6.86k|  x.normalize();
 3324|  6.86k|  return true;
 3325|  6.86k|}
_ZN3glz10fast_float8stackvecILt62EEC2ENS0_4spanImEE:
 3013|  6.86k|  GLZ_FASTFLOAT_CONSTEXPR20 stackvec(limb_span s) {
 3014|  6.86k|    GLZ_FASTFLOAT_ASSERT(try_extend(s));
  ------------------
  |  |  344|  6.86k|  { ((void)(x)); }
  ------------------
 3015|  6.86k|  }
_ZN3glz10fast_float8stackvecILt62EE7set_lenEm:
 3035|  91.8k|  GLZ_FASTFLOAT_CONSTEXPR14 void set_len(size_t len) noexcept {
 3036|  91.8k|    length = uint16_t(len);
 3037|  91.8k|  }
_ZN3glz10fast_float8stackvecILt62EE10try_extendENS0_4spanImEE:
 3069|  34.3k|  GLZ_FASTFLOAT_CONSTEXPR20 bool try_extend(limb_span s) noexcept {
 3070|  34.3k|    if (len() + s.len() <= capacity()) {
  ------------------
  |  Branch (3070:9): [True: 34.3k, False: 0]
  ------------------
 3071|  34.3k|      extend_unchecked(s);
 3072|  34.3k|      return true;
 3073|  34.3k|    } else {
 3074|      0|      return false;
 3075|      0|    }
 3076|  34.3k|  }
_ZN3glz10fast_float8stackvecILt62EE16extend_uncheckedENS0_4spanImEE:
 3062|  34.3k|  GLZ_FASTFLOAT_CONSTEXPR20 void extend_unchecked(limb_span s) noexcept {
 3063|  34.3k|    limb *ptr = data + length;
 3064|  34.3k|    std::copy_n(s.ptr, s.len(), ptr);
 3065|  34.3k|    set_len(len() + s.len());
 3066|  34.3k|  }
_ZN3glz10fast_float14large_add_fromILt62EEEbRNS0_8stackvecIXT_EEENS0_4spanImEEm:
 3264|  27.4k|                                          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|  27.4k|  if (x.len() < start || y.len() > x.len() - start) {
  ------------------
  |  Branch (3267:7): [True: 0, False: 27.4k]
  |  Branch (3267:26): [True: 27.4k, False: 0]
  ------------------
 3268|  27.4k|    GLZ_FASTFLOAT_TRY(x.try_resize(y.len() + start, 0));
  ------------------
  |  |  354|  27.4k|  {                                                                            \
  |  |  355|  27.4k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 27.4k]
  |  |  ------------------
  |  |  356|  27.4k|      return false;                                                            \
  |  |  357|  27.4k|  }
  ------------------
 3269|  27.4k|  }
 3270|       |
 3271|  27.4k|  bool carry = false;
 3272|   345k|  for (size_t index = 0; index < y.len(); index++) {
  ------------------
  |  Branch (3272:26): [True: 317k, False: 27.4k]
  ------------------
 3273|   317k|    limb xi = x[index + start];
 3274|   317k|    limb yi = y[index];
 3275|   317k|    bool c1 = false;
 3276|   317k|    bool c2 = false;
 3277|   317k|    xi = scalar_add(xi, yi, c1);
 3278|   317k|    if (carry) {
  ------------------
  |  Branch (3278:9): [True: 142k, False: 175k]
  ------------------
 3279|   142k|      xi = scalar_add(xi, 1, c2);
 3280|   142k|    }
 3281|   317k|    x[index + start] = xi;
 3282|   317k|    carry = c1 | c2;
 3283|   317k|  }
 3284|       |
 3285|       |  // handle overflow
 3286|  27.4k|  if (carry) {
  ------------------
  |  Branch (3286:7): [True: 0, False: 27.4k]
  ------------------
 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|  27.4k|  return true;
 3290|  27.4k|}
_ZN3glz10fast_float8stackvecILt62EE10try_resizeEmm:
 3095|  27.4k|  GLZ_FASTFLOAT_CONSTEXPR20 bool try_resize(size_t new_len, limb value) noexcept {
 3096|  27.4k|    if (new_len > capacity()) {
  ------------------
  |  Branch (3096:9): [True: 0, False: 27.4k]
  ------------------
 3097|      0|      return false;
 3098|  27.4k|    } else {
 3099|  27.4k|      resize_unchecked(new_len, value);
 3100|  27.4k|      return true;
 3101|  27.4k|    }
 3102|  27.4k|  }
_ZN3glz10fast_float8stackvecILt62EE16resize_uncheckedEmm:
 3082|  27.4k|  void resize_unchecked(size_t new_len, limb value) noexcept {
 3083|  27.4k|    if (new_len > len()) {
  ------------------
  |  Branch (3083:9): [True: 27.4k, False: 0]
  ------------------
 3084|  27.4k|      size_t count = new_len - len();
 3085|  27.4k|      limb *first = data + len();
 3086|  27.4k|      limb *last = first + count;
 3087|  27.4k|      ::std::fill(first, last, value);
 3088|  27.4k|      set_len(new_len);
 3089|  27.4k|    } else {
 3090|      0|      set_len(new_len);
 3091|      0|    }
 3092|  27.4k|  }
_ZN3glz10fast_float8stackvecILt62EE9normalizeEv:
 3118|  11.2k|  GLZ_FASTFLOAT_CONSTEXPR14 void normalize() noexcept {
 3119|  11.2k|    while (len() > 0 && rindex(0) == 0) {
  ------------------
  |  Branch (3119:12): [True: 11.2k, False: 0]
  |  Branch (3119:25): [True: 0, False: 11.2k]
  ------------------
 3120|      0|      length--;
 3121|      0|    }
 3122|  11.2k|  }
_ZNK3glz10fast_float8stackvecILt62EE6rindexEm:
 3028|  22.8k|  GLZ_FASTFLOAT_CONSTEXPR14 const limb &rindex(size_t index) const noexcept {
 3029|  22.8k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  22.8k|  { ((void)(x)); }
  ------------------
 3030|  22.8k|    size_t rindex = length - index - 1;
 3031|  22.8k|    return data[rindex];
 3032|  22.8k|  }
_ZN3glz10fast_float6bigint4pow2Ej:
 3557|  7.70k|  GLZ_FASTFLOAT_CONSTEXPR20 bool pow2(uint32_t exp) noexcept { return shl(exp); }
_ZN3glz10fast_float6bigint3shlEm:
 3519|  7.70k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl(size_t n) noexcept {
 3520|  7.70k|    size_t rem = n % limb_bits;
 3521|  7.70k|    size_t div = n / limb_bits;
 3522|  7.70k|    if (rem != 0) {
  ------------------
  |  Branch (3522:9): [True: 4.16k, False: 3.54k]
  ------------------
 3523|  4.16k|      GLZ_FASTFLOAT_TRY(shl_bits(rem));
  ------------------
  |  |  354|  4.16k|  {                                                                            \
  |  |  355|  4.16k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 4.16k]
  |  |  ------------------
  |  |  356|  4.16k|      return false;                                                            \
  |  |  357|  4.16k|  }
  ------------------
 3524|  4.16k|    }
 3525|  7.70k|    if (div != 0) {
  ------------------
  |  Branch (3525:9): [True: 2.57k, False: 5.12k]
  ------------------
 3526|  2.57k|      GLZ_FASTFLOAT_TRY(shl_limbs(div));
  ------------------
  |  |  354|  2.57k|  {                                                                            \
  |  |  355|  2.57k|    if (!(x))                                                                  \
  |  |  ------------------
  |  |  |  Branch (355:9): [True: 0, False: 2.57k]
  |  |  ------------------
  |  |  356|  2.57k|      return false;                                                            \
  |  |  357|  2.57k|  }
  ------------------
 3527|  2.57k|    }
 3528|  7.70k|    return true;
 3529|  7.70k|  }
_ZN3glz10fast_float6bigint8shl_bitsEm:
 3472|  4.16k|  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|  4.16k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n != 0);
  ------------------
  |  |  349|  4.16k|  { ((void)(x)); }
  ------------------
 3479|  4.16k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n < sizeof(limb) * 8);
  ------------------
  |  |  349|  4.16k|  { ((void)(x)); }
  ------------------
 3480|       |
 3481|  4.16k|    size_t shl = n;
 3482|  4.16k|    size_t shr = limb_bits - shl;
 3483|  4.16k|    limb prev = 0;
 3484|  46.1k|    for (size_t index = 0; index < vec.len(); index++) {
  ------------------
  |  Branch (3484:28): [True: 42.0k, False: 4.16k]
  ------------------
 3485|  42.0k|      limb xi = vec[index];
 3486|  42.0k|      vec[index] = (xi << shl) | (prev >> shr);
 3487|  42.0k|      prev = xi;
 3488|  42.0k|    }
 3489|       |
 3490|  4.16k|    limb carry = prev >> shr;
 3491|  4.16k|    if (carry != 0) {
  ------------------
  |  Branch (3491:9): [True: 1.27k, False: 2.88k]
  ------------------
 3492|  1.27k|      return vec.try_push(carry);
 3493|  1.27k|    }
 3494|  2.88k|    return true;
 3495|  4.16k|  }
_ZN3glz10fast_float6bigint9shl_limbsEm:
 3498|  2.57k|  GLZ_FASTFLOAT_CONSTEXPR20 bool shl_limbs(size_t n) noexcept {
 3499|  2.57k|    GLZ_FASTFLOAT_DEBUG_ASSERT(n != 0);
  ------------------
  |  |  349|  2.57k|  { ((void)(x)); }
  ------------------
 3500|  2.57k|    if (n + vec.len() > vec.capacity()) {
  ------------------
  |  Branch (3500:9): [True: 0, False: 2.57k]
  ------------------
 3501|      0|      return false;
 3502|  2.57k|    } else if (!vec.is_empty()) {
  ------------------
  |  Branch (3502:16): [True: 2.57k, False: 0]
  ------------------
 3503|       |      // move limbs
 3504|  2.57k|      limb *dst = vec.data + n;
 3505|  2.57k|      limb const *src = vec.data;
 3506|  2.57k|      std::copy_backward(src, src + vec.len(), dst + vec.len());
 3507|       |      // fill in empty limbs
 3508|  2.57k|      limb *first = vec.data;
 3509|  2.57k|      limb *last = first + n;
 3510|  2.57k|      ::std::fill(first, last, 0);
 3511|  2.57k|      vec.set_len(n + vec.len());
 3512|  2.57k|      return true;
 3513|  2.57k|    } else {
 3514|      0|      return true;
 3515|      0|    }
 3516|  2.57k|  }
_ZNK3glz10fast_float8stackvecILt62EE8is_emptyEv:
 3041|  6.23k|  constexpr bool is_empty() const noexcept { return length == 0; }
_ZNK3glz10fast_float6bigint4hi64ERb:
 3418|  3.65k|  GLZ_FASTFLOAT_CONSTEXPR20 uint64_t hi64(bool &truncated) const noexcept {
 3419|  3.65k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3420|  3.65k|    if (vec.len() == 0) {
  ------------------
  |  Branch (3420:9): [True: 0, False: 3.65k]
  ------------------
 3421|      0|      return empty_hi64(truncated);
 3422|  3.65k|    } else if (vec.len() == 1) {
  ------------------
  |  Branch (3422:16): [True: 172, False: 3.48k]
  ------------------
 3423|    172|      return uint64_hi64(vec.rindex(0), truncated);
 3424|  3.48k|    } else {
 3425|  3.48k|      uint64_t result = uint64_hi64(vec.rindex(0), vec.rindex(1), truncated);
 3426|  3.48k|      truncated |= vec.nonzero(2);
 3427|  3.48k|      return result;
 3428|  3.48k|    }
 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.65k|  }
_ZN3glz10fast_float11uint64_hi64EmRb:
 3132|    172|uint64_hi64(uint64_t r0, bool &truncated) noexcept {
 3133|    172|  truncated = false;
 3134|    172|  int shl = leading_zeroes(r0);
 3135|    172|  return r0 << shl;
 3136|    172|}
_ZN3glz10fast_float11uint64_hi64EmmRb:
 3139|  3.48k|uint64_hi64(uint64_t r0, uint64_t r1, bool &truncated) noexcept {
 3140|  3.48k|  int shl = leading_zeroes(r0);
 3141|  3.48k|  if (shl == 0) {
  ------------------
  |  Branch (3141:7): [True: 74, False: 3.40k]
  ------------------
 3142|     74|    truncated = r1 != 0;
 3143|     74|    return r0;
 3144|  3.40k|  } else {
 3145|  3.40k|    int shr = 64 - shl;
 3146|  3.40k|    truncated = (r1 << shl) != 0;
 3147|  3.40k|    return (r0 << shl) | (r1 >> shr);
 3148|  3.40k|  }
 3149|  3.48k|}
_ZNK3glz10fast_float8stackvecILt62EE7nonzeroEm:
 3107|  3.48k|  GLZ_FASTFLOAT_CONSTEXPR14 bool nonzero(size_t index) const noexcept {
 3108|  3.48k|    while (index < len()) {
  ------------------
  |  Branch (3108:12): [True: 860, False: 2.62k]
  ------------------
 3109|    860|      if (rindex(index) != 0) {
  ------------------
  |  Branch (3109:11): [True: 860, False: 0]
  ------------------
 3110|    860|        return true;
 3111|    860|      }
 3112|      0|      index++;
 3113|      0|    }
 3114|  2.62k|    return false;
 3115|  3.48k|  }
_ZNK3glz10fast_float6bigint10bit_lengthEv:
 3547|  3.65k|  GLZ_FASTFLOAT_CONSTEXPR20 int bit_length() const noexcept {
 3548|  3.65k|    int lz = ctlz();
 3549|  3.65k|    return int(limb_bits * vec.len()) - lz;
 3550|  3.65k|  }
_ZNK3glz10fast_float6bigint4ctlzEv:
 3532|  3.65k|  GLZ_FASTFLOAT_CONSTEXPR20 int ctlz() const noexcept {
 3533|  3.65k|    if (vec.is_empty()) {
  ------------------
  |  Branch (3533:9): [True: 0, False: 3.65k]
  ------------------
 3534|      0|      return 0;
 3535|  3.65k|    } else {
 3536|  3.65k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3537|  3.65k|      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.65k|    }
 3544|  3.65k|  }
_ZN3glz10fast_float5roundIdZNS0_19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiEUlRS3_iE_EEvS6_T0_:
 3707|  3.65k|                                                         callback cb) noexcept {
 3708|  3.65k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  3.65k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 0, False: 3.65k]
  ------------------
 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.65k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  3.65k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 3.65k]
  ------------------
 3726|  3.65k|      (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.65k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  3.65k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 3.65k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  3.65k|}
_ZZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS2_iE_clES5_i:
 3951|  3.65k|  round<T>(answer, [truncated](adjusted_mantissa &a, int32_t shift) {
 3952|  3.65k|    round_nearest_tie_even(
 3953|  3.65k|        a, shift,
 3954|  3.65k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  3.65k|          return is_above || (is_halfway && truncated) ||
 3956|  3.65k|                 (is_odd && is_halfway);
 3957|  3.65k|        });
 3958|  3.65k|  });
_ZN3glz10fast_float22round_nearest_tie_evenIZZNS0_19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS3_iE_clES6_iEUlbbbE_EEvS6_iT_:
 3742|  3.65k|                       callback cb) noexcept {
 3743|  3.65k|  uint64_t const mask = (shift == 64) ? UINT64_MAX : (uint64_t(1) << shift) - 1;
  ------------------
  |  Branch (3743:25): [True: 0, False: 3.65k]
  ------------------
 3744|  3.65k|  uint64_t const halfway = (shift == 0) ? 0 : uint64_t(1) << (shift - 1);
  ------------------
  |  Branch (3744:28): [True: 0, False: 3.65k]
  ------------------
 3745|  3.65k|  uint64_t truncated_bits = am.mantissa & mask;
 3746|  3.65k|  bool is_above = truncated_bits > halfway;
 3747|  3.65k|  bool is_halfway = truncated_bits == halfway;
 3748|       |
 3749|       |  // shift digits into position
 3750|  3.65k|  if (shift == 64) {
  ------------------
  |  Branch (3750:7): [True: 0, False: 3.65k]
  ------------------
 3751|      0|    am.mantissa = 0;
 3752|  3.65k|  } else {
 3753|  3.65k|    am.mantissa >>= shift;
 3754|  3.65k|  }
 3755|  3.65k|  am.power2 += shift;
 3756|       |
 3757|  3.65k|  bool is_odd = (am.mantissa & 1) == 1;
 3758|  3.65k|  am.mantissa += uint64_t(cb(is_odd, is_halfway, is_above));
 3759|  3.65k|}
_ZZZN3glz10fast_float19positive_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintEiENKUlRS2_iE_clES5_iENKUlbbbE_clEbbb:
 3954|  3.65k|        [truncated](bool is_odd, bool is_halfway, bool is_above) -> bool {
 3955|  3.65k|          return is_above || (is_halfway && truncated) ||
  ------------------
  |  Branch (3955:18): [True: 786, False: 2.86k]
  |  Branch (3955:31): [True: 1.86k, False: 1.00k]
  |  Branch (3955:45): [True: 376, False: 1.49k]
  ------------------
 3956|  2.49k|                 (is_odd && is_halfway);
  ------------------
  |  Branch (3956:19): [True: 222, False: 2.27k]
  |  Branch (3956:29): [True: 18, False: 204]
  ------------------
 3957|  3.65k|        });
_ZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_i:
 3970|  4.33k|    bigint &bigmant, adjusted_mantissa am, int32_t exponent) noexcept {
 3971|  4.33k|  bigint &real_digits = bigmant;
 3972|  4.33k|  int32_t real_exp = exponent;
 3973|       |
 3974|       |  // get the value of `b`, rounded down, and get a bigint representation of b+h
 3975|  4.33k|  adjusted_mantissa am_b = am;
 3976|       |  // gcc7 buf: use a lambda to remove the noexcept qualifier bug with
 3977|       |  // -Wnoexcept-type.
 3978|  4.33k|  round<T>(am_b,
 3979|  4.33k|           [](adjusted_mantissa &a, int32_t shift) { round_down(a, shift); });
 3980|  4.33k|  T b;
 3981|  4.33k|  to_float(false, am_b, b);
 3982|  4.33k|  adjusted_mantissa theor = to_extended_halfway(b);
 3983|  4.33k|  bigint theor_digits(theor.mantissa);
 3984|  4.33k|  int32_t theor_exp = theor.power2;
 3985|       |
 3986|       |  // scale real digits and theor digits to be same power.
 3987|  4.33k|  int32_t pow2_exp = theor_exp - real_exp;
 3988|  4.33k|  uint32_t pow5_exp = uint32_t(-real_exp);
 3989|  4.33k|  if (pow5_exp != 0) {
  ------------------
  |  Branch (3989:7): [True: 4.33k, False: 0]
  ------------------
 3990|  4.33k|    GLZ_FASTFLOAT_ASSERT(theor_digits.pow5(pow5_exp));
  ------------------
  |  |  344|  4.33k|  { ((void)(x)); }
  ------------------
 3991|  4.33k|  }
 3992|  4.33k|  if (pow2_exp > 0) {
  ------------------
  |  Branch (3992:7): [True: 2.49k, False: 1.84k]
  ------------------
 3993|  2.49k|    GLZ_FASTFLOAT_ASSERT(theor_digits.pow2(uint32_t(pow2_exp)));
  ------------------
  |  |  344|  2.49k|  { ((void)(x)); }
  ------------------
 3994|  2.49k|  } else if (pow2_exp < 0) {
  ------------------
  |  Branch (3994:14): [True: 1.55k, False: 288]
  ------------------
 3995|  1.55k|    GLZ_FASTFLOAT_ASSERT(real_digits.pow2(uint32_t(-pow2_exp)));
  ------------------
  |  |  344|  1.55k|  { ((void)(x)); }
  ------------------
 3996|  1.55k|  }
 3997|       |
 3998|       |  // compare digits, and use it to director rounding
 3999|  4.33k|  int ord = real_digits.compare(theor_digits);
 4000|  4.33k|  adjusted_mantissa answer = am;
 4001|  4.33k|  round<T>(answer, [ord](adjusted_mantissa &a, int32_t shift) {
 4002|  4.33k|    round_nearest_tie_even(
 4003|  4.33k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  4.33k|          (void)_;  // not needed, since we've done our comparison
 4005|  4.33k|          (void)__; // not needed, since we've done our comparison
 4006|  4.33k|          if (ord > 0) {
 4007|  4.33k|            return true;
 4008|  4.33k|          } else if (ord < 0) {
 4009|  4.33k|            return false;
 4010|  4.33k|          } else {
 4011|  4.33k|            return is_odd;
 4012|  4.33k|          }
 4013|  4.33k|        });
 4014|  4.33k|  });
 4015|       |
 4016|  4.33k|  return answer;
 4017|  4.33k|}
_ZN3glz10fast_float5roundIdZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iEUlRS3_iE_EEvS6_T0_:
 3707|  4.33k|                                                         callback cb) noexcept {
 3708|  4.33k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  4.33k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 0, False: 4.33k]
  ------------------
 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|  4.33k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  4.33k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 4.33k]
  ------------------
 3726|  4.33k|      (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|  4.33k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  4.33k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 4.33k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  4.33k|}
_ZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE_clES5_i:
 3979|  4.33k|           [](adjusted_mantissa &a, int32_t shift) { round_down(a, shift); });
_ZN3glz10fast_float10round_downERNS0_17adjusted_mantissaEi:
 3762|  4.33k|round_down(adjusted_mantissa &am, int32_t shift) noexcept {
 3763|  4.33k|  if (shift == 64) {
  ------------------
  |  Branch (3763:7): [True: 0, False: 4.33k]
  ------------------
 3764|      0|    am.mantissa = 0;
 3765|  4.33k|  } else {
 3766|  4.33k|    am.mantissa >>= shift;
 3767|  4.33k|  }
 3768|  4.33k|  am.power2 += shift;
 3769|  4.33k|}
_ZN3glz10fast_float19to_extended_halfwayIdEENS0_17adjusted_mantissaET_:
 3696|  4.33k|to_extended_halfway(T value) noexcept {
 3697|  4.33k|  adjusted_mantissa am = to_extended(value);
 3698|  4.33k|  am.mantissa <<= 1;
 3699|  4.33k|  am.mantissa += 1;
 3700|  4.33k|  am.power2 -= 1;
 3701|  4.33k|  return am;
 3702|  4.33k|}
_ZN3glz10fast_float11to_extendedIdEENS0_17adjusted_mantissaET_:
 3661|  4.33k|to_extended(T value) noexcept {
 3662|  4.33k|  using equiv_uint = equiv_uint_t<T>;
 3663|  4.33k|  constexpr equiv_uint exponent_mask = binary_format<T>::exponent_mask();
 3664|  4.33k|  constexpr equiv_uint mantissa_mask = binary_format<T>::mantissa_mask();
 3665|  4.33k|  constexpr equiv_uint hidden_bit_mask = binary_format<T>::hidden_bit_mask();
 3666|       |
 3667|  4.33k|  adjusted_mantissa am;
 3668|  4.33k|  int32_t bias = binary_format<T>::mantissa_explicit_bits() -
 3669|  4.33k|                 binary_format<T>::minimum_exponent();
 3670|  4.33k|  equiv_uint bits;
 3671|  4.33k|#if GLZ_FASTFLOAT_HAS_BIT_CAST
 3672|  4.33k|  bits = std::bit_cast<equiv_uint>(value);
 3673|       |#else
 3674|       |  ::memcpy(&bits, &value, sizeof(T));
 3675|       |#endif
 3676|  4.33k|  if ((bits & exponent_mask) == 0) {
  ------------------
  |  Branch (3676:7): [True: 0, False: 4.33k]
  ------------------
 3677|       |    // denormal
 3678|      0|    am.power2 = 1 - bias;
 3679|      0|    am.mantissa = bits & mantissa_mask;
 3680|  4.33k|  } else {
 3681|       |    // normal
 3682|  4.33k|    am.power2 = int32_t((bits & exponent_mask) >>
 3683|  4.33k|                        binary_format<T>::mantissa_explicit_bits());
 3684|  4.33k|    am.power2 -= bias;
 3685|  4.33k|    am.mantissa = (bits & mantissa_mask) | hidden_bit_mask;
 3686|  4.33k|  }
 3687|       |
 3688|  4.33k|  return am;
 3689|  4.33k|}
_ZN3glz10fast_float6bigintC2Em:
 3406|  4.33k|  GLZ_FASTFLOAT_CONSTEXPR20 bigint(uint64_t value) : vec() {
 3407|  4.33k|#ifdef GLZ_FASTFLOAT_64BIT_LIMB
 3408|  4.33k|    vec.push_unchecked(value);
 3409|       |#else
 3410|       |    vec.push_unchecked(uint32_t(value));
 3411|       |    vec.push_unchecked(uint32_t(value >> 32));
 3412|       |#endif
 3413|  4.33k|    vec.normalize();
 3414|  4.33k|  }
_ZNK3glz10fast_float6bigint7compareERKS1_:
 3451|  4.33k|  GLZ_FASTFLOAT_CONSTEXPR20 int compare(bigint const &other) const noexcept {
 3452|  4.33k|    if (vec.len() > other.vec.len()) {
  ------------------
  |  Branch (3452:9): [True: 0, False: 4.33k]
  ------------------
 3453|      0|      return 1;
 3454|  4.33k|    } else if (vec.len() < other.vec.len()) {
  ------------------
  |  Branch (3454:16): [True: 0, False: 4.33k]
  ------------------
 3455|      0|      return -1;
 3456|  4.33k|    } else {
 3457|  9.18k|      for (size_t index = vec.len(); index > 0; index--) {
  ------------------
  |  Branch (3457:38): [True: 9.06k, False: 128]
  ------------------
 3458|  9.06k|        limb xi = vec[index - 1];
 3459|  9.06k|        limb yi = other.vec[index - 1];
 3460|  9.06k|        if (xi > yi) {
  ------------------
  |  Branch (3460:13): [True: 752, False: 8.30k]
  ------------------
 3461|    752|          return 1;
 3462|  8.30k|        } else if (xi < yi) {
  ------------------
  |  Branch (3462:20): [True: 3.45k, False: 4.85k]
  ------------------
 3463|  3.45k|          return -1;
 3464|  3.45k|        }
 3465|  9.06k|      }
 3466|    128|      return 0;
 3467|  4.33k|    }
 3468|  4.33k|  }
_ZNK3glz10fast_float8stackvecILt62EEixEm:
 3022|  18.1k|  GLZ_FASTFLOAT_CONSTEXPR14 const limb &operator[](size_t index) const noexcept {
 3023|  18.1k|    GLZ_FASTFLOAT_DEBUG_ASSERT(index < length);
  ------------------
  |  |  349|  18.1k|  { ((void)(x)); }
  ------------------
 3024|  18.1k|    return data[index];
 3025|  18.1k|  }
_ZN3glz10fast_float5roundIdZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iEUlRS3_iE0_EEvS6_T0_:
 3707|  4.33k|                                                         callback cb) noexcept {
 3708|  4.33k|  int32_t mantissa_shift = 64 - binary_format<T>::mantissa_explicit_bits() - 1;
 3709|  4.33k|  if (-am.power2 >= mantissa_shift) {
  ------------------
  |  Branch (3709:7): [True: 0, False: 4.33k]
  ------------------
 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|  4.33k|  cb(am, mantissa_shift);
 3723|       |
 3724|       |  // check for carry
 3725|  4.33k|  if (am.mantissa >=
  ------------------
  |  Branch (3725:7): [True: 0, False: 4.33k]
  ------------------
 3726|  4.33k|      (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|  4.33k|  am.mantissa &= ~(uint64_t(1) << binary_format<T>::mantissa_explicit_bits());
 3733|  4.33k|  if (am.power2 >= binary_format<T>::infinite_power()) {
  ------------------
  |  Branch (3733:7): [True: 0, False: 4.33k]
  ------------------
 3734|      0|    am.power2 = binary_format<T>::infinite_power();
 3735|      0|    am.mantissa = 0;
 3736|      0|  }
 3737|  4.33k|}
_ZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE0_clES5_i:
 4001|  4.33k|  round<T>(answer, [ord](adjusted_mantissa &a, int32_t shift) {
 4002|  4.33k|    round_nearest_tie_even(
 4003|  4.33k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  4.33k|          (void)_;  // not needed, since we've done our comparison
 4005|  4.33k|          (void)__; // not needed, since we've done our comparison
 4006|  4.33k|          if (ord > 0) {
 4007|  4.33k|            return true;
 4008|  4.33k|          } else if (ord < 0) {
 4009|  4.33k|            return false;
 4010|  4.33k|          } else {
 4011|  4.33k|            return is_odd;
 4012|  4.33k|          }
 4013|  4.33k|        });
 4014|  4.33k|  });
_ZN3glz10fast_float22round_nearest_tie_evenIZZNS0_19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES3_iENKUlRS3_iE0_clES6_iEUlbbbE_EEvS6_iT_:
 3742|  4.33k|                       callback cb) noexcept {
 3743|  4.33k|  uint64_t const mask = (shift == 64) ? UINT64_MAX : (uint64_t(1) << shift) - 1;
  ------------------
  |  Branch (3743:25): [True: 0, False: 4.33k]
  ------------------
 3744|  4.33k|  uint64_t const halfway = (shift == 0) ? 0 : uint64_t(1) << (shift - 1);
  ------------------
  |  Branch (3744:28): [True: 0, False: 4.33k]
  ------------------
 3745|  4.33k|  uint64_t truncated_bits = am.mantissa & mask;
 3746|  4.33k|  bool is_above = truncated_bits > halfway;
 3747|  4.33k|  bool is_halfway = truncated_bits == halfway;
 3748|       |
 3749|       |  // shift digits into position
 3750|  4.33k|  if (shift == 64) {
  ------------------
  |  Branch (3750:7): [True: 0, False: 4.33k]
  ------------------
 3751|      0|    am.mantissa = 0;
 3752|  4.33k|  } else {
 3753|  4.33k|    am.mantissa >>= shift;
 3754|  4.33k|  }
 3755|  4.33k|  am.power2 += shift;
 3756|       |
 3757|  4.33k|  bool is_odd = (am.mantissa & 1) == 1;
 3758|  4.33k|  am.mantissa += uint64_t(cb(is_odd, is_halfway, is_above));
 3759|  4.33k|}
_ZZZN3glz10fast_float19negative_digit_compIdEENS0_17adjusted_mantissaERNS0_6bigintES2_iENKUlRS2_iE0_clES5_iENKUlbbbE_clEbbb:
 4003|  4.33k|        a, shift, [ord](bool is_odd, bool _, bool __) -> bool {
 4004|  4.33k|          (void)_;  // not needed, since we've done our comparison
 4005|  4.33k|          (void)__; // not needed, since we've done our comparison
 4006|  4.33k|          if (ord > 0) {
  ------------------
  |  Branch (4006:15): [True: 752, False: 3.58k]
  ------------------
 4007|    752|            return true;
 4008|  3.58k|          } else if (ord < 0) {
  ------------------
  |  Branch (4008:22): [True: 3.45k, False: 128]
  ------------------
 4009|  3.45k|            return false;
 4010|  3.45k|          } else {
 4011|    128|            return is_odd;
 4012|    128|          }
 4013|  4.33k|        });
_ZN3glz10fast_float8to_floatIdEEvbNS0_17adjusted_mantissaERT_:
 1131|   432k|to_float(bool negative, adjusted_mantissa am, T &value) {
 1132|   432k|  using equiv_uint = equiv_uint_t<T>;
 1133|   432k|  equiv_uint word = equiv_uint(am.mantissa);
 1134|   432k|  word = equiv_uint(word | equiv_uint(am.power2)
 1135|   432k|                               << binary_format<T>::mantissa_explicit_bits());
 1136|   432k|  word =
 1137|   432k|      equiv_uint(word | equiv_uint(negative) << binary_format<T>::sign_index());
 1138|   432k|#if GLZ_FASTFLOAT_HAS_BIT_CAST
 1139|   432k|  value = std::bit_cast<T>(word);
 1140|       |#else
 1141|       |  ::memcpy(&value, &word, sizeof(T));
 1142|       |#endif
 1143|   432k|}
_ZN3glz10fast_float13binary_formatIdE10sign_indexEv:
  758|   432k|template <> inline constexpr int binary_format<double>::sign_index() {
  759|   432k|  return 63;
  760|   432k|}
_ZN3glz10fast_float13binary_formatIdE14infinite_powerEv:
  750|  1.27M|template <> inline constexpr int binary_format<double>::infinite_power() {
  751|  1.27M|  return 0x7FF;
  752|  1.27M|}
_ZN3glz10fast_float15parse_options_tIcEC2ENS0_12chars_formatEci:
  217|  1.42M|      : format(fmt), decimal_point(dot), base(b) {}

_ZN3glz18code_point_to_utf8IcEEjjPT_:
  228|  92.5k|   {
  229|  92.5k|      if (code_point <= 0x7F) {
  ------------------
  |  Branch (229:11): [True: 62.4k, False: 30.0k]
  ------------------
  230|  62.4k|         c[0] = Char(code_point);
  231|  62.4k|         return 1;
  232|  62.4k|      }
  233|  30.0k|      if (code_point <= 0x7FF) {
  ------------------
  |  Branch (233:11): [True: 27.4k, False: 2.59k]
  ------------------
  234|  27.4k|         c[0] = Char(0xC0 | ((code_point >> 6) & 0x1F));
  235|  27.4k|         c[1] = Char(0x80 | (code_point & 0x3F));
  236|  27.4k|         return 2;
  237|  27.4k|      }
  238|  2.59k|      if (code_point <= 0xFFFF) {
  ------------------
  |  Branch (238:11): [True: 2.21k, False: 382]
  ------------------
  239|  2.21k|         c[0] = Char(0xE0 | ((code_point >> 12) & 0x0F));
  240|  2.21k|         c[1] = Char(0x80 | ((code_point >> 6) & 0x3F));
  241|  2.21k|         c[2] = Char(0x80 | (code_point & 0x3F));
  242|  2.21k|         return 3;
  243|  2.21k|      }
  244|    382|      if (code_point <= 0x10FFFF) {
  ------------------
  |  Branch (244:11): [True: 382, False: 0]
  ------------------
  245|    382|         c[0] = Char(0xF0 | ((code_point >> 18) & 0x07));
  246|    382|         c[1] = Char(0x80 | ((code_point >> 12) & 0x3F));
  247|    382|         c[2] = Char(0x80 | ((code_point >> 6) & 0x3F));
  248|    382|         c[3] = Char(0x80 | (code_point & 0x3F));
  249|    382|         return 4;
  250|    382|      }
  251|      0|      return 0;
  252|    382|   }
_ZN3glz10hex_to_u32EPKc:
  203|   253k|   {
  204|   253k|      constexpr auto& t = digit_hex_table;
  205|   253k|      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])]};
  206|   253k|      auto chunk = std::bit_cast<uint32_t>(arr);
  207|       |      // On big-endian, bit_cast produces bytes in opposite order than expected
  208|       |      // byteswap to get consistent little-endian representation
  209|       |      if constexpr (std::endian::native == std::endian::big) {
  210|       |         chunk = std::byteswap(chunk);
  211|       |      }
  212|       |      // check that all hex characters are valid
  213|   253k|      if (chunk & repeat_byte4(0b11110000u)) [[unlikely]] {
  ------------------
  |  Branch (213:11): [True: 152, False: 253k]
  ------------------
  214|    152|         return 0xFFFFFFFFu;
  215|    152|      }
  216|       |
  217|       |      // now pack into first four bytes of uint32_t
  218|   253k|      uint32_t packed{};
  219|   253k|      packed |= (chunk & 0x0000000F);
  220|   253k|      packed |= (chunk & 0x00000F00) >> 4;
  221|   253k|      packed |= (chunk & 0x000F0000) >> 8;
  222|   253k|      packed |= (chunk & 0x0F000000) >> 12;
  223|   253k|      return packed;
  224|   253k|   }

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

_ZNK3glz4yaml12yaml_context12indent_stackMUlvE_clEv:
   97|  4.93M|      std::vector<int16_t> indent_stack = [] {
   98|  4.93M|         std::vector<int16_t> v;
   99|  4.93M|         v.reserve(max_yaml_recursive_depth);
  100|  4.93M|         return v;
  101|  4.93M|      }();
_ZNK3glz4yaml12yaml_context15reset_line_memoEv:
  324|   131k|      {
  325|   131k|         memo_line_begin = nullptr;
  326|   131k|         memo_verified_end = nullptr;
  327|   131k|         memo_first_tab = nullptr;
  328|   131k|         memo_first_content = nullptr;
  329|   131k|      }
_ZN3glz4yaml19skip_document_startIRPKcS3_NS0_12yaml_contextEEEvOT_T0_RT1_:
 1011|   131k|   {
 1012|   131k|      ctx.secondary_tag_handle_overridden = false;
 1013|       |
 1014|       |      // Skip leading blank/comment-only lines before directives or document start.
 1015|   137k|      while (it != end) {
  ------------------
  |  Branch (1015:14): [True: 137k, False: 88]
  ------------------
 1016|   137k|         auto line = it;
 1017|   137k|         skip_inline_ws(line, end);
 1018|   137k|         if (line == end) {
  ------------------
  |  Branch (1018:14): [True: 16, False: 137k]
  ------------------
 1019|     16|            it = line;
 1020|     16|            break;
 1021|     16|         }
 1022|   137k|         if (*line == '#') {
  ------------------
  |  Branch (1022:14): [True: 1.38k, False: 135k]
  ------------------
 1023|  1.38k|            it = line;
 1024|  1.38k|            skip_comment(it, end);
 1025|  1.38k|            skip_newline(it, end);
 1026|  1.38k|            continue;
 1027|  1.38k|         }
 1028|   135k|         if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (1028:14): [True: 1.88k, False: 134k]
  |  Branch (1028:31): [True: 2.87k, False: 131k]
  ------------------
 1029|  4.75k|            it = line;
 1030|  4.75k|            skip_newline(it, end);
 1031|  4.75k|            continue;
 1032|  4.75k|         }
 1033|   131k|         it = line;
 1034|   131k|         break;
 1035|   135k|      }
 1036|       |
 1037|       |      // Track if we've seen a %YAML directive (duplicates are an error per spec)
 1038|   131k|      bool seen_yaml_directive = false;
 1039|   131k|      bool saw_any_directive = false;
 1040|   131k|      bool consumed_document_start = false;
 1041|       |
 1042|       |      // Process YAML directives (lines starting with %) until we hit --- or content
 1043|       |      // Directives must appear at the start of a line and before ---
 1044|   141k|      while (it != end && *it == '%') {
  ------------------
  |  Branch (1044:14): [True: 140k, False: 666]
  |  Branch (1044:27): [True: 10.1k, False: 130k]
  ------------------
 1045|  10.1k|         saw_any_directive = true;
 1046|  10.1k|         ++it; // Skip the '%'
 1047|       |
 1048|       |         // Parse directive name
 1049|  10.1k|         auto name_start = it;
 1050|  45.3k|         while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1050:17): [True: 45.2k, False: 184]
  |  Branch (1050:30): [True: 43.0k, False: 2.16k]
  |  Branch (1050:44): [True: 36.6k, False: 6.38k]
  |  Branch (1050:59): [True: 36.0k, False: 592]
  |  Branch (1050:74): [True: 35.2k, False: 804]
  ------------------
 1051|  35.2k|            ++it;
 1052|  35.2k|         }
 1053|  10.1k|         std::string_view directive_name(name_start, static_cast<size_t>(it - name_start));
 1054|       |
 1055|       |         // Check for %YAML directive
 1056|  10.1k|         if (directive_name == "YAML") {
  ------------------
  |  Branch (1056:14): [True: 186, False: 9.95k]
  ------------------
 1057|       |            // Error on duplicate %YAML directive (per spec: "It is an error to specify
 1058|       |            // more than one YAML directive for the same document")
 1059|    186|            if (seen_yaml_directive) {
  ------------------
  |  Branch (1059:17): [True: 4, False: 182]
  ------------------
 1060|      4|               ctx.error = error_code::syntax_error;
 1061|      4|               return;
 1062|      4|            }
 1063|    182|            seen_yaml_directive = true;
 1064|       |
 1065|       |            // Skip whitespace before version
 1066|    946|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1066:20): [True: 940, False: 6]
  |  Branch (1066:34): [True: 556, False: 384]
  |  Branch (1066:48): [True: 208, False: 176]
  ------------------
 1067|    764|               ++it;
 1068|    764|            }
 1069|       |
 1070|       |            // Parse major.minor version and reject malformed forms.
 1071|    182|            if (it == end || *it < '0' || *it > '9') {
  ------------------
  |  Branch (1071:17): [True: 6, False: 176]
  |  Branch (1071:30): [True: 24, False: 152]
  |  Branch (1071:43): [True: 4, False: 148]
  ------------------
 1072|     34|               ctx.error = error_code::syntax_error;
 1073|     34|               return;
 1074|     34|            }
 1075|       |            // Clamp rather than accumulate without bound. An int accumulator overflows on a long
 1076|       |            // digit run -- undefined behavior, and in practice a wrap that carries a huge version
 1077|       |            // back into the accepted range, so "%YAML 4294967296.0" was read as major version 0.
 1078|       |            //
 1079|       |            // Clamping is safe because the accumulator only grows: it stops updating once it has
 1080|       |            // already reached max_tracked_version, so a clamped value is always at least that
 1081|       |            // large, and the clamp is far above the threshold checked below. A version big enough
 1082|       |            // to freeze the accumulator therefore still compares greater and is still rejected.
 1083|       |            // The bound is deliberately independent of that threshold, so raising the threshold
 1084|       |            // later cannot quietly reintroduce the wrap. Peak value is 999, well inside int.
 1085|    148|            constexpr int max_tracked_version = 100;
 1086|    148|            int major_version = 0;
 1087|    996|            while (it != end && *it >= '0' && *it <= '9') {
  ------------------
  |  Branch (1087:20): [True: 984, False: 12]
  |  Branch (1087:33): [True: 856, False: 128]
  |  Branch (1087:47): [True: 848, False: 8]
  ------------------
 1088|    848|               if (major_version < max_tracked_version) {
  ------------------
  |  Branch (1088:20): [True: 492, False: 356]
  ------------------
 1089|    492|                  major_version = major_version * 10 + (*it - '0');
 1090|    492|               }
 1091|    848|               ++it;
 1092|    848|            }
 1093|    148|            if (it == end || *it != '.') {
  ------------------
  |  Branch (1093:17): [True: 12, False: 136]
  |  Branch (1093:30): [True: 32, False: 104]
  ------------------
 1094|     44|               ctx.error = error_code::syntax_error;
 1095|     44|               return;
 1096|     44|            }
 1097|    104|            ++it; // skip '.'
 1098|    104|            if (it == end || *it < '0' || *it > '9') {
  ------------------
  |  Branch (1098:17): [True: 2, False: 102]
  |  Branch (1098:30): [True: 6, False: 96]
  |  Branch (1098:43): [True: 4, False: 92]
  ------------------
 1099|     12|               ctx.error = error_code::syntax_error;
 1100|     12|               return;
 1101|     12|            }
 1102|    400|            while (it != end && *it >= '0' && *it <= '9') {
  ------------------
  |  Branch (1102:20): [True: 396, False: 4]
  |  Branch (1102:33): [True: 312, False: 84]
  |  Branch (1102:47): [True: 308, False: 4]
  ------------------
 1103|    308|               ++it;
 1104|    308|            }
 1105|       |
 1106|       |            // Check for major version > 1 (per spec: should be rejected)
 1107|     92|            if (major_version > 1) {
  ------------------
  |  Branch (1107:17): [True: 16, False: 76]
  ------------------
 1108|     16|               ctx.error = error_code::syntax_error;
 1109|     16|               return;
 1110|     16|            }
 1111|       |
 1112|       |            // After the version, only spaces/tabs and optional comment are allowed.
 1113|       |            // A '#' must be separated by at least one space.
 1114|     76|            if (it != end && *it == '#') {
  ------------------
  |  Branch (1114:17): [True: 74, False: 2]
  |  Branch (1114:30): [True: 4, False: 70]
  ------------------
 1115|      4|               ctx.error = error_code::syntax_error;
 1116|      4|               return;
 1117|      4|            }
 1118|    580|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1118:20): [True: 576, False: 4]
  |  Branch (1118:34): [True: 264, False: 312]
  |  Branch (1118:48): [True: 244, False: 68]
  ------------------
 1119|    508|               ++it;
 1120|    508|            }
 1121|     72|            if (it != end && *it != '\n' && *it != '\r' && *it != '#') {
  ------------------
  |  Branch (1121:17): [True: 68, False: 4]
  |  Branch (1121:30): [True: 64, False: 4]
  |  Branch (1121:45): [True: 56, False: 8]
  |  Branch (1121:60): [True: 48, False: 8]
  ------------------
 1122|     48|               ctx.error = error_code::syntax_error;
 1123|     48|               return;
 1124|     48|            }
 1125|     72|         }
 1126|  9.95k|         else if (directive_name == "TAG") {
  ------------------
  |  Branch (1126:19): [True: 7.31k, False: 2.64k]
  ------------------
 1127|  17.1k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1127:20): [True: 17.1k, False: 14]
  |  Branch (1127:34): [True: 3.46k, False: 13.6k]
  |  Branch (1127:48): [True: 6.33k, False: 7.29k]
  ------------------
 1128|  9.80k|               ++it;
 1129|  9.80k|            }
 1130|       |
 1131|  7.31k|            auto handle_start = it;
 1132|  33.1k|            while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1132:20): [True: 33.0k, False: 58]
  |  Branch (1132:33): [True: 26.1k, False: 6.90k]
  |  Branch (1132:47): [True: 25.8k, False: 316]
  |  Branch (1132:62): [True: 25.8k, False: 24]
  |  Branch (1132:77): [True: 25.8k, False: 4]
  ------------------
 1133|  25.8k|               ++it;
 1134|  25.8k|            }
 1135|  7.31k|            const std::string_view handle(handle_start, static_cast<size_t>(it - handle_start));
 1136|       |
 1137|  16.0k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (1137:20): [True: 15.9k, False: 78]
  |  Branch (1137:34): [True: 8.22k, False: 7.73k]
  |  Branch (1137:48): [True: 504, False: 7.23k]
  ------------------
 1138|  8.73k|               ++it;
 1139|  8.73k|            }
 1140|       |
 1141|  7.31k|            auto prefix_start = it;
 1142|  30.1k|            while (it != end && *it != ' ' && *it != '\t' && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1142:20): [True: 30.0k, False: 178]
  |  Branch (1142:33): [True: 25.4k, False: 4.54k]
  |  Branch (1142:47): [True: 24.7k, False: 692]
  |  Branch (1142:62): [True: 22.9k, False: 1.80k]
  |  Branch (1142:77): [True: 22.8k, False: 92]
  ------------------
 1143|  22.8k|               ++it;
 1144|  22.8k|            }
 1145|  7.31k|            const std::string_view prefix(prefix_start, static_cast<size_t>(it - prefix_start));
 1146|       |
 1147|  7.31k|            if (handle.empty() || prefix.empty()) {
  ------------------
  |  Branch (1147:17): [True: 34, False: 7.27k]
  |  Branch (1147:35): [True: 72, False: 7.20k]
  ------------------
 1148|    106|               ctx.error = error_code::syntax_error;
 1149|    106|               return;
 1150|    106|            }
 1151|       |
 1152|  7.20k|            if (handle == "!!") {
  ------------------
  |  Branch (1152:17): [True: 812, False: 6.39k]
  ------------------
 1153|    812|               ctx.secondary_tag_handle_overridden = (prefix != "tag:yaml.org,2002:");
 1154|    812|            }
 1155|  7.20k|         }
 1156|       |         // %TAG and other directives are silently skipped (per spec: should be ignored)
 1157|       |
 1158|       |         // Skip to end of directive line
 1159|   111k|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1159:17): [True: 111k, False: 436]
  |  Branch (1159:30): [True: 104k, False: 6.93k]
  |  Branch (1159:45): [True: 101k, False: 2.50k]
  ------------------
 1160|   101k|            ++it;
 1161|   101k|         }
 1162|       |         // Skip the newline
 1163|  9.86k|         skip_newline(it, end);
 1164|       |         // Skip blank and comment-only lines between directives and document start.
 1165|  12.0k|         while (it != end) {
  ------------------
  |  Branch (1165:17): [True: 11.4k, False: 552]
  ------------------
 1166|  11.4k|            auto line = it;
 1167|  11.4k|            skip_inline_ws(line, end);
 1168|  11.4k|            if (line == end) {
  ------------------
  |  Branch (1168:17): [True: 10, False: 11.4k]
  ------------------
 1169|     10|               it = line;
 1170|     10|               break;
 1171|     10|            }
 1172|  11.4k|            if (*line == '#') {
  ------------------
  |  Branch (1172:17): [True: 744, False: 10.7k]
  ------------------
 1173|    744|               it = line;
 1174|    744|               skip_comment(it, end);
 1175|    744|               skip_newline(it, end);
 1176|    744|               continue;
 1177|    744|            }
 1178|  10.7k|            if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (1178:17): [True: 632, False: 10.1k]
  |  Branch (1178:34): [True: 800, False: 9.30k]
  ------------------
 1179|  1.43k|               it = line;
 1180|  1.43k|               skip_newline(it, end);
 1181|  1.43k|               continue;
 1182|  1.43k|            }
 1183|  9.30k|            break;
 1184|  10.7k|         }
 1185|  9.86k|      }
 1186|       |
 1187|       |      // Check for ---
 1188|   131k|      if (end - it >= 3 && it[0] == '-' && it[1] == '-' && it[2] == '-') {
  ------------------
  |  Branch (1188:11): [True: 129k, False: 1.57k]
  |  Branch (1188:28): [True: 2.82k, False: 126k]
  |  Branch (1188:44): [True: 290, False: 2.53k]
  |  Branch (1188:60): [True: 248, False: 42]
  ------------------
 1189|    248|         auto after = it + 3;
 1190|       |         // Must be followed by whitespace, newline, or end
 1191|    248|         if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' || *after == '#') {
  ------------------
  |  Branch (1191:14): [True: 4, False: 244]
  |  Branch (1191:30): [True: 48, False: 196]
  |  Branch (1191:47): [True: 76, False: 120]
  |  Branch (1191:65): [True: 24, False: 96]
  |  Branch (1191:83): [True: 32, False: 64]
  |  Branch (1191:101): [True: 36, False: 28]
  ------------------
 1192|    220|            auto content = after;
 1193|  1.06k|            while (content != end && (*content == ' ' || *content == '\t')) {
  ------------------
  |  Branch (1193:20): [True: 1.05k, False: 10]
  |  Branch (1193:39): [True: 296, False: 754]
  |  Branch (1193:58): [True: 544, False: 210]
  ------------------
 1194|    840|               ++content;
 1195|    840|            }
 1196|       |            // Per yaml-test-suite, block mappings cannot begin on the same line as '---'.
 1197|    220|            if (content != end && *content != '\n' && *content != '\r' && *content != '#' &&
  ------------------
  |  Branch (1197:17): [True: 210, False: 10]
  |  Branch (1197:35): [True: 182, False: 28]
  |  Branch (1197:55): [True: 138, False: 44]
  |  Branch (1197:75): [True: 98, False: 40]
  ------------------
 1198|     98|                line_could_be_block_mapping(content, end)) {
  ------------------
  |  Branch (1198:17): [True: 16, False: 82]
  ------------------
 1199|     16|               ctx.error = error_code::syntax_error;
 1200|     16|               return;
 1201|     16|            }
 1202|    204|            consumed_document_start = true;
 1203|    204|            it = after;
 1204|       |            // Skip rest of line (whitespace and optional comment)
 1205|    204|            skip_ws_and_comment(it, end);
 1206|    204|            skip_newline(it, end);
 1207|    204|         }
 1208|    248|      }
 1209|       |
 1210|       |      // A directives section must be followed by a document start marker.
 1211|   131k|      if (saw_any_directive && !consumed_document_start) {
  ------------------
  |  Branch (1211:11): [True: 752, False: 130k]
  |  Branch (1211:32): [True: 742, False: 10]
  ------------------
 1212|    742|         ctx.error = error_code::syntax_error;
 1213|    742|         return;
 1214|    742|      }
 1215|   131k|   }
_ZN3glz4yaml14skip_inline_wsIRPKcS3_EEvOT_T0_:
  794|   223M|   {
  795|   248M|      while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (795:14): [True: 247M, False: 929k]
  |  Branch (795:28): [True: 22.8M, False: 224M]
  |  Branch (795:42): [True: 2.03M, False: 222M]
  ------------------
  796|  24.8M|         ++it;
  797|  24.8M|      }
  798|   223M|   }
_ZN3glz4yaml12skip_commentIRPKcS3_EEvOT_T0_:
  803|  7.47M|   {
  804|  7.47M|      if (it != end && *it == '#') {
  ------------------
  |  Branch (804:11): [True: 6.81M, False: 658k]
  |  Branch (804:24): [True: 1.97M, False: 4.84M]
  ------------------
  805|  51.8M|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (805:17): [True: 51.7M, False: 81.8k]
  |  Branch (805:30): [True: 50.5M, False: 1.15M]
  |  Branch (805:45): [True: 49.8M, False: 742k]
  ------------------
  806|  49.8M|            ++it;
  807|  49.8M|         }
  808|  1.97M|      }
  809|  7.47M|   }
_ZN3glz4yaml27line_could_be_block_mappingIPKcS3_EEbT_T0_:
  936|  2.47M|   {
  937|  2.47M|      const auto stop = implicit_key_scan_end(it, end);
  938|  2.47M|      bool prev_was_whitespace = true; // Start of value acts like after whitespace
  939|  2.47M|      int flow_depth = 0;
  940|   186M|      while (it != stop) {
  ------------------
  |  Branch (940:14): [True: 186M, False: 325k]
  ------------------
  941|   186M|         const char c = *it;
  942|   186M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (942:14): [True: 613k, False: 185M]
  |  Branch (942:27): [True: 576k, False: 185M]
  ------------------
  943|  1.19M|            return false;
  944|  1.19M|         }
  945|   185M|         if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (945:14): [True: 2.98M, False: 182M]
  |  Branch (945:26): [True: 1.94M, False: 1.04M]
  ------------------
  946|  1.94M|            ++it;
  947|       |            // Colon followed by space, newline, or end indicates a mapping key
  948|  1.94M|            if (it == end || *it == ' ' || *it == '\t' || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (948:17): [True: 24.5k, False: 1.91M]
  |  Branch (948:30): [True: 620k, False: 1.29M]
  |  Branch (948:44): [True: 41.2k, False: 1.25M]
  |  Branch (948:59): [True: 60.9k, False: 1.19M]
  |  Branch (948:74): [True: 155k, False: 1.03M]
  ------------------
  949|   902k|               return true;
  950|   902k|            }
  951|       |            // Otherwise this ':' is part of plain content (e.g., "::", "http://").
  952|       |            // Continue scanning for a later mapping separator on the same line.
  953|  1.03M|            prev_was_whitespace = false;
  954|  1.03M|            continue;
  955|  1.94M|         }
  956|       |         // Per YAML spec: # only starts a comment when preceded by whitespace
  957|       |         // Stop scanning if we hit a comment - any colon after is not a key indicator
  958|   183M|         if (c == '#' && flow_depth == 0 && prev_was_whitespace) {
  ------------------
  |  Branch (958:14): [True: 1.63M, False: 181M]
  |  Branch (958:26): [True: 712k, False: 925k]
  |  Branch (958:45): [True: 44.1k, False: 668k]
  ------------------
  959|  44.1k|            return false;
  960|  44.1k|         }
  961|       |         // Skip over quoted strings only when they start a quoted token.
  962|       |         // Quote characters are otherwise valid in plain scalars/keys.
  963|   183M|         if ((c == '"' || c == '\'') && prev_was_whitespace) {
  ------------------
  |  Branch (963:15): [True: 210k, False: 183M]
  |  Branch (963:27): [True: 239k, False: 182M]
  |  Branch (963:41): [True: 39.7k, False: 410k]
  ------------------
  964|  39.7k|            const char quote = c;
  965|  39.7k|            ++it;
  966|  1.04M|            while (it != stop && *it != quote) {
  ------------------
  |  Branch (966:20): [True: 1.03M, False: 2.77k]
  |  Branch (966:34): [True: 1.01M, False: 20.2k]
  ------------------
  967|  1.01M|               if (*it == '\\' && quote == '"') {
  ------------------
  |  Branch (967:20): [True: 14.2k, False: 1.00M]
  |  Branch (967:35): [True: 6.67k, False: 7.56k]
  ------------------
  968|  6.67k|                  ++it; // Skip escape character
  969|  6.67k|                  if (it != stop) ++it; // Skip escaped character
  ------------------
  |  Branch (969:23): [True: 6.55k, False: 114]
  ------------------
  970|  6.67k|               }
  971|  1.01M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (971:25): [True: 11.3k, False: 1.00M]
  |  Branch (971:40): [True: 5.38k, False: 994k]
  ------------------
  972|       |                  // Unterminated quote on this line
  973|  16.7k|                  return false;
  974|  16.7k|               }
  975|   994k|               else {
  976|   994k|                  ++it;
  977|   994k|               }
  978|  1.01M|            }
  979|  23.0k|            if (it != stop) ++it; // Skip closing quote
  ------------------
  |  Branch (979:17): [True: 20.2k, False: 2.77k]
  ------------------
  980|  23.0k|            prev_was_whitespace = false;
  981|  23.0k|            continue;
  982|  39.7k|         }
  983|   183M|         if (c == '[' || c == '{') {
  ------------------
  |  Branch (983:14): [True: 1.17M, False: 182M]
  |  Branch (983:26): [True: 1.68M, False: 180M]
  ------------------
  984|  2.86M|            ++flow_depth;
  985|  2.86M|            prev_was_whitespace = false;
  986|  2.86M|            ++it;
  987|  2.86M|            continue;
  988|  2.86M|         }
  989|   180M|         if ((c == ']' || c == '}') && flow_depth > 0) {
  ------------------
  |  Branch (989:15): [True: 128k, False: 180M]
  |  Branch (989:27): [True: 717k, False: 179M]
  |  Branch (989:40): [True: 352k, False: 493k]
  ------------------
  990|   352k|            --flow_depth;
  991|   352k|            prev_was_whitespace = false;
  992|   352k|            ++it;
  993|   352k|            continue;
  994|   352k|         }
  995|   180M|         prev_was_whitespace = (c == ' ' || c == '\t');
  ------------------
  |  Branch (995:33): [True: 7.63M, False: 172M]
  |  Branch (995:45): [True: 1.26M, False: 171M]
  ------------------
  996|   180M|         ++it;
  997|   180M|      }
  998|   325k|      return false;
  999|  2.47M|   }
_ZN3glz4yaml21implicit_key_scan_endIPKcS3_EET_S4_T0_:
   85|  17.0M|   {
   86|  17.0M|      const size_t remaining = size_t(end - it);
   87|  17.0M|      return it + (remaining < max_implicit_key_lookahead ? remaining : max_implicit_key_lookahead);
  ------------------
  |  Branch (87:20): [True: 16.2M, False: 800k]
  ------------------
   88|  17.0M|   }
_ZN3glz4yaml19skip_ws_and_commentIRPKcS3_EEvOT_T0_:
  814|  2.10M|   {
  815|  2.10M|      skip_inline_ws(it, end);
  816|  2.10M|      skip_comment(it, end);
  817|  2.10M|   }
_ZN3glz4yaml17at_document_startIRPKcS3_EEbOT_T0_:
 1221|  7.09M|   {
 1222|  7.09M|      if (end - it >= 3 && it[0] == '-' && it[1] == '-' && it[2] == '-') {
  ------------------
  |  Branch (1222:11): [True: 6.97M, False: 115k]
  |  Branch (1222:28): [True: 220k, False: 6.75M]
  |  Branch (1222:44): [True: 58.5k, False: 161k]
  |  Branch (1222:60): [True: 28.6k, False: 29.8k]
  ------------------
 1223|  28.6k|         auto after = it + 3;
 1224|  28.6k|         return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r';
  ------------------
  |  Branch (1224:17): [True: 1.15k, False: 27.4k]
  |  Branch (1224:33): [True: 4.07k, False: 23.4k]
  |  Branch (1224:50): [True: 9.51k, False: 13.9k]
  |  Branch (1224:68): [True: 2.12k, False: 11.7k]
  |  Branch (1224:86): [True: 2.52k, False: 9.25k]
  ------------------
 1225|  28.6k|      }
 1226|  7.06M|      return false;
 1227|  7.09M|   }
_ZN3glz4yaml15at_document_endIRPKcS3_EEbOT_T0_:
 1233|  12.4M|   {
 1234|  12.4M|      if (end - it >= 3 && it[0] == '.' && it[1] == '.' && it[2] == '.') {
  ------------------
  |  Branch (1234:11): [True: 12.2M, False: 195k]
  |  Branch (1234:28): [True: 215k, False: 12.0M]
  |  Branch (1234:44): [True: 88.6k, False: 126k]
  |  Branch (1234:60): [True: 72.0k, False: 16.6k]
  ------------------
 1235|  72.0k|         auto after = it + 3;
 1236|   199k|         while (after != end && (*after == ' ' || *after == '\t')) ++after;
  ------------------
  |  Branch (1236:17): [True: 184k, False: 15.2k]
  |  Branch (1236:34): [True: 62.6k, False: 121k]
  |  Branch (1236:51): [True: 65.1k, False: 56.7k]
  ------------------
 1237|  72.0k|         return after == end || *after == '\n' || *after == '\r' || *after == '#';
  ------------------
  |  Branch (1237:17): [True: 15.2k, False: 56.7k]
  |  Branch (1237:33): [True: 30.0k, False: 26.6k]
  |  Branch (1237:51): [True: 9.26k, False: 17.4k]
  |  Branch (1237:69): [True: 2.54k, False: 14.8k]
  ------------------
 1238|  72.0k|      }
 1239|  12.4M|      return false;
 1240|  12.4M|   }
_ZN3glz4yaml25skip_ws_newlines_commentsIRPKcS3_EEvOT_T0_:
  857|  20.9M|   {
  858|  21.5M|      while (it != end) {
  ------------------
  |  Branch (858:14): [True: 21.5M, False: 1.64k]
  ------------------
  859|  21.5M|         if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (859:14): [True: 180k, False: 21.3M]
  |  Branch (859:28): [True: 61.8k, False: 21.2M]
  ------------------
  860|   242k|            ++it;
  861|   242k|         }
  862|  21.2M|         else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (862:19): [True: 181k, False: 21.1M]
  |  Branch (862:34): [True: 122k, False: 20.9M]
  ------------------
  863|   304k|            skip_newline(it, end);
  864|   304k|         }
  865|  20.9M|         else if (*it == '#') {
  ------------------
  |  Branch (865:19): [True: 62.7k, False: 20.9M]
  ------------------
  866|  62.7k|            skip_comment(it, end);
  867|  62.7k|         }
  868|  20.9M|         else {
  869|  20.9M|            break;
  870|  20.9M|         }
  871|  21.5M|      }
  872|  20.9M|   }
_ZN3glz4yaml17parse_anchor_nameIPKcS3_EENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEERT_T0_:
 1321|  21.7M|   {
 1322|  21.7M|      auto start = it;
 1323|  21.7M|      if (start == end) return {};
  ------------------
  |  Branch (1323:11): [True: 2.72k, False: 21.7M]
  ------------------
 1324|  1.34G|      while (it != end) {
  ------------------
  |  Branch (1324:14): [True: 1.34G, False: 126k]
  ------------------
 1325|  1.34G|         const char c = *it;
 1326|       |         // Per YAML, anchor names end at whitespace or flow indicators.
 1327|       |         // Colon is allowed in anchor names.
 1328|  1.34G|         if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == '[' || c == ']' || c == '{' ||
  ------------------
  |  Branch (1328:14): [True: 13.2M, False: 1.33G]
  |  Branch (1328:26): [True: 514k, False: 1.32G]
  |  Branch (1328:39): [True: 799k, False: 1.32G]
  |  Branch (1328:52): [True: 1.00M, False: 1.32G]
  |  Branch (1328:65): [True: 1.65M, False: 1.32G]
  |  Branch (1328:77): [True: 130k, False: 1.32G]
  |  Branch (1328:89): [True: 27.7k, False: 1.32G]
  |  Branch (1328:101): [True: 715k, False: 1.32G]
  ------------------
 1329|  1.32G|             c == '}') {
  ------------------
  |  Branch (1329:14): [True: 3.56M, False: 1.32G]
  ------------------
 1330|  21.6M|            break;
 1331|  21.6M|         }
 1332|  1.32G|         ++it;
 1333|  1.32G|      }
 1334|  21.7M|      return std::string_view(&*start, static_cast<size_t>(it - start));
 1335|  21.7M|   }
_ZNK3glz4yaml12yaml_context23transparent_string_hashclENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
  134|  53.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|  15.9M|         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_:
  745|  55.0M|   {
  746|  55.0M|      return parse_yaml_tag(it, end, !ctx.secondary_tag_handle_overridden);
  747|  55.0M|   }
_ZN3glz4yaml14parse_yaml_tagIPKcS3_EENS0_8yaml_tagERT_T0_b:
  626|  55.0M|   {
  627|  55.0M|      if (it == end || *it != '!') {
  ------------------
  |  Branch (627:11): [True: 0, False: 55.0M]
  |  Branch (627:24): [True: 52.5M, False: 2.45M]
  ------------------
  628|  52.5M|         return yaml_tag::none;
  629|  52.5M|      }
  630|       |
  631|  2.45M|      ++it; // skip first !
  632|       |
  633|  2.45M|      if (it == end) {
  ------------------
  |  Branch (633:11): [True: 452, False: 2.45M]
  ------------------
  634|    452|         return yaml_tag::unknown;
  635|    452|      }
  636|       |
  637|       |      // Check for !! (shorthand tag)
  638|  2.45M|      if (*it == '!') {
  ------------------
  |  Branch (638:11): [True: 1.15M, False: 1.30M]
  ------------------
  639|  1.15M|         ++it; // skip second !
  640|       |
  641|       |         // Read tag name
  642|  1.15M|         auto tag_start = it;
  643|  7.76M|         while (it != end && !plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (643:17): [True: 7.75M, False: 5.35k]
  |  Branch (643:30): [True: 6.61M, False: 1.14M]
  ------------------
  644|  6.61M|            ++it;
  645|  6.61M|         }
  646|       |
  647|  1.15M|         std::string_view tag_name(tag_start, static_cast<size_t>(it - tag_start));
  648|  1.15M|         if (tag_name.empty() || malformed_tag_token(tag_name)) {
  ------------------
  |  Branch (648:14): [True: 450, False: 1.15M]
  |  Branch (648:34): [True: 0, False: 1.15M]
  ------------------
  649|    450|            return yaml_tag::unknown;
  650|    450|         }
  651|  1.15M|         if (it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (651:14): [True: 1.14M, False: 5.31k]
  |  Branch (651:27): [True: 406, False: 1.14M]
  ------------------
  652|    406|            return yaml_tag::unknown;
  653|    406|         }
  654|       |
  655|       |         // Skip whitespace after tag
  656|  2.82M|         while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (656:17): [True: 2.81M, False: 8.12k]
  |  Branch (656:31): [True: 458k, False: 2.35M]
  |  Branch (656:45): [True: 1.21M, False: 1.14M]
  ------------------
  657|  1.67M|            ++it;
  658|  1.67M|         }
  659|       |
  660|  1.15M|         if (!allow_core_schema_secondary_handle) {
  ------------------
  |  Branch (660:14): [True: 4, False: 1.15M]
  ------------------
  661|      4|            return yaml_tag::none;
  662|      4|         }
  663|       |
  664|       |         // Match known tags
  665|  1.15M|         if (tag_name == "str") return yaml_tag::str;
  ------------------
  |  Branch (665:14): [True: 22.6k, False: 1.12M]
  ------------------
  666|  1.12M|         if (tag_name == "int") return yaml_tag::int_tag;
  ------------------
  |  Branch (666:14): [True: 52.8k, False: 1.07M]
  ------------------
  667|  1.07M|         if (tag_name == "float") return yaml_tag::float_tag;
  ------------------
  |  Branch (667:14): [True: 612, False: 1.07M]
  ------------------
  668|  1.07M|         if (tag_name == "bool") return yaml_tag::bool_tag;
  ------------------
  |  Branch (668:14): [True: 130k, False: 944k]
  ------------------
  669|   944k|         if (tag_name == "null") return yaml_tag::null_tag;
  ------------------
  |  Branch (669:14): [True: 12.0k, False: 932k]
  ------------------
  670|   932k|         if (tag_name == "map") return yaml_tag::map;
  ------------------
  |  Branch (670:14): [True: 96.3k, False: 835k]
  ------------------
  671|   835k|         if (tag_name == "seq") return yaml_tag::seq;
  ------------------
  |  Branch (671:14): [True: 421k, False: 414k]
  ------------------
  672|       |
  673|       |         // Unrecognized shorthand tag (e.g., !!omap) — ignore and parse value normally
  674|   414k|         return yaml_tag::none;
  675|   835k|      }
  676|       |
  677|       |      // Check for verbatim tag !<...>
  678|  1.30M|      if (*it == '<') {
  ------------------
  |  Branch (678:11): [True: 4.57k, False: 1.29M]
  ------------------
  679|  4.57k|         ++it;
  680|  4.57k|         auto tag_start = it;
  681|   186k|         while (it != end && *it != '>') {
  ------------------
  |  Branch (681:17): [True: 186k, False: 300]
  |  Branch (681:30): [True: 182k, False: 4.27k]
  ------------------
  682|   182k|            ++it;
  683|   182k|         }
  684|  4.57k|         if (it == end) {
  ------------------
  |  Branch (684:14): [True: 300, False: 4.27k]
  ------------------
  685|    300|            return yaml_tag::unknown;
  686|    300|         }
  687|       |
  688|  4.27k|         std::string_view tag_uri(tag_start, static_cast<size_t>(it - tag_start));
  689|  4.27k|         if (tag_uri.empty() || malformed_tag_token(tag_uri)) {
  ------------------
  |  Branch (689:14): [True: 62, False: 4.21k]
  |  Branch (689:33): [True: 204, False: 4.00k]
  ------------------
  690|    266|            return yaml_tag::unknown;
  691|    266|         }
  692|  4.00k|         ++it; // skip >
  693|  4.00k|         if (it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (693:14): [True: 3.77k, False: 232]
  |  Branch (693:27): [True: 98, False: 3.67k]
  ------------------
  694|     98|            return yaml_tag::unknown;
  695|     98|         }
  696|       |
  697|       |         // Skip whitespace after tag
  698|  10.4k|         while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (698:17): [True: 10.0k, False: 418]
  |  Branch (698:31): [True: 4.10k, False: 5.97k]
  |  Branch (698:45): [True: 2.47k, False: 3.49k]
  ------------------
  699|  6.58k|            ++it;
  700|  6.58k|         }
  701|       |
  702|       |         // Match known YAML 1.2 URIs
  703|  3.91k|         if (tag_uri == "tag:yaml.org,2002:str") return yaml_tag::str;
  ------------------
  |  Branch (703:14): [True: 60, False: 3.85k]
  ------------------
  704|  3.85k|         if (tag_uri == "tag:yaml.org,2002:int") return yaml_tag::int_tag;
  ------------------
  |  Branch (704:14): [True: 70, False: 3.78k]
  ------------------
  705|  3.78k|         if (tag_uri == "tag:yaml.org,2002:float") return yaml_tag::float_tag;
  ------------------
  |  Branch (705:14): [True: 64, False: 3.71k]
  ------------------
  706|  3.71k|         if (tag_uri == "tag:yaml.org,2002:bool") return yaml_tag::bool_tag;
  ------------------
  |  Branch (706:14): [True: 64, False: 3.65k]
  ------------------
  707|  3.65k|         if (tag_uri == "tag:yaml.org,2002:null") return yaml_tag::null_tag;
  ------------------
  |  Branch (707:14): [True: 100, False: 3.55k]
  ------------------
  708|  3.55k|         if (tag_uri == "tag:yaml.org,2002:map") return yaml_tag::map;
  ------------------
  |  Branch (708:14): [True: 70, False: 3.48k]
  ------------------
  709|  3.48k|         if (tag_uri == "tag:yaml.org,2002:seq") return yaml_tag::seq;
  ------------------
  |  Branch (709:14): [True: 66, False: 3.41k]
  ------------------
  710|       |
  711|       |         // Unrecognized verbatim tag — ignore and parse value normally
  712|  3.41k|         return yaml_tag::none;
  713|  3.48k|      }
  714|       |
  715|       |      // Named tag !name - skip it and read name
  716|  1.29M|      auto tag_start = it;
  717|  12.9M|      while (it != end && !plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (717:14): [True: 12.9M, False: 1.91k]
  |  Branch (717:27): [True: 11.6M, False: 1.29M]
  ------------------
  718|  11.6M|         ++it;
  719|  11.6M|      }
  720|  1.29M|      std::string_view tag_name(tag_start, static_cast<size_t>(it - tag_start));
  721|  1.29M|      if (!tag_name.empty() && malformed_tag_token(tag_name)) {
  ------------------
  |  Branch (721:11): [True: 956k, False: 341k]
  |  Branch (721:32): [True: 0, False: 956k]
  ------------------
  722|      0|         return yaml_tag::unknown;
  723|      0|      }
  724|  1.29M|      if (!tag_name.empty() && it != end && malformed_tag_termination(*it)) {
  ------------------
  |  Branch (724:11): [True: 956k, False: 341k]
  |  Branch (724:32): [True: 954k, False: 1.91k]
  |  Branch (724:45): [True: 496, False: 954k]
  ------------------
  725|    496|         return yaml_tag::unknown;
  726|    496|      }
  727|       |
  728|       |      // Skip whitespace after tag
  729|  2.38M|      while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (729:14): [True: 2.38M, False: 2.04k]
  |  Branch (729:28): [True: 245k, False: 2.13M]
  |  Branch (729:42): [True: 841k, False: 1.29M]
  ------------------
  730|  1.08M|         ++it;
  731|  1.08M|      }
  732|       |
  733|       |      // Unrecognized named tag — ignore and parse value normally
  734|  1.29M|      return yaml_tag::none;
  735|  1.29M|   }
_ZN3glz4yaml19malformed_tag_tokenENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  604|  2.11M|   {
  605|       |      // Reject obviously malformed tag tokens used by conformance tests.
  606|       |      // Unknown-but-well-formed tags are still ignored.
  607|  18.4M|      for (const char c : token) {
  ------------------
  |  Branch (607:25): [True: 18.4M, False: 2.11M]
  ------------------
  608|  18.4M|         if (c == '{' || c == '}') return true;
  ------------------
  |  Branch (608:14): [True: 66, False: 18.4M]
  |  Branch (608:26): [True: 138, False: 18.4M]
  ------------------
  609|  18.4M|      }
  610|  2.11M|      return false;
  611|  2.11M|   }
_ZN3glz4yaml25malformed_tag_terminationEc:
  614|  2.10M|   {
  615|  2.10M|      return !(c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '#' || c == ',' || c == ']' || c == '}');
  ------------------
  |  Branch (615:16): [True: 380k, False: 1.72M]
  |  Branch (615:28): [True: 1.39M, False: 326k]
  |  Branch (615:41): [True: 228k, False: 97.2k]
  |  Branch (615:54): [True: 33.1k, False: 64.0k]
  |  Branch (615:67): [True: 33.6k, False: 30.3k]
  |  Branch (615:79): [True: 26.9k, False: 3.43k]
  |  Branch (615:91): [True: 1.27k, False: 2.15k]
  |  Branch (615:103): [True: 1.15k, False: 1.00k]
  ------------------
  616|  2.10M|   }
_ZN3glz4yaml20tag_valid_for_stringENS0_8yaml_tagE:
  751|  37.5M|   {
  752|  37.5M|      return tag == yaml_tag::none || tag == yaml_tag::str;
  ------------------
  |  Branch (752:14): [True: 37.5M, False: 4.19k]
  |  Branch (752:39): [True: 4.04k, False: 150]
  ------------------
  753|  37.5M|   }
_ZN3glz4yaml17tag_valid_for_mapENS0_8yaml_tagE:
  787|  9.19M|   {
  788|  9.19M|      return tag == yaml_tag::none || tag == yaml_tag::map;
  ------------------
  |  Branch (788:14): [True: 9.19M, False: 872]
  |  Branch (788:39): [True: 842, False: 30]
  ------------------
  789|  9.19M|   }
_ZNK3glz4yaml12yaml_context23alias_span_is_replayingEPKcS3_:
  154|  4.65M|      {
  155|  16.9M|         for (const auto& [b, e] : active_alias_spans) {
  ------------------
  |  Branch (155:34): [True: 16.9M, False: 4.64M]
  ------------------
  156|  16.9M|            if (b == begin && e == end) return true;
  ------------------
  |  Branch (156:17): [True: 2.57k, False: 16.9M]
  |  Branch (156:31): [True: 2.13k, False: 444]
  ------------------
  157|  16.9M|         }
  158|  4.64M|         return false;
  159|  4.65M|      }
_ZN3glz4yaml12yaml_context22charge_alias_expansionEm:
  174|  5.82M|      {
  175|  5.82M|         if (alias_expansion_budget == 0) {
  ------------------
  |  Branch (175:14): [True: 0, False: 5.82M]
  ------------------
  176|      0|            return true; // unbudgeted
  177|      0|         }
  178|  5.82M|         if (bytes >= alias_expansion_budget) {
  ------------------
  |  Branch (178:14): [True: 72, False: 5.82M]
  ------------------
  179|     72|            alias_expansion_budget = 1; // latch: spent, and still not "unbudgeted"
  180|     72|            return false;
  181|     72|         }
  182|  5.82M|         alias_expansion_budget -= bytes;
  183|  5.82M|         return true;
  184|  5.82M|      }
_ZN3glz4yaml12yaml_context11push_indentEi:
  106|  6.44M|      {
  107|  6.44M|         if (indent_stack.size() >= max_yaml_recursive_depth) [[unlikely]] {
  ------------------
  |  Branch (107:14): [True: 0, False: 6.44M]
  ------------------
  108|      0|            error = error_code::exceeded_max_recursive_depth;
  109|      0|            return false;
  110|      0|         }
  111|  6.44M|         indent_stack.push_back(static_cast<int16_t>(indent));
  112|  6.44M|         return true;
  113|  6.44M|      }
_ZN3glz4yaml20skip_ws_and_newlinesIRPKcS3_EEvOT_T0_:
  842|  60.6M|   {
  843|  82.6M|      while (it != end && (*it == ' ' || *it == '\t' || *it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (843:14): [True: 82.5M, False: 29.0k]
  |  Branch (843:28): [True: 7.92M, False: 74.6M]
  |  Branch (843:42): [True: 4.69M, False: 69.9M]
  |  Branch (843:57): [True: 5.49M, False: 64.4M]
  |  Branch (843:72): [True: 3.83M, False: 60.6M]
  ------------------
  844|  21.9M|         if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (844:14): [True: 5.49M, False: 16.4M]
  |  Branch (844:29): [True: 3.83M, False: 12.6M]
  ------------------
  845|  9.32M|            skip_newline(it, end);
  846|  9.32M|         }
  847|  12.6M|         else {
  848|  12.6M|            ++it;
  849|  12.6M|         }
  850|  21.9M|      }
  851|  60.6M|   }
_ZN3glz4yaml19detect_scalar_styleEc:
 1339|  5.62M|   {
 1340|  5.62M|      switch (c) {
 1341|  27.0k|      case '"':
  ------------------
  |  Branch (1341:7): [True: 27.0k, False: 5.59M]
  ------------------
 1342|  27.0k|         return scalar_style::double_quoted;
 1343|  69.8k|      case '\'':
  ------------------
  |  Branch (1343:7): [True: 69.8k, False: 5.55M]
  ------------------
 1344|  69.8k|         return scalar_style::single_quoted;
 1345|  7.79k|      case '|':
  ------------------
  |  Branch (1345:7): [True: 7.79k, False: 5.61M]
  ------------------
 1346|  7.79k|         return scalar_style::literal_block;
 1347|  22.8k|      case '>':
  ------------------
  |  Branch (1347:7): [True: 22.8k, False: 5.60M]
  ------------------
 1348|  22.8k|         return scalar_style::folded_block;
 1349|  5.49M|      default:
  ------------------
  |  Branch (1349:7): [True: 5.49M, False: 127k]
  ------------------
 1350|  5.49M|         return scalar_style::plain;
 1351|  5.62M|      }
 1352|  5.62M|   }
_ZN3glz4yaml23skip_folded_line_indentINS0_12yaml_contextEEEbRPKcS4_RT_Pi:
  908|  1.06M|   {
  909|  1.06M|      bool saw_space = false;
  910|  1.06M|      int indent_count = 0;
  911|  1.73M|      while (src < src_end && (*src == ' ' || *src == '\t')) {
  ------------------
  |  Branch (911:14): [True: 1.66M, False: 69.4k]
  |  Branch (911:32): [True: 287k, False: 1.37M]
  |  Branch (911:47): [True: 384k, False: 994k]
  ------------------
  912|       |         // In nested block contexts, a tab at indentation column 0 is invalid.
  913|   671k|         if (*src == '\t' && !saw_space && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (913:14): [True: 384k, False: 287k]
  |  Branch (913:30): [True: 78.7k, False: 306k]
  |  Branch (913:44): [True: 50, False: 78.6k]
  ------------------
  914|     50|            ctx.error = error_code::syntax_error;
  915|     50|            return false;
  916|     50|         }
  917|   671k|         if (*src == ' ') saw_space = true;
  ------------------
  |  Branch (917:14): [True: 287k, False: 384k]
  ------------------
  918|   671k|         ++indent_count;
  919|   671k|         ++src;
  920|   671k|      }
  921|  1.06M|      if (ctx.current_indent() >= 0 && src < src_end && *src != '\n' && *src != '\r' &&
  ------------------
  |  Branch (921:11): [True: 132k, False: 930k]
  |  Branch (921:40): [True: 108k, False: 23.7k]
  |  Branch (921:57): [True: 88.7k, False: 20.1k]
  |  Branch (921:73): [True: 74.6k, False: 14.0k]
  ------------------
  922|  74.6k|          indent_count < ctx.current_indent()) {
  ------------------
  |  Branch (922:11): [True: 160, False: 74.5k]
  ------------------
  923|    160|         ctx.error = error_code::syntax_error;
  924|    160|         return false;
  925|    160|      }
  926|  1.06M|      if (indent_out) *indent_out = indent_count;
  ------------------
  |  Branch (926:11): [True: 1.06M, False: 0]
  ------------------
  927|  1.06M|      return true;
  928|  1.06M|   }
_ZN3glz4yaml27starts_with_document_markerIPKcS3_EEbT_T0_:
  885|   857k|   {
  886|   857k|      if (src >= src_end) return false;
  ------------------
  |  Branch (886:11): [True: 67.6k, False: 790k]
  ------------------
  887|   790k|      if ((src_end - src) >= 3) {
  ------------------
  |  Branch (887:11): [True: 776k, False: 13.8k]
  ------------------
  888|   776k|         if (src[0] == '-' && src[1] == '-' && src[2] == '-') {
  ------------------
  |  Branch (888:14): [True: 29.8k, False: 746k]
  |  Branch (888:31): [True: 14.6k, False: 15.2k]
  |  Branch (888:48): [True: 1.97k, False: 12.6k]
  ------------------
  889|  1.97k|            const auto* after = src + 3;
  890|  1.97k|            return after == src_end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (890:20): [True: 38, False: 1.94k]
  |  Branch (890:40): [True: 34, False: 1.90k]
  |  Branch (890:57): [True: 30, False: 1.87k]
  |  Branch (890:75): [True: 38, False: 1.83k]
  |  Branch (890:93): [True: 30, False: 1.80k]
  ------------------
  891|  1.80k|                   *after == '#';
  ------------------
  |  Branch (891:20): [True: 24, False: 1.78k]
  ------------------
  892|  1.97k|         }
  893|   774k|         if (src[0] == '.' && src[1] == '.' && src[2] == '.') {
  ------------------
  |  Branch (893:14): [True: 14.5k, False: 759k]
  |  Branch (893:31): [True: 9.89k, False: 4.62k]
  |  Branch (893:48): [True: 1.61k, False: 8.28k]
  ------------------
  894|  1.61k|            const auto* after = src + 3;
  895|  1.61k|            return after == src_end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (895:20): [True: 46, False: 1.56k]
  |  Branch (895:40): [True: 30, False: 1.53k]
  |  Branch (895:57): [True: 36, False: 1.50k]
  |  Branch (895:75): [True: 30, False: 1.47k]
  |  Branch (895:93): [True: 46, False: 1.42k]
  ------------------
  896|  1.42k|                   *after == '#';
  ------------------
  |  Branch (896:20): [True: 30, False: 1.39k]
  ------------------
  897|  1.61k|         }
  898|   774k|      }
  899|   786k|      return false;
  900|   790k|   }
_ZN3glz4yaml19tag_valid_for_floatENS0_8yaml_tagE:
  763|  2.06M|   {
  764|  2.06M|      return tag == yaml_tag::none || tag == yaml_tag::float_tag || tag == yaml_tag::int_tag;
  ------------------
  |  Branch (764:14): [True: 2.06M, False: 1.26k]
  |  Branch (764:39): [True: 156, False: 1.10k]
  |  Branch (764:69): [True: 260, False: 848]
  ------------------
  765|  2.06M|   }
_ZN3glz4yaml18tag_valid_for_boolENS0_8yaml_tagE:
  769|   286k|   {
  770|   286k|      return tag == yaml_tag::none || tag == yaml_tag::bool_tag;
  ------------------
  |  Branch (770:14): [True: 285k, False: 1.01k]
  |  Branch (770:39): [True: 986, False: 24]
  ------------------
  771|   286k|   }
_ZN3glz4yaml12is_yaml_nullENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
 1374|  51.9k|   {
 1375|  51.9k|      return s == "null" || s == "Null" || s == "NULL" || s == "~" || s.empty();
  ------------------
  |  Branch (1375:14): [True: 35.7k, False: 16.1k]
  |  Branch (1375:29): [True: 2.22k, False: 13.9k]
  |  Branch (1375:44): [True: 3.63k, False: 10.3k]
  |  Branch (1375:59): [True: 0, False: 10.3k]
  |  Branch (1375:71): [True: 9.94k, False: 388]
  ------------------
 1376|  51.9k|   }
_ZN3glz4yaml14measure_indentILb1ERPKcS3_NS0_12yaml_contextEEEiOT0_T1_RT2_:
 1250|  2.08M|   {
 1251|  2.08M|      int32_t indent = 0;
 1252|  3.14M|      while (it != end && *it == ' ') {
  ------------------
  |  Branch (1252:14): [True: 2.85M, False: 288k]
  |  Branch (1252:27): [True: 1.06M, False: 1.79M]
  ------------------
 1253|  1.06M|         ++indent;
 1254|  1.06M|         ++it;
 1255|  1.06M|      }
 1256|       |      // YAML spec: "Tab characters must not be used for indentation"
 1257|  2.08M|      if constexpr (error_on_tab) {
 1258|  2.08M|         if (it != end && *it == '\t') {
  ------------------
  |  Branch (1258:14): [True: 1.79M, False: 288k]
  |  Branch (1258:27): [True: 166, False: 1.79M]
  ------------------
 1259|    166|            ctx.error = error_code::syntax_error;
 1260|    166|         }
 1261|       |      }
 1262|       |      else {
 1263|       |         // In block scalar context: tabs after spaces are content, not indentation.
 1264|       |         // Only error when tab is the first character (pure tab indentation).
 1265|       |         if (indent == 0 && it != end && *it == '\t') {
 1266|       |            ctx.error = error_code::syntax_error;
 1267|       |         }
 1268|       |      }
 1269|  2.08M|      return indent;
 1270|  2.08M|   }
_ZNK3glz4yaml12yaml_context13line_begin_ofEPKc:
  302|  13.6M|      {
  303|  13.6M|         if (!stream_begin || p < stream_begin) {
  ------------------
  |  Branch (303:14): [True: 0, False: 13.6M]
  |  Branch (303:31): [True: 0, False: 13.6M]
  ------------------
  304|      0|            return p;
  305|      0|         }
  306|  13.6M|         memoize_line(p);
  307|  13.6M|         return memo_line_begin;
  308|  13.6M|      }
_ZNK3glz4yaml12yaml_context12memoize_lineEPKc:
  266|  13.6M|      {
  267|  13.6M|         if (memo_line_begin && p >= memo_line_begin && p <= memo_verified_end) {
  ------------------
  |  Branch (267:14): [True: 13.2M, False: 431k]
  |  Branch (267:33): [True: 12.1M, False: 1.09M]
  |  Branch (267:57): [True: 6.22M, False: 5.90M]
  ------------------
  268|  6.22M|            return;
  269|  6.22M|         }
  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|  7.42M|         const bool extends = memo_line_begin && p > memo_verified_end;
  ------------------
  |  Branch (272:31): [True: 6.99M, False: 431k]
  |  Branch (272:50): [True: 5.90M, False: 1.09M]
  ------------------
  273|  7.42M|         const char* const floor = extends ? memo_verified_end : stream_begin;
  ------------------
  |  Branch (273:36): [True: 5.90M, False: 1.52M]
  ------------------
  274|  7.42M|         const char* first_tab = nullptr;
  275|  7.42M|         const char* first_content = nullptr;
  276|  7.42M|         const char* q = p;
  277|   558M|         while (q > floor) {
  ------------------
  |  Branch (277:17): [True: 555M, False: 2.59M]
  ------------------
  278|   555M|            const char c = *(q - 1);
  279|   555M|            if (c == '\n' || c == '\r') break;
  ------------------
  |  Branch (279:17): [True: 2.35M, False: 553M]
  |  Branch (279:30): [True: 2.47M, False: 550M]
  ------------------
  280|   550M|            --q;
  281|       |            // Walking backward, the last one seen is the earliest one on the line.
  282|   550M|            if (c == '\t')
  ------------------
  |  Branch (282:17): [True: 2.37M, False: 548M]
  ------------------
  283|  2.37M|               first_tab = q;
  284|   548M|            else if (c != ' ')
  ------------------
  |  Branch (284:22): [True: 524M, False: 23.7M]
  ------------------
  285|   524M|               first_content = q;
  286|   550M|         }
  287|  7.42M|         if (extends && q == floor) {
  ------------------
  |  Branch (287:14): [True: 5.90M, False: 1.52M]
  |  Branch (287:25): [True: 2.42M, False: 3.47M]
  ------------------
  288|       |            // The new bytes continue the memoized line, so anything it already found is earlier.
  289|  2.42M|            if (memo_first_tab) first_tab = memo_first_tab;
  ------------------
  |  Branch (289:17): [True: 165k, False: 2.26M]
  ------------------
  290|  2.42M|            if (memo_first_content) first_content = memo_first_content;
  ------------------
  |  Branch (290:17): [True: 1.63M, False: 796k]
  ------------------
  291|  2.42M|         }
  292|  4.99M|         else {
  293|  4.99M|            memo_line_begin = q;
  294|  4.99M|         }
  295|  7.42M|         memo_verified_end = p;
  296|  7.42M|         memo_first_tab = first_tab;
  297|  7.42M|         memo_first_content = first_content;
  298|  7.42M|      }
_ZN3glz4yaml12yaml_context10pop_indentEv:
  116|  6.08M|      {
  117|  6.08M|         if (!indent_stack.empty()) {
  ------------------
  |  Branch (117:14): [True: 6.08M, False: 0]
  ------------------
  118|  6.08M|            indent_stack.pop_back();
  119|  6.08M|         }
  120|  6.08M|      }
_ZN3glz4yaml17tag_valid_for_seqENS0_8yaml_tagE:
  781|  4.11M|   {
  782|  4.11M|      return tag == yaml_tag::none || tag == yaml_tag::seq;
  ------------------
  |  Branch (782:14): [True: 4.09M, False: 20.0k]
  |  Branch (782:39): [True: 19.9k, False: 24]
  ------------------
  783|  4.11M|   }
_ZN3glz4yaml12yaml_context20charge_key_expansionEm:
  194|  3.28M|      {
  195|  3.28M|         if (key_expansion_budget == 0) {
  ------------------
  |  Branch (195:14): [True: 0, False: 3.28M]
  ------------------
  196|      0|            return true; // unbudgeted
  197|      0|         }
  198|  3.28M|         if (bytes >= key_expansion_budget) {
  ------------------
  |  Branch (198:14): [True: 444, False: 3.28M]
  ------------------
  199|    444|            key_expansion_budget = 1; // latch: spent, and still not "unbudgeted"
  200|    444|            return false;
  201|    444|         }
  202|  3.28M|         key_expansion_budget -= bytes;
  203|  3.28M|         return true;
  204|  3.28M|      }
_ZN3glz4yaml14measure_indentILb0ERPKcS3_NS0_12yaml_contextEEEiOT0_T1_RT2_:
 1250|  2.09M|   {
 1251|  2.09M|      int32_t indent = 0;
 1252|  3.99M|      while (it != end && *it == ' ') {
  ------------------
  |  Branch (1252:14): [True: 3.86M, False: 137k]
  |  Branch (1252:27): [True: 1.89M, False: 1.96M]
  ------------------
 1253|  1.89M|         ++indent;
 1254|  1.89M|         ++it;
 1255|  1.89M|      }
 1256|       |      // YAML spec: "Tab characters must not be used for indentation"
 1257|       |      if constexpr (error_on_tab) {
 1258|       |         if (it != end && *it == '\t') {
 1259|       |            ctx.error = error_code::syntax_error;
 1260|       |         }
 1261|       |      }
 1262|  2.09M|      else {
 1263|       |         // In block scalar context: tabs after spaces are content, not indentation.
 1264|       |         // Only error when tab is the first character (pure tab indentation).
 1265|  2.09M|         if (indent == 0 && it != end && *it == '\t') {
  ------------------
  |  Branch (1265:14): [True: 1.03M, False: 1.06M]
  |  Branch (1265:29): [True: 900k, False: 136k]
  |  Branch (1265:42): [True: 242, False: 900k]
  ------------------
 1266|    242|            ctx.error = error_code::syntax_error;
 1267|    242|         }
 1268|  2.09M|      }
 1269|  2.09M|      return indent;
 1270|  2.09M|   }
_ZNK3glz4yaml12yaml_context16make_speculativeEv:
  339|  4.80M|      {
  340|  4.80M|         yaml_context c{};
  341|  4.80M|         c.indent_stack = indent_stack;
  342|  4.80M|         c.anchors = anchors;
  343|  4.80M|         c.active_alias_spans = active_alias_spans;
  344|       |         // Speculative work is real work: a probe that expands aliases spends the same budget,
  345|       |         // and the sites that adopt a probe's anchors adopt what it spent along with them.
  346|  4.80M|         c.alias_expansion_budget = alias_expansion_budget;
  347|       |         // Likewise for key text: a probe that built a complex key did the work whether or not
  348|       |         // its alternative is adopted, and an attempt that is never billed can be repeated free.
  349|  4.80M|         c.key_expansion_budget = key_expansion_budget;
  350|  4.80M|         c.sequence_item_value_context = sequence_item_value_context;
  351|  4.80M|         c.sequence_dash_indent = sequence_dash_indent;
  352|  4.80M|         c.explicit_mapping_key_context = explicit_mapping_key_context;
  353|  4.80M|         c.allow_indentless_sequence = allow_indentless_sequence;
  354|  4.80M|         c.stream_begin = stream_begin;
  355|       |         // The line memo only records what the buffer says, so a probe may keep using it.
  356|  4.80M|         c.memo_line_begin = memo_line_begin;
  357|  4.80M|         c.memo_verified_end = memo_verified_end;
  358|  4.80M|         c.memo_first_tab = memo_first_tab;
  359|  4.80M|         c.memo_first_content = memo_first_content;
  360|  4.80M|         c.secondary_tag_handle_overridden = secondary_tag_handle_overridden;
  361|       |         // Carry the recursion depth so a speculative type-probe shares the parent's budget
  362|       |         // and can't reset the stack-overflow guard partway down a deeply nested value.
  363|  4.80M|         c.depth = depth;
  364|  4.80M|         return c;
  365|  4.80M|      }
_ZNK3glz4yaml12yaml_context14current_indentEv:
  103|  87.8M|      int32_t current_indent() const noexcept { return indent_stack.empty() ? int32_t(-1) : indent_stack.back(); }
  ------------------
  |  Branch (103:56): [True: 60.5M, False: 27.2M]
  ------------------
_ZNK3glz4yaml12yaml_context18line_prefix_beforeEPKc:
  311|  10.7M|      {
  312|  10.7M|         const char* const begin = line_begin_of(p);
  313|  10.7M|         if (begin >= p) {
  ------------------
  |  Branch (313:14): [True: 2.06M, False: 8.65M]
  ------------------
  314|  2.06M|            return {};
  315|  2.06M|         }
  316|  8.65M|         return {int32_t(p - begin), memo_first_tab && memo_first_tab < p,
  ------------------
  |  Branch (316:38): [True: 2.55M, False: 6.09M]
  |  Branch (316:56): [True: 2.55M, False: 7.91k]
  ------------------
  317|  8.65M|                 memo_first_content && memo_first_content < p};
  ------------------
  |  Branch (317:18): [True: 7.92M, False: 721k]
  |  Branch (317:40): [True: 7.92M, False: 1.11k]
  ------------------
  318|  10.7M|      }
_ZN3glz4yaml12skip_newlineIRPKcS3_EEbOT_T0_:
  822|  89.4M|   {
  823|  89.4M|      if (it == end) return false;
  ------------------
  |  Branch (823:11): [True: 99.1k, False: 89.3M]
  ------------------
  824|       |
  825|  89.3M|      if (*it == '\r') {
  ------------------
  |  Branch (825:11): [True: 40.8M, False: 48.4M]
  ------------------
  826|  40.8M|         ++it;
  827|  40.8M|         if (it != end && *it == '\n') {
  ------------------
  |  Branch (827:14): [True: 39.7M, False: 1.12M]
  |  Branch (827:27): [True: 2.62M, False: 37.1M]
  ------------------
  828|  2.62M|            ++it;
  829|  2.62M|         }
  830|  40.8M|         return true;
  831|  40.8M|      }
  832|  48.4M|      else if (*it == '\n') {
  ------------------
  |  Branch (832:16): [True: 48.4M, False: 82]
  ------------------
  833|  48.4M|         ++it;
  834|  48.4M|         return true;
  835|  48.4M|      }
  836|     82|      return false;
  837|  89.3M|   }

_ZN3glz5parseILj450EE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   69|  32.8k|      {
   70|  32.8k|         if constexpr (requires { ctx.stream_begin; }) {
   71|  32.8k|            if (!ctx.stream_begin && it != end) {
  ------------------
  |  Branch (71:17): [True: 32.8k, False: 0]
  |  Branch (71:38): [True: 32.8k, False: 0]
  ------------------
   72|  32.8k|               ctx.stream_begin = &*it;
   73|       |               // The line memo holds pointers into whatever buffer filled it, so a reused
   74|       |               // context must not carry a previous read's into this one.
   75|  32.8k|               if constexpr (requires { ctx.reset_line_memo(); }) {
   76|  32.8k|                  ctx.reset_line_memo();
   77|  32.8k|               }
   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|  32.8k|               if constexpr (requires { ctx.alias_expansion_budget; } && requires { size_t(end - it); }) {
   82|  32.8k|                  const size_t scaled = size_t(end - it) * yaml::max_alias_expansion_factor;
   83|  32.8k|                  ctx.alias_expansion_budget =
   84|  32.8k|                     scaled > yaml::min_alias_expansion_bytes ? scaled : yaml::min_alias_expansion_bytes;
  ------------------
  |  Branch (84:22): [True: 160, False: 32.6k]
  ------------------
   85|  32.8k|               }
   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|  32.8k|               if constexpr (requires { ctx.key_expansion_budget; } && requires { size_t(end - it); }) {
   89|  32.8k|                  const size_t scaled = size_t(end - it) * yaml::max_key_expansion_factor;
   90|  32.8k|                  ctx.key_expansion_budget =
   91|  32.8k|                     scaled > yaml::min_key_expansion_bytes ? scaled : yaml::min_key_expansion_bytes;
  ------------------
  |  Branch (91:22): [True: 160, False: 32.6k]
  ------------------
   92|  32.8k|               }
   93|  32.8k|            }
   94|  32.8k|         }
   95|       |         // Skip YAML directives and document start marker (---) if present
   96|  32.8k|         yaml::skip_document_start(it, end, ctx);
   97|  32.8k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (97:14): [True: 259, False: 32.5k]
  ------------------
   98|    259|            return;
   99|    259|         }
  100|       |
  101|  32.5k|         using V = std::remove_cvref_t<T>;
  102|  32.5k|         if (it == end) {
  ------------------
  |  Branch (102:14): [True: 56, False: 32.5k]
  ------------------
  103|       |            // An empty document is a valid YAML null document.
  104|     56|            if constexpr (requires { value = nullptr; }) {
  105|     56|               value = nullptr;
  106|     56|               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|     56|         }
  117|       |
  118|       |         // A bare document boundary marker at root denotes an empty document.
  119|       |         // Examples: "---\n---\n", "# comment\n...\n"
  120|  32.5k|         if (yaml::at_document_start(it, end) || yaml::at_document_end(it, end)) {
  ------------------
  |  Branch (120:14): [True: 61, False: 32.5k]
  |  Branch (120:50): [True: 19, False: 32.4k]
  ------------------
  121|     24|            if constexpr (requires { value = nullptr; }) {
  122|     24|               value = nullptr;
  123|     24|               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|     24|         }
  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|  32.5k|         if constexpr (!check_partial_read(Opts)) {
  144|  32.5k|            if (!bool(ctx.error) && ctx.current_indent() < 0) {
  ------------------
  |  Branch (144:17): [True: 6.00k, False: 26.5k]
  |  Branch (144:37): [True: 6.00k, False: 0]
  ------------------
  145|  6.00k|               auto is_document_start = [&](auto pos) {
  146|  6.00k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  147|  6.00k|                     auto after = pos + 3;
  148|  6.00k|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  149|  6.00k|                            *after == '#';
  150|  6.00k|                  }
  151|  6.00k|                  return false;
  152|  6.00k|               };
  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|  6.00k|               if constexpr (requires { ctx.line_prefix_before(it); }) {
  162|  6.00k|                  if (it != end && ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (162:23): [True: 1.13k, False: 4.86k]
  |  Branch (162:23): [True: 796, False: 5.21k]
  |  Branch (162:36): [True: 796, False: 343]
  ------------------
  163|    796|                     auto rest = it;
  164|  1.44k|                     while (rest != end && (*rest == ' ' || *rest == '\t')) ++rest;
  ------------------
  |  Branch (164:29): [True: 1.41k, False: 30]
  |  Branch (164:45): [True: 367, False: 1.04k]
  |  Branch (164:61): [True: 283, False: 766]
  ------------------
  165|    796|                     if (rest != end && *rest != '\n' && *rest != '\r' && *rest != '#') {
  ------------------
  |  Branch (165:26): [True: 766, False: 30]
  |  Branch (165:41): [True: 560, False: 206]
  |  Branch (165:58): [True: 322, False: 238]
  |  Branch (165:75): [True: 239, False: 83]
  ------------------
  166|    239|                        ctx.error = error_code::syntax_error;
  167|    239|                        return;
  168|    239|                     }
  169|    796|                  }
  170|  6.00k|               }
  171|       |
  172|  5.76k|               auto tail_scan = it;
  173|  6.00k|               bool seen_document_end_marker = false;
  174|  14.4k|               while (tail_scan != end) {
  ------------------
  |  Branch (174:23): [True: 8.97k, False: 5.46k]
  ------------------
  175|  8.97k|                  auto line = tail_scan;
  176|  13.2k|                  while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (176:26): [True: 13.2k, False: 64]
  |  Branch (176:42): [True: 2.95k, False: 10.2k]
  |  Branch (176:58): [True: 1.35k, False: 8.90k]
  ------------------
  177|  8.97k|                  if (line != tail_scan && line != end && *line != '\n' && *line != '\r' && *line != '#') {
  ------------------
  |  Branch (177:23): [True: 2.31k, False: 6.65k]
  |  Branch (177:44): [True: 2.24k, False: 64]
  |  Branch (177:59): [True: 1.74k, False: 499]
  |  Branch (177:76): [True: 1.25k, False: 495]
  |  Branch (177:93): [True: 96, False: 1.15k]
  ------------------
  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|     96|                     const char first = *line;
  182|     96|                     const bool explicit_or_structural_start =
  183|     96|                        (first == ':' || first == '?' || first == '!' || first == '&' || first == '*' || first == '[' ||
  ------------------
  |  Branch (183:26): [True: 8, False: 88]
  |  Branch (183:42): [True: 2, False: 86]
  |  Branch (183:58): [True: 4, False: 82]
  |  Branch (183:74): [True: 3, False: 79]
  |  Branch (183:90): [True: 5, False: 74]
  |  Branch (183:106): [True: 4, False: 70]
  ------------------
  184|     70|                         first == '{' || first == '"' || first == '\'' || first == '-');
  ------------------
  |  Branch (184:26): [True: 2, False: 68]
  |  Branch (184:42): [True: 2, False: 66]
  |  Branch (184:58): [True: 3, False: 63]
  |  Branch (184:75): [True: 5, False: 58]
  ------------------
  185|     96|                     if (!explicit_or_structural_start) {
  ------------------
  |  Branch (185:26): [True: 58, False: 38]
  ------------------
  186|     58|                        auto scan = line;
  187|  1.67k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (187:32): [True: 1.65k, False: 23]
  |  Branch (187:47): [True: 1.64k, False: 5]
  |  Branch (187:64): [True: 1.64k, False: 5]
  ------------------
  188|  1.64k|                           if (*scan == ':') {
  ------------------
  |  Branch (188:32): [True: 362, False: 1.28k]
  ------------------
  189|    362|                              auto after = scan + 1;
  190|    362|                              if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (190:35): [True: 9, False: 353]
  |  Branch (190:51): [True: 6, False: 347]
  |  Branch (190:68): [True: 3, False: 344]
  |  Branch (190:86): [True: 3, False: 341]
  |  Branch (190:104): [True: 4, False: 337]
  ------------------
  191|     25|                                 ctx.error = error_code::syntax_error;
  192|     25|                                 return;
  193|     25|                              }
  194|    362|                           }
  195|  1.61k|                           ++scan;
  196|  1.61k|                        }
  197|     58|                     }
  198|     71|                     return;
  199|     96|                  }
  200|  8.87k|                  if (line == end) {
  ------------------
  |  Branch (200:23): [True: 64, False: 8.81k]
  ------------------
  201|     64|                     return;
  202|     64|                  }
  203|  8.81k|                  if (*line == ':' || *line == '?') {
  ------------------
  |  Branch (203:23): [True: 27, False: 8.78k]
  |  Branch (203:39): [True: 13, False: 8.77k]
  ------------------
  204|     40|                     return; // Explicit key/value continuation.
  205|     40|                  }
  206|  8.77k|                  if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (206:23): [True: 3.59k, False: 5.17k]
  |  Branch (206:40): [True: 2.46k, False: 2.71k]
  ------------------
  207|  6.05k|                     tail_scan = line;
  208|  6.05k|                     yaml::skip_newline(tail_scan, end);
  209|  6.05k|                     continue;
  210|  6.05k|                  }
  211|  2.71k|                  if (*line == '#') {
  ------------------
  |  Branch (211:23): [True: 1.95k, False: 757]
  ------------------
  212|  28.6k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (212:29): [True: 28.5k, False: 80]
  |  Branch (212:49): [True: 27.8k, False: 722]
  |  Branch (212:71): [True: 26.6k, False: 1.15k]
  ------------------
  213|  1.95k|                     yaml::skip_newline(tail_scan, end);
  214|  1.95k|                     continue;
  215|  1.95k|                  }
  216|    757|                  if (yaml::at_document_end(line, end)) {
  ------------------
  |  Branch (216:23): [True: 410, False: 347]
  ------------------
  217|    410|                     seen_document_end_marker = true;
  218|  5.08k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (218:29): [True: 5.00k, False: 74]
  |  Branch (218:49): [True: 4.91k, False: 97]
  |  Branch (218:71): [True: 4.67k, False: 239]
  ------------------
  219|    410|                     yaml::skip_newline(tail_scan, end);
  220|    410|                     continue;
  221|    410|                  }
  222|    347|                  if (is_document_start(line)) {
  ------------------
  |  Branch (222:23): [True: 107, False: 240]
  ------------------
  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|    107|                     auto header = line + 3;
  228|    756|                     while (header != end && (*header == ' ' || *header == '\t')) ++header;
  ------------------
  |  Branch (228:29): [True: 741, False: 15]
  |  Branch (228:47): [True: 327, False: 414]
  |  Branch (228:65): [True: 322, False: 92]
  ------------------
  229|    107|                     if (header != end && *header == '!') {
  ------------------
  |  Branch (229:26): [True: 92, False: 15]
  |  Branch (229:43): [True: 38, False: 54]
  ------------------
  230|     38|                        auto tag_end = header + 1;
  231|  46.0k|                        while (tag_end != end && *tag_end != ' ' && *tag_end != '\t' && *tag_end != '\n' &&
  ------------------
  |  Branch (231:32): [True: 46.0k, False: 9]
  |  Branch (231:50): [True: 46.0k, False: 13]
  |  Branch (231:69): [True: 46.0k, False: 10]
  |  Branch (231:89): [True: 46.0k, False: 2]
  ------------------
  232|  46.0k|                               *tag_end != '\r' && *tag_end != '#') {
  ------------------
  |  Branch (232:32): [True: 46.0k, False: 1]
  |  Branch (232:52): [True: 46.0k, False: 3]
  ------------------
  233|  46.0k|                           ++tag_end;
  234|  46.0k|                        }
  235|     38|                        std::string_view tag_token(header, static_cast<size_t>(tag_end - header));
  236|     38|                        const auto second_bang = tag_token.find('!', 1);
  237|     38|                        if (second_bang != std::string_view::npos) {
  ------------------
  |  Branch (237:29): [True: 22, False: 16]
  ------------------
  238|     22|                           std::string_view handle = tag_token.substr(0, second_bang + 1);
  239|     22|                           if (handle != "!" && handle != "!!") {
  ------------------
  |  Branch (239:32): [True: 22, False: 0]
  |  Branch (239:49): [True: 20, False: 2]
  ------------------
  240|     20|                              ctx.error = error_code::syntax_error;
  241|     20|                              return;
  242|     20|                           }
  243|     22|                        }
  244|     38|                     }
  245|     87|                     return; // Additional documents are allowed in the stream tail.
  246|    107|                  }
  247|    240|                  if (line != end && *line == '%') {
  ------------------
  |  Branch (247:23): [True: 240, False: 0]
  |  Branch (247:38): [True: 11, False: 229]
  ------------------
  248|       |                     // YAML directives are only valid in document prefixes. A directive
  249|       |                     // encountered mid-document (without a prior ...) is malformed.
  250|     11|                     if (!seen_document_end_marker) {
  ------------------
  |  Branch (250:26): [True: 8, False: 3]
  ------------------
  251|      8|                        ctx.error = error_code::syntax_error;
  252|      8|                        return;
  253|      8|                     }
  254|      3|                     return;
  255|     11|                  }
  256|    229|                  if (seen_document_end_marker) {
  ------------------
  |  Branch (256:23): [True: 35, False: 194]
  ------------------
  257|     35|                     return; // Implicit next document after explicit document end marker.
  258|     35|                  }
  259|    194|                  ctx.error = error_code::syntax_error;
  260|    194|                  return;
  261|    229|               }
  262|  6.00k|            }
  263|  32.5k|         }
  264|  32.5k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|   487k|      {
  275|   487k|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|   487k|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|   487k|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|   487k|      }
_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_:
 5635|   630k|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|   630k|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|   630k|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|   630k|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|   630k|                       "the internally tagged shape, so it is rejected here instead.");
 5642|   630k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 630k]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|   630k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|   630k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 37, False: 630k]
  ------------------
 5650|     37|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|   630k|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 88.2k, False: 541k]
  ------------------
 5655|  88.2k|            yaml::skip_ws_newlines_comments(it, end);
 5656|  88.2k|         }
 5657|   541k|         else {
 5658|   541k|            yaml::skip_inline_ws(it, end);
 5659|   541k|         }
 5660|       |
 5661|   630k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 69, False: 630k]
  ------------------
 5662|     69|            ctx.error = error_code::unexpected_end;
 5663|     69|            return;
 5664|     69|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|   630k|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|   630k|            using V = std::remove_cvref_t<T>;
 5772|   630k|            using counts = yaml_variant_type_count<V>;
 5773|   630k|            const char c = *it;
 5774|   630k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|   630k|               switch (ch) {
 5776|   630k|               case ' ':
 5777|   630k|               case '\t':
 5778|   630k|               case '\n':
 5779|   630k|               case '\r':
 5780|   630k|               case ',':
 5781|   630k|               case ']':
 5782|   630k|               case '}':
 5783|   630k|                  return true;
 5784|   630k|               default:
 5785|   630k|                  return false;
 5786|   630k|               }
 5787|   630k|            };
 5788|       |
 5789|   630k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|   630k|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|   630k|                  return false;
 5792|   630k|               }
 5793|   630k|               if (ctx.current_indent() < 0) {
 5794|   630k|                  return false;
 5795|   630k|               }
 5796|   630k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|   630k|                  return false;
 5798|   630k|               }
 5799|       |
 5800|   630k|               auto look = word_end;
 5801|   630k|               yaml::skip_newline(look, end);
 5802|   630k|               while (look != end) {
 5803|   630k|                  int32_t line_indent = 0;
 5804|   630k|                  while (look != end && *look == ' ') {
 5805|   630k|                     ++line_indent;
 5806|   630k|                     ++look;
 5807|   630k|                  }
 5808|   630k|                  if (look != end && *look == '\t') {
 5809|   630k|                     return false;
 5810|   630k|                  }
 5811|   630k|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|   630k|                     if (look != end) {
 5813|   630k|                        yaml::skip_newline(look, end);
 5814|   630k|                        continue;
 5815|   630k|                     }
 5816|   630k|                     return false;
 5817|   630k|                  }
 5818|   630k|                  if (*look == '#') {
 5819|   630k|                     yaml::skip_comment(look, end);
 5820|   630k|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|   630k|                        yaml::skip_newline(look, end);
 5822|   630k|                        continue;
 5823|   630k|                     }
 5824|   630k|                     return false;
 5825|   630k|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|   630k|                  {
 5831|   630k|                     auto scan = look;
 5832|   630k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|   630k|                        if (*scan == ':') {
 5834|   630k|                           auto after_colon = scan + 1;
 5835|   630k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|   630k|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|   630k|                              return false;
 5838|   630k|                           }
 5839|   630k|                        }
 5840|   630k|                        ++scan;
 5841|   630k|                     }
 5842|   630k|                  }
 5843|       |
 5844|   630k|                  return line_indent > ctx.current_indent();
 5845|   630k|               }
 5846|   630k|               return false;
 5847|   630k|            };
 5848|   630k|            auto is_word_boundary = [&](const auto ptr) {
 5849|   630k|               if (ptr == end) {
 5850|   630k|                  return true;
 5851|   630k|               }
 5852|   630k|               if (*ptr == ':') {
 5853|   630k|                  auto next = ptr + 1;
 5854|   630k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|   630k|               }
 5856|   630k|               return is_plain_scalar_boundary(*ptr);
 5857|   630k|            };
 5858|       |
 5859|   630k|            switch (c) {
 5860|   118k|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 118k, False: 511k]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|   118k|               ++it;
 5863|   118k|               auto aname = yaml::parse_anchor_name(it, end);
 5864|   118k|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 72, False: 118k]
  ------------------
 5865|     72|                  ctx.error = error_code::syntax_error;
 5866|     72|                  return;
 5867|     72|               }
 5868|   118k|               yaml::skip_inline_ws(it, end);
 5869|   118k|               bool anchor_on_same_line = true;
 5870|   118k|               bool value_is_indentless_sequence = false;
 5871|   118k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 3.24k, False: 114k]
  |  Branch (5871:33): [True: 19.9k, False: 94.9k]
  |  Branch (5871:48): [True: 8.92k, False: 85.9k]
  |  Branch (5871:63): [True: 2.52k, False: 83.4k]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|  34.6k|                  bool value_on_next_line = false;
 5875|  34.6k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 31.4k, False: 3.24k]
  ------------------
 5876|  31.4k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|  31.4k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 2.52k, False: 28.8k]
  ------------------
 5879|  1.46M|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 1.46M, False: 109]
  |  Branch (5879:47): [True: 1.46M, False: 979]
  |  Branch (5879:64): [True: 1.46M, False: 1.44k]
  ------------------
 5880|  2.52k|                     }
 5881|       |                     // Skip newline
 5882|  31.4k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 31.3k, False: 109]
  |  Branch (5882:42): [True: 20.9k, False: 10.3k]
  |  Branch (5882:59): [True: 10.3k, False: 0]
  ------------------
 5883|  31.3k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|  45.3k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 42.8k, False: 2.49k]
  |  Branch (5885:48): [True: 1.03k, False: 41.7k]
  |  Branch (5885:65): [True: 12.9k, False: 28.8k]
  ------------------
 5886|  14.0k|                           yaml::skip_newline(peek, end);
 5887|  14.0k|                        }
 5888|       |                        // Measure indent of next content line
 5889|  31.3k|                        int32_t next_indent = 0;
 5890|  45.7k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 43.1k, False: 2.67k]
  |  Branch (5890:47): [True: 14.4k, False: 28.6k]
  ------------------
 5891|  14.4k|                           ++next_indent;
 5892|  14.4k|                           ++peek;
 5893|  14.4k|                        }
 5894|  31.3k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 28.6k, False: 2.67k]
  |  Branch (5894:44): [True: 28.2k, False: 405]
  |  Branch (5894:61): [True: 27.9k, False: 269]
  ------------------
 5895|  27.9k|                           const bool indentless_sequence =
 5896|  27.9k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 23.8k, False: 4.13k]
  |  Branch (5896:69): [True: 17.2k, False: 6.57k]
  ------------------
 5897|  17.2k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 45, False: 17.2k]
  ------------------
 5898|  17.2k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 16.9k, False: 244]
  ------------------
 5899|  17.0k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 14.8k, False: 2.20k]
  ------------------
 5900|  2.20k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 1.04k, False: 1.15k]
  |  Branch (5900:61): [True: 689, False: 354]
  ------------------
 5901|  27.9k|                           value_is_indentless_sequence = indentless_sequence;
 5902|  27.9k|                           const bool same_indent_property_node =
 5903|  27.9k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 18.2k, False: 9.71k]
  ------------------
 5904|  18.2k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 479, False: 17.7k]
  |  Branch (5904:48): [True: 1.73k, False: 16.0k]
  |  Branch (5904:64): [True: 16, False: 16.0k]
  |  Branch (5904:80): [True: 290, False: 15.7k]
  |  Branch (5904:96): [True: 10, False: 15.7k]
  ------------------
 5905|  15.7k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 1, False: 15.7k]
  |  Branch (5905:48): [True: 8, False: 15.7k]
  |  Branch (5905:65): [True: 287, False: 15.4k]
  |  Branch (5905:81): [True: 31, False: 15.3k]
  ------------------
 5906|  27.9k|                           value_on_next_line =
 5907|  27.9k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 7.36k, False: 20.5k]
  |  Branch (5907:71): [True: 15.4k, False: 5.09k]
  |  Branch (5907:94): [True: 2.86k, False: 2.23k]
  ------------------
 5908|  27.9k|                        }
 5909|  31.3k|                     }
 5910|  31.4k|                  }
 5911|  34.6k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 8.94k, False: 25.7k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  8.94k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  8.94k|                     return;
 5915|  8.94k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|  25.7k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 1.54k, False: 24.1k]
  ------------------
 5918|  1.43M|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 1.43M, False: 0]
  |  Branch (5918:42): [True: 1.43M, False: 554]
  |  Branch (5918:57): [True: 1.43M, False: 990]
  ------------------
 5919|  1.54k|                  }
 5920|  25.7k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 25.7k, False: 0]
  ------------------
 5921|  29.7k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 29.7k, False: 0]
  |  Branch (5921:40): [True: 741, False: 29.0k]
  |  Branch (5921:55): [True: 3.29k, False: 25.7k]
  ------------------
 5922|  4.03k|                     yaml::skip_newline(it, end);
 5923|  4.03k|                  }
 5924|  25.7k|                  yaml::skip_inline_ws(it, end);
 5925|  25.7k|                  anchor_on_same_line = false;
 5926|  25.7k|               }
 5927|       |
 5928|   109k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|   109k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (5929:23): [True: 83.4k, False: 25.7k]
  |  Branch (5929:46): [True: 519, False: 82.9k]
  ------------------
 5930|    519|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (5930:24): [True: 10, False: 509]
  |  Branch (5930:43): [True: 7, False: 502]
  ------------------
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|     17|                     ctx.error = error_code::syntax_error;
 5933|     17|                     return;
 5934|     17|                  }
 5935|   109k|               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|   109k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 109k, False: 27]
  |  Branch (5939:33): [True: 1.65k, False: 107k]
  |  Branch (5939:47): [True: 85, False: 1.56k]
  ------------------
 5940|     85|                  ctx.error = error_code::syntax_error;
 5941|     85|                  return;
 5942|     85|               }
 5943|       |
 5944|   109k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|   109k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (5945:23): [True: 25.7k, False: 83.3k]
  |  Branch (5945:47): [True: 25.7k, False: 10]
  |  Branch (5945:60): [True: 2.45k, False: 23.2k]
  ------------------
 5946|  2.45k|                     auto probe = it + 1;
 5947|  2.45k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|  2.45k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (5948:26): [True: 12, False: 2.43k]
  ------------------
 5949|     12|                        ctx.error = error_code::syntax_error;
 5950|     12|                        return;
 5951|     12|                     }
 5952|  2.43k|                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|  2.43k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (5956:26): [True: 42, False: 2.39k]
  ------------------
 5957|     42|                        ctx.error = error_code::syntax_error;
 5958|     42|                        return;
 5959|     42|                     }
 5960|  2.43k|                  }
 5961|   109k|               }
 5962|       |
 5963|   109k|               const char* anchor_start = &*it;
 5964|   109k|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|   109k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|   109k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (5970:23): [True: 83.3k, False: 25.7k]
  |  Branch (5970:46): [True: 32.3k, False: 51.0k]
  ------------------
 5971|  32.3k|                     auto key_start = it;
 5972|  32.3k|                     if (*key_start == '!') {
  ------------------
  |  Branch (5972:26): [True: 918, False: 31.4k]
  ------------------
 5973|    918|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|    918|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (5974:29): [True: 7, False: 911]
  |  Branch (5974:67): [True: 12, False: 899]
  ------------------
 5975|     19|                           ctx.error = error_code::syntax_error;
 5976|     19|                           return;
 5977|     19|                        }
 5978|    899|                        yaml::skip_inline_ws(key_start, end);
 5979|    899|                        if (key_start == end) {
  ------------------
  |  Branch (5979:29): [True: 1, False: 898]
  ------------------
 5980|      1|                           ctx.error = error_code::unexpected_end;
 5981|      1|                           return;
 5982|      1|                        }
 5983|    898|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (5983:29): [True: 1, False: 897]
  |  Branch (5983:51): [True: 1, False: 896]
  ------------------
 5984|      2|                           ctx.error = error_code::syntax_error;
 5985|      2|                           return;
 5986|      2|                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|    896|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (5992:29): [True: 331, False: 565]
  |  Branch (5992:50): [True: 4, False: 327]
  ------------------
 5993|      4|                           ctx.error = error_code::syntax_error;
 5994|      4|                           return;
 5995|      4|                        }
 5996|    896|                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|  32.3k|                     auto key_scan = key_start;
 6000|  32.3k|                     auto key_end = key_start;
 6001|  32.3k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6001:26): [True: 352, False: 31.9k]
  |  Branch (6001:46): [True: 203, False: 31.7k]
  ------------------
 6002|       |                        // Quoted key: skip to closing quote
 6003|    555|                        const char quote = *key_scan;
 6004|    555|                        ++key_scan;
 6005|  4.27k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6005:32): [True: 4.27k, False: 2]
  |  Branch (6005:51): [True: 3.72k, False: 553]
  ------------------
 6006|  3.72k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6006:32): [True: 716, False: 3.00k]
  |  Branch (6006:53): [True: 325, False: 391]
  ------------------
 6007|    325|                              ++key_scan;
 6008|    325|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6008:35): [True: 325, False: 0]
  ------------------
 6009|    325|                           }
 6010|  3.39k|                           else {
 6011|  3.39k|                              ++key_scan;
 6012|  3.39k|                           }
 6013|  3.72k|                        }
 6014|    555|                        if (key_scan == end) {
  ------------------
  |  Branch (6014:29): [True: 2, False: 553]
  ------------------
 6015|      2|                           ctx.error = error_code::syntax_error;
 6016|      2|                           return;
 6017|      2|                        }
 6018|    553|                        ++key_scan; // past closing quote
 6019|    553|                        key_end = key_scan;
 6020|    553|                        yaml::skip_inline_ws(key_scan, end);
 6021|    553|                     }
 6022|  31.7k|                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|  1.30M|                        while (key_scan != end) {
  ------------------
  |  Branch (6024:32): [True: 1.30M, False: 1]
  ------------------
 6025|  1.30M|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6025:32): [True: 64.2k, False: 1.23M]
  ------------------
 6026|  64.2k|                              auto next = key_scan + 1;
 6027|  64.2k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6027:35): [True: 1.12k, False: 63.1k]
  |  Branch (6027:50): [True: 22.4k, False: 40.6k]
  |  Branch (6027:66): [True: 1.68k, False: 38.9k]
  |  Branch (6027:83): [True: 1.61k, False: 37.3k]
  |  Branch (6027:100): [True: 4.88k, False: 32.4k]
  ------------------
 6028|  31.7k|                                 break;
 6029|  31.7k|                              }
 6030|  64.2k|                           }
 6031|  1.27M|                           ++key_scan;
 6032|  1.27M|                        }
 6033|  31.7k|                        key_end = key_scan;
 6034|  38.0k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6034:32): [True: 36.1k, False: 1.87k]
  |  Branch (6034:57): [True: 5.73k, False: 30.4k]
  |  Branch (6034:82): [True: 538, False: 29.8k]
  ------------------
 6035|  6.27k|                           --key_end;
 6036|  6.27k|                        }
 6037|  31.7k|                     }
 6038|  32.3k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6038:26): [True: 2, False: 32.3k]
  |  Branch (6038:45): [True: 58, False: 32.2k]
  ------------------
 6039|     60|                        ctx.error = error_code::syntax_error;
 6040|     60|                        return;
 6041|     60|                     }
 6042|       |                     // Store anchor with just the key text span
 6043|  32.2k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|  32.2k|                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|  32.2k|                     if constexpr (counts::n_object > 0) {
 6047|  32.2k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|  32.2k|                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|  32.2k|                     return;
 6054|  32.3k|                  }
 6055|   109k|               }
 6056|       |
 6057|  76.7k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|   109k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|   109k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|   109k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|   109k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 74.4k, False: 34.6k]
  ------------------
 6062|  74.4k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|  74.4k|               }
 6064|   109k|               return;
 6065|   109k|            }
 6066|  44.4k|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 44.4k, False: 585k]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|  44.4k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|  44.4k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6069:23): [True: 3.08k, False: 41.3k]
  ------------------
 6070|  3.08k|                     if constexpr (counts::n_object > 0) {
 6071|  3.08k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|  3.08k|                                                                                                        end);
 6073|  3.08k|                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|  3.08k|                  }
 6080|  44.4k|               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|  44.4k|               return;
 6085|   109k|            }
 6086|  45.5k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 45.5k, False: 584k]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|  45.5k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|  45.5k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 68, False: 45.4k]
  ------------------
 6090|     68|                  ctx.error = error_code::syntax_error;
 6091|     68|                  return;
 6092|     68|               }
 6093|  45.4k|               yaml::skip_inline_ws(it, end);
 6094|  45.4k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 45.1k, False: 319]
  |  Branch (6094:33): [True: 2.25k, False: 42.8k]
  ------------------
 6095|  2.25k|                  yaml::skip_comment(it, end);
 6096|  2.25k|               }
 6097|  45.4k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 45.1k, False: 360]
  |  Branch (6097:34): [True: 1.67k, False: 43.4k]
  |  Branch (6097:49): [True: 5.02k, False: 38.4k]
  ------------------
 6098|  6.69k|                  auto content = it;
 6099|  6.69k|                  yaml::skip_newline(content, end);
 6100|  6.69k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  6.69k|                  bool consume_following_content = false;
 6103|  6.69k|                  auto content_token = content;
 6104|  6.69k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 6.37k, False: 324]
  ------------------
 6105|  6.37k|                     auto indent_probe = content;
 6106|  6.37k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  6.37k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 2, False: 6.36k]
  ------------------
 6108|      2|                        return;
 6109|  6.36k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  6.36k|                     bool tagged_indentless_sequence = false;
 6114|  6.36k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 2.42k, False: 3.94k]
  |  Branch (6114:56): [True: 2.42k, False: 0]
  |  Branch (6114:79): [True: 2.36k, False: 62]
  ------------------
 6115|  2.36k|                        const auto after_dash = indent_probe + 1;
 6116|  2.36k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 11, False: 2.35k]
  ------------------
 6117|  2.35k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 2.05k, False: 295]
  ------------------
 6118|  2.07k|                           tagged_indentless_sequence =
 6119|  2.07k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 443, False: 1.62k]
  ------------------
 6120|  1.62k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 432, False: 1.19k]
  |  Branch (6120:60): [True: 411, False: 21]
  ------------------
 6121|  2.07k|                        }
 6122|  2.36k|                     }
 6123|       |
 6124|  6.36k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 1.24k, False: 5.12k]
  ------------------
 6125|  5.12k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 2.03k, False: 3.08k]
  |  Branch (6125:93): [True: 854, False: 2.23k]
  ------------------
 6126|  6.36k|                  }
 6127|       |
 6128|  6.69k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 4.13k, False: 2.55k]
  ------------------
 6129|  4.13k|                     it = content_token;
 6130|  4.13k|                  }
 6131|  2.55k|                  else {
 6132|  2.55k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 43, False: 2.51k]
  ------------------
 6133|     43|                        if constexpr (counts::n_str > 0) {
 6134|     43|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|     43|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|     43|                           value = StrType{};
 6137|     43|                           return;
 6138|     43|                        }
 6139|     43|                     }
 6140|  2.55k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 28, False: 2.52k]
  ------------------
 6141|     28|                        if constexpr (counts::n_null > 0) {
 6142|     28|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|     28|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|     28|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 28]
  ------------------
 6145|     28|                           return;
 6146|     28|                        }
 6147|     28|                     }
 6148|  2.55k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 2.16k, False: 388]
  ------------------
 6149|  2.16k|                        if constexpr (counts::n_null > 0) {
 6150|  2.16k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  2.16k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  2.16k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 2.16k]
  ------------------
 6153|  2.16k|                           return;
 6154|  2.16k|                        }
 6155|  2.16k|                     }
 6156|  2.55k|                  }
 6157|  6.69k|               }
 6158|  45.4k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|  45.4k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6161:23): [True: 42.8k, False: 2.60k]
  |  Branch (6161:36): [True: 11, False: 42.8k]
  ------------------
 6162|     11|                     ctx.error = error_code::syntax_error;
 6163|     11|                     return;
 6164|     11|                  }
 6165|  45.4k|                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|  45.4k|                     const bool starts_block_sequence_entry =
 6168|  45.4k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6168:26): [True: 42.8k, False: 2.60k]
  |  Branch (6168:39): [True: 3.25k, False: 39.6k]
  ------------------
 6169|  3.25k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6169:26): [True: 97, False: 3.15k]
  |  Branch (6169:45): [True: 2.68k, False: 473]
  ------------------
 6170|  45.4k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6170:26): [True: 40.4k, False: 5.01k]
  |  Branch (6170:58): [True: 3.19k, False: 37.2k]
  ------------------
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|  3.19k|                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|  3.19k|                        return;
 6175|  3.19k|                     }
 6176|  45.4k|                  }
 6177|  45.4k|               }
 6178|  45.4k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 360, False: 45.1k]
  ------------------
 6179|    360|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 103, False: 257]
  ------------------
 6180|    103|                     if constexpr (counts::n_str > 0) {
 6181|    103|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    103|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    103|                        value = StrType{};
 6184|    103|                        return;
 6185|    103|                     }
 6186|    103|                  }
 6187|    360|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 250, False: 110]
  ------------------
 6188|    250|                     if constexpr (counts::n_null > 0) {
 6189|    250|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|    250|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|    250|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 250]
  ------------------
 6192|    250|                        return;
 6193|    250|                     }
 6194|    250|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|    360|                  return;
 6197|    360|               }
 6198|  45.1k|               switch (tag) {
 6199|    290|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 290, False: 44.8k]
  ------------------
 6200|    290|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|    290|                  return;
 6202|    900|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 900, False: 44.2k]
  ------------------
 6203|    906|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 6, False: 45.1k]
  ------------------
 6204|    906|                  if constexpr (counts::n_num > 0) {
 6205|    906|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|    906|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  3.11k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 2.21k, False: 42.8k]
  ------------------
 6213|  3.11k|                  if constexpr (counts::n_bool > 0) {
 6214|  3.11k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  3.11k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  3.29k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 177, False: 44.9k]
  ------------------
 6222|  3.29k|                  if constexpr (counts::n_null > 0) {
 6223|  3.29k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  3.29k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  3.29k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 3.29k]
  ------------------
 6226|  3.29k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  3.29k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  4.55k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 1.25k, False: 43.8k]
  ------------------
 6234|  4.55k|                  if constexpr (counts::n_object > 0) {
 6235|  4.55k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  4.55k|                                                                                                     end);
 6237|  4.55k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|  9.01k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 4.46k, False: 40.6k]
  ------------------
 6244|  9.01k|                  if constexpr (counts::n_array > 0) {
 6245|  9.01k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|  9.01k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|  9.01k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6247:29): [True: 4.46k, False: 4.55k]
  |  Branch (6247:42): [True: 2.28k, False: 2.18k]
  ------------------
 6248|  2.28k|                           ctx.allow_indentless_sequence = true;
 6249|  2.28k|                        }
 6250|  9.01k|                     }
 6251|  9.01k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|  9.01k|                                                                                                    end);
 6253|  9.01k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|  9.01k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|  39.3k|               default: {
  ------------------
  |  Branch (6260:16): [True: 30.3k, False: 14.7k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|  39.3k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 30.3k, False: 9.01k]
  |  Branch (6263:36): [True: 23.2k, False: 7.11k]
  ------------------
 6264|  23.2k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  23.2k|                     return;
 6266|  23.2k|                  }
 6267|       |
 6268|  16.1k|                  if constexpr (counts::n_array > 0) {
 6269|  16.1k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 7.11k, False: 9.01k]
  |  Branch (6269:39): [True: 75, False: 7.03k]
  ------------------
 6270|     75|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|     75|                                                                                                       end);
 6272|     75|                        return;
 6273|     75|                     }
 6274|  16.1k|                  }
 6275|  16.1k|                  if constexpr (counts::n_object > 0) {
 6276|  16.1k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 7.03k, False: 9.08k]
  |  Branch (6276:39): [True: 289, False: 6.74k]
  ------------------
 6277|    289|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|    289|                                                                                                        end);
 6279|    289|                        return;
 6280|    289|                     }
 6281|  16.1k|                  }
 6282|       |
 6283|  16.1k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|  16.1k|                     if constexpr (counts::n_array > 0) {
 6285|  16.1k|                        const bool starts_block_sequence_entry =
 6286|  16.1k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6286:29): [True: 6.74k, False: 9.37k]
  |  Branch (6286:42): [True: 408, False: 6.33k]
  ------------------
 6287|    408|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6287:29): [True: 82, False: 326]
  |  Branch (6287:48): [True: 161, False: 165]
  ------------------
 6288|  16.1k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6288:29): [True: 243, False: 15.8k]
  ------------------
 6289|    243|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|    243|                                                                                                          it, end);
 6291|    243|                           return;
 6292|    243|                        }
 6293|  16.1k|                     }
 6294|  16.1k|                     if constexpr (counts::n_object > 0) {
 6295|  16.1k|                        const bool starts_explicit_mapping_indicator =
 6296|  16.1k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6296:29): [True: 6.50k, False: 9.62k]
  |  Branch (6296:43): [True: 997, False: 5.50k]
  |  Branch (6296:57): [True: 246, False: 5.26k]
  ------------------
 6297|  1.24k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6297:29): [True: 322, False: 921]
  |  Branch (6297:48): [True: 639, False: 282]
  ------------------
 6298|  16.1k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6298:29): [True: 961, False: 15.1k]
  ------------------
 6299|    961|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|    961|                                                                                                           it, end);
 6301|    961|                           return;
 6302|    961|                        }
 6303|  15.1k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6303:29): [True: 0, False: 15.1k]
  ------------------
 6304|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|      0|                                                                                                           it, end);
 6306|      0|                           return;
 6307|      0|                        }
 6308|  15.1k|                     }
 6309|  16.1k|                  }
 6310|       |
 6311|  16.1k|                  if constexpr (counts::n_str > 0) {
 6312|  16.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|  16.1k|                     return;
 6314|  16.1k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|  16.1k|                  return;
 6319|  39.3k|               }
 6320|  45.1k|               }
 6321|      0|               return;
 6322|  45.1k|            }
 6323|  24.2k|            case '{':
  ------------------
  |  Branch (6323:13): [True: 24.2k, False: 605k]
  ------------------
 6324|  24.2k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|  24.2k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6326:23): [True: 5.48k, False: 18.7k]
  |  Branch (6326:51): [True: 769, False: 4.71k]
  ------------------
 6327|    769|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|    769|                                                                                                     end);
 6329|    769|                     return;
 6330|    769|                  }
 6331|  24.2k|               }
 6332|       |               // Flow mapping - object type
 6333|  23.4k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|  24.2k|               return;
 6335|  26.0k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 26.0k, False: 604k]
  ------------------
 6336|  26.0k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|  26.0k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6338:23): [True: 16.8k, False: 9.26k]
  |  Branch (6338:51): [True: 292, False: 16.5k]
  ------------------
 6339|    292|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|    292|                                                                                                     end);
 6341|    292|                     return;
 6342|    292|                  }
 6343|  26.0k|               }
 6344|       |               // Flow sequence - array type
 6345|  25.8k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|  26.0k|               return;
 6347|   118k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 118k, False: 511k]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   118k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 118k, False: 210]
  |  Branch (6349:39): [True: 4, False: 118k]
  ------------------
 6350|      4|                  ctx.error = error_code::syntax_error;
 6351|      4|                  return;
 6352|      4|               }
 6353|   118k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 118k, False: 210]
  |  Branch (6353:40): [True: 38.3k, False: 79.9k]
  |  Branch (6353:56): [True: 71.6k, False: 8.28k]
  |  Branch (6353:73): [True: 5.07k, False: 3.20k]
  ------------------
 6354|   115k|                  if constexpr (counts::n_object > 0) {
 6355|   115k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   115k|                                                                                                     end);
 6357|   115k|                     return;
 6358|   115k|                  }
 6359|   115k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   118k|               return;
 6362|      8|            case '%':
  ------------------
  |  Branch (6362:13): [True: 8, False: 630k]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|      8|               ctx.error = error_code::syntax_error;
 6365|      8|               return;
 6366|    534|            case '"':
  ------------------
  |  Branch (6366:13): [True: 534, False: 629k]
  ------------------
 6367|  1.77k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 1.24k, False: 628k]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  1.77k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  1.77k|               return;
 6372|  6.23k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 6.23k, False: 623k]
  ------------------
 6373|  15.4k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 9.17k, False: 621k]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  15.4k|               if constexpr (counts::n_bool > 0) {
 6376|  15.4k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 14.9k, False: 451]
  |  Branch (6376:44): [True: 11.9k, False: 3.04k]
  |  Branch (6376:60): [True: 11.3k, False: 595]
  |  Branch (6376:76): [True: 10.1k, False: 1.15k]
  ------------------
 6377|  10.1k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 1.71k, False: 3.08k]
  |  Branch (6377:60): [True: 1.20k, False: 512]
  |  Branch (6377:76): [True: 21, False: 1.18k]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  10.1k|                     const auto after_true = it + 4;
 6380|  10.1k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  10.1k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 9.65k, False: 525]
  ------------------
 6383|  9.65k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 69, False: 9.58k]
  ------------------
 6384|     69|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|     69|                           return;
 6386|     69|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  9.58k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 9.49k, False: 91]
  |  Branch (6389:47): [True: 6.85k, False: 2.64k]
  ------------------
 6390|  6.85k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 347, False: 6.50k]
  |  Branch (6390:47): [True: 6.41k, False: 86]
  |  Branch (6390:63): [True: 19, False: 67]
  |  Branch (6390:80): [True: 24, False: 43]
  |  Branch (6390:97): [True: 43, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  6.85k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  6.85k|                           return;
 6394|  6.85k|                        }
 6395|  2.73k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  2.73k|                                                                                                      end);
 6397|  2.73k|                        return;
 6398|  9.58k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  10.1k|                  }
 6401|  15.4k|               }
 6402|  5.75k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  15.4k|               return;
 6404|  5.72k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 5.72k, False: 624k]
  ------------------
 6405|  10.1k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 4.38k, False: 625k]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|  10.1k|               if constexpr (counts::n_bool > 0) {
 6408|  10.1k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 9.77k, False: 336]
  |  Branch (6408:44): [True: 5.97k, False: 3.79k]
  |  Branch (6408:60): [True: 2.87k, False: 3.10k]
  |  Branch (6408:76): [True: 2.70k, False: 174]
  |  Branch (6408:92): [True: 2.36k, False: 334]
  ------------------
 6409|  7.40k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 1.52k, False: 5.88k]
  |  Branch (6409:60): [True: 1.21k, False: 304]
  |  Branch (6409:76): [True: 902, False: 315]
  |  Branch (6409:92): [True: 870, False: 32]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  3.23k|                     const auto after_false = it + 5;
 6412|  3.23k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  3.23k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 2.72k, False: 516]
  ------------------
 6415|  2.72k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 162, False: 2.56k]
  ------------------
 6416|    162|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|    162|                           return;
 6418|    162|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  2.56k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 2.43k, False: 128]
  |  Branch (6421:47): [True: 1.60k, False: 825]
  ------------------
 6422|  1.60k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 29, False: 1.57k]
  |  Branch (6422:47): [True: 280, False: 1.29k]
  |  Branch (6422:63): [True: 848, False: 450]
  |  Branch (6422:80): [True: 81, False: 369]
  |  Branch (6422:97): [True: 369, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  1.60k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  1.60k|                           return;
 6426|  1.60k|                        }
 6427|    953|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|    953|                                                                                                      end);
 6429|    953|                        return;
 6430|  2.56k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  3.23k|                  }
 6433|  10.1k|               }
 6434|  7.38k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|  10.1k|               return;
 6436|  5.10k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 5.10k, False: 625k]
  ------------------
 6437|  6.67k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 1.57k, False: 628k]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  6.67k|               if constexpr (counts::n_null > 0) {
 6440|  6.67k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 5.88k, False: 791]
  |  Branch (6440:44): [True: 3.41k, False: 2.47k]
  |  Branch (6440:60): [True: 2.77k, False: 646]
  |  Branch (6440:76): [True: 2.42k, False: 344]
  ------------------
 6441|  3.46k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 1.78k, False: 1.68k]
  |  Branch (6441:60): [True: 1.28k, False: 500]
  |  Branch (6441:76): [True: 105, False: 1.17k]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  2.53k|                     const auto after_null = it + 4;
 6444|  2.53k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  2.53k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 2.37k, False: 155]
  ------------------
 6447|  2.37k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 134, False: 2.24k]
  ------------------
 6448|    134|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|    134|                           return;
 6450|    134|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  2.24k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 2.08k, False: 157]
  |  Branch (6453:47): [True: 1.37k, False: 713]
  ------------------
 6454|  1.37k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 297, False: 1.07k]
  |  Branch (6454:47): [True: 297, False: 780]
  |  Branch (6454:63): [True: 182, False: 598]
  |  Branch (6454:80): [True: 527, False: 71]
  |  Branch (6454:97): [True: 71, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  1.37k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  1.37k|                           return;
 6458|  1.37k|                        }
 6459|    870|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|    870|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|    870|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 870]
  ------------------
 6462|    870|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|    870|                        return;
 6464|  2.24k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  2.53k|                  }
 6467|  6.67k|               }
 6468|  4.30k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  6.67k|               return;
 6470|    383|            case '~':
  ------------------
  |  Branch (6470:13): [True: 383, False: 629k]
  ------------------
 6471|       |               // Null indicator
 6472|    383|               if constexpr (counts::n_null > 0) {
 6473|    383|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|    383|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|    383|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 383]
  ------------------
 6476|    383|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|    383|                  return;
 6478|    383|               }
 6479|      0|               break; // Fall through to try other types
 6480|  48.4k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 48.4k, False: 581k]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|  48.4k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 200, False: 48.2k]
  |  Branch (6482:41): [True: 43.0k, False: 5.27k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|  43.2k|                  if constexpr (counts::n_array > 0) {
 6485|  43.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|  43.2k|                                                                                                    end);
 6487|  43.2k|                     return;
 6488|  43.2k|                  }
 6489|  43.2k|               }
 6490|  48.4k|               if constexpr (counts::n_num > 0) {
 6491|  48.4k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 5.27k, False: 43.2k]
  |  Branch (6491:43): [True: 573, False: 4.70k]
  |  Branch (6491:94): [True: 385, False: 4.32k]
  ------------------
 6492|    958|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|    958|                     return;
 6494|    958|                  }
 6495|  48.4k|               }
 6496|  47.5k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|  48.4k|               return;
 6498|  2.01k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 2.01k, False: 628k]
  ------------------
 6499|  7.01k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 4.99k, False: 625k]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  7.01k|               if constexpr (counts::n_num > 0) {
 6503|  7.01k|                  auto start_it = it;
 6504|  7.01k|                  auto temp_ctx = ctx.make_speculative();
 6505|  7.01k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  7.01k|                                                                                               end);
 6507|  7.01k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  7.01k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  7.01k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 1.31k, False: 5.69k]
  ------------------
 6510|  1.31k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  1.31k|                     return; // Successfully parsed as number
 6512|  1.31k|                  }
 6513|  5.69k|                  it = start_it; // Restore and fall through to string
 6514|  5.69k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  7.01k|               return;
 6517|   163k|            default:
  ------------------
  |  Branch (6517:13): [True: 163k, False: 466k]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|   163k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 125k, False: 37.7k]
  |  Branch (6519:32): [True: 38.9k, False: 86.6k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|  38.9k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 26.2k, False: 12.6k]
  ------------------
 6522|  26.2k|                     return;
 6523|  26.2k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|  12.6k|                  if constexpr (counts::n_num > 0) {
 6526|  12.6k|                     auto start_it = it;
 6527|  12.6k|                     auto temp_ctx = ctx.make_speculative();
 6528|  12.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|  12.6k|                                                                                                  end);
 6530|  12.6k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|  12.6k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|  12.6k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 1.95k, False: 10.7k]
  ------------------
 6533|  1.95k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|  1.95k|                        return; // Successfully parsed as number
 6535|  1.95k|                     }
 6536|  10.7k|                     it = start_it; // Restore and fall through to string
 6537|  10.7k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|  12.6k|                  return;
 6541|  38.9k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   124k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   124k|               return;
 6545|   630k|            }
 6546|   630k|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|   630k|         error_code expansion_error{};
 6556|   630k|         std::string_view expansion_message{};
 6557|       |
 6558|   630k|         auto try_parse = [&]<size_t I>() -> bool {
 6559|   630k|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|   630k|            auto start = it;
 6561|       |
 6562|   630k|            V v{};
 6563|   630k|            auto temp_ctx = ctx.make_speculative();
 6564|   630k|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|   630k|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|   630k|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|   630k|            if (!bool(temp_ctx.error)) {
 6569|   630k|               value = std::move(v);
 6570|   630k|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|   630k|               return true;
 6572|   630k|            }
 6573|       |
 6574|   630k|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|   630k|               expansion_error = temp_ctx.error;
 6576|   630k|               expansion_message = temp_ctx.custom_error_message;
 6577|   630k|            }
 6578|   630k|            it = start;
 6579|   630k|            return false;
 6580|   630k|         };
 6581|       |
 6582|   630k|         bool parsed = false;
 6583|   630k|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|   630k|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|   630k|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|   630k|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 630k]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|   630k|      }
_ZN3glz4yaml26alias_token_is_mapping_keyIPKcS3_EEbT_T0_:
  371|  9.40M|      {
  372|  9.40M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (372:14): [True: 0, False: 9.40M]
  |  Branch (372:27): [True: 9.11M, False: 293k]
  ------------------
  373|   293k|         ++it; // skip '*'
  374|   293k|         auto name = parse_anchor_name(it, end);
  375|   293k|         if (name.empty()) return false;
  ------------------
  |  Branch (375:14): [True: 360, False: 293k]
  ------------------
  376|   293k|         skip_inline_ws(it, end);
  377|   293k|         return (it != end && *it == ':') &&
  ------------------
  |  Branch (377:18): [True: 286k, False: 7.05k]
  |  Branch (377:31): [True: 79.9k, False: 206k]
  ------------------
  378|  79.9k|                ((it + 1) == end || whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (378:18): [True: 4.75k, False: 75.1k]
  |  Branch (378:37): [True: 68.7k, False: 6.47k]
  ------------------
  379|   293k|      }
_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_:
 5205|   298k|      {
 5206|   298k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   298k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   298k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   298k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   298k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 298k, False: 0]
  ------------------
 5216|   298k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   298k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4515|   298k|      {
 4516|   298k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 298k]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|   298k|         yaml::node_preamble_state preamble{};
 4520|   298k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 817, False: 298k]
  ------------------
 4521|   298k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|    817|            return;
 4523|       |
 4524|   298k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|   298k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|   298k|         std::remove_cvref_t<T> preexisting_entries;
 4538|   298k|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 298k]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|   298k|         struct merge_restore_guard
 4543|   298k|         {
 4544|   298k|            std::remove_cvref_t<T>& target;
 4545|   298k|            std::remove_cvref_t<T>& saved;
 4546|   298k|            ~merge_restore_guard()
 4547|   298k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   298k|               for (auto& entry : saved) {
 4551|   298k|                  target.emplace(entry.first, std::move(entry.second));
 4552|   298k|               }
 4553|   298k|            }
 4554|   298k|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|   298k|         const bool treat_as_block_mapping =
 4557|   298k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [True: 298k, Folded]
  |  Branch (4557:48): [True: 25.2k, False: 272k]
  |  Branch (4557:62): [True: 404, False: 24.8k]
  ------------------
 4558|       |
 4559|   298k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 25.2k, False: 272k]
  |  Branch (4559:28): [True: 24.8k, False: 404]
  ------------------
 4560|       |            // Flow mapping
 4561|  24.8k|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|  24.8k|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|  24.8k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 24.6k, False: 110]
  |  Branch (4565:30): [True: 1.40k, False: 23.2k]
  ------------------
 4566|  1.40k|               ++it;
 4567|  1.40k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  1.40k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 4, False: 1.40k]
  ------------------
 4569|      4|                  return;
 4570|  1.40k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  1.40k|               return;
 4572|  1.40k|            }
 4573|       |
 4574|   185k|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 183k, False: 1.67k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|   183k|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|   183k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 183k, False: 0]
  |  Branch (4578:33): [True: 877, False: 182k]
  ------------------
 4579|    877|                  ++it;
 4580|    877|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|    877|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 5, False: 872]
  ------------------
 4582|      5|                     return;
 4583|    872|                  break;
 4584|    877|               }
 4585|       |
 4586|   182k|               bool explicit_flow_key = false;
 4587|   182k|               auto explicit_probe = it;
 4588|   182k|               yaml::skip_inline_ws(explicit_probe, end);
 4589|   182k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 182k, False: 0]
  |  Branch (4589:45): [True: 21.0k, False: 161k]
  ------------------
 4590|  21.0k|                  const auto after_q = explicit_probe + 1;
 4591|  21.0k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 8, False: 21.0k]
  |  Branch (4591:41): [True: 3.24k, False: 17.8k]
  ------------------
 4592|  17.8k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 13.8k, False: 3.97k]
  |  Branch (4592:42): [True: 495, False: 3.48k]
  ------------------
 4593|  17.6k|                     explicit_flow_key = true;
 4594|  17.6k|                     it = explicit_probe + 1;
 4595|  17.6k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  17.6k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 1, False: 17.6k]
  ------------------
 4597|      1|                        return;
 4598|  17.6k|                  }
 4599|  21.0k|               }
 4600|       |               // Parse key
 4601|   182k|               key_t key{};
 4602|   182k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|   182k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 17.6k, False: 165k]
  |  Branch (4603:44): [True: 17.6k, False: 12]
  |  Branch (4603:58): [True: 266, False: 17.3k]
  |  Branch (4603:72): [True: 13.8k, False: 3.46k]
  |  Branch (4603:86): [True: 502, False: 2.96k]
  ------------------
 4604|  14.6k|                     key.clear();
 4605|  14.6k|                  }
 4606|   168k|                  else {
 4607|   168k|                     auto key_probe = it;
 4608|   168k|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|   168k|                     bool parse_complex_flow_key = false;
 4613|   168k|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 168k, False: 12]
  ------------------
 4614|   168k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 596, False: 167k]
  |  Branch (4614:50): [True: 2.46k, False: 165k]
  ------------------
 4615|  3.05k|                           parse_complex_flow_key = true;
 4616|  3.05k|                        }
 4617|   165k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 18.9k, False: 146k]
  ------------------
 4618|  18.9k|                           ++key_probe;
 4619|  18.9k|                           yaml::parse_anchor_name(key_probe, end);
 4620|  18.9k|                           yaml::skip_inline_ws(key_probe, end);
 4621|  18.9k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 18.9k, False: 48]
  |  Branch (4621:53): [True: 310, False: 18.5k]
  |  Branch (4621:74): [True: 228, False: 18.3k]
  ------------------
 4622|    538|                              parse_complex_flow_key = true;
 4623|    538|                           }
 4624|  18.9k|                        }
 4625|   168k|                     }
 4626|       |
 4627|   168k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 3.59k, False: 164k]
  ------------------
 4628|  3.59k|                        glz::generic key_node{};
 4629|  3.59k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|  3.59k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 531, False: 3.06k]
  ------------------
 4631|    531|                           return;
 4632|  3.06k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 1, False: 3.06k]
  ------------------
 4633|      1|                           return;
 4634|  3.06k|                     }
 4635|   164k|                     else {
 4636|   164k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 411, False: 164k]
  ------------------
 4637|    411|                           return;
 4638|    411|                        }
 4639|   164k|                     }
 4640|   168k|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|   181k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|   182k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 9, False: 182k]
  ------------------
 4656|      9|                  return;
 4657|       |
 4658|   182k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|   182k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|   182k|                     val = {};
 4661|   182k|                     return true;
 4662|   182k|                  }
 4663|   182k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   182k|                     val = glz::generic{};
 4665|   182k|                     return true;
 4666|   182k|                  }
 4667|   182k|                  else {
 4668|   182k|                     static constexpr std::string_view null_value{"null"};
 4669|   182k|                     auto null_it = null_value.data();
 4670|   182k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|   182k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|   182k|                     return !bool(ctx.error);
 4673|   182k|                  }
 4674|   182k|               };
 4675|       |
 4676|   182k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 181k, False: 1.89k]
  |  Branch (4676:34): [True: 140k, False: 40.4k]
  |  Branch (4676:48): [True: 5.36k, False: 35.0k]
  ------------------
 4677|   145k|                  val_t val{};
 4678|   145k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 145k]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|   145k|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|   145k|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 5.36k, False: 140k]
  ------------------
 4684|  5.36k|                     ++it;
 4685|  5.36k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  5.36k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 9, False: 5.35k]
  ------------------
 4687|      9|                        return;
 4688|  5.35k|                     break;
 4689|  5.36k|                  }
 4690|       |
 4691|   140k|                  ++it; // skip comma
 4692|   140k|                  yaml::skip_ws_and_newlines(it, end);
 4693|   140k|                  continue;
 4694|   145k|               }
 4695|       |
 4696|  36.9k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 1.89k, False: 35.0k]
  |  Branch (4696:33): [True: 104, False: 34.9k]
  ------------------
 4697|  1.05k|                  ctx.error = error_code::syntax_error;
 4698|  1.05k|                  return;
 4699|  1.05k|               }
 4700|  35.9k|               ++it;
 4701|       |
 4702|  35.9k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  35.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 3, False: 35.9k]
  ------------------
 4704|      3|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  35.9k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 34.5k, False: 1.36k]
  |  Branch (4707:34): [True: 2.24k, False: 32.3k]
  |  Branch (4707:48): [True: 11.4k, False: 20.8k]
  ------------------
 4708|  13.6k|                  val_t val{};
 4709|  13.6k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 13.6k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|  13.6k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|  13.6k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 11.4k, False: 2.24k]
  ------------------
 4715|  11.4k|                     ++it;
 4716|  11.4k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  11.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 2, False: 11.4k]
  ------------------
 4718|      2|                        return;
 4719|  11.4k|                     break;
 4720|  11.4k|                  }
 4721|       |
 4722|  2.24k|                  ++it; // skip comma
 4723|  2.24k|                  yaml::skip_ws_and_newlines(it, end);
 4724|  2.24k|                  continue;
 4725|  13.6k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  22.2k|               val_t val{};
 4729|  22.2k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  22.2k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 626, False: 21.6k]
  ------------------
 4731|    626|                  return;
 4732|       |
 4733|  21.6k|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  21.6k|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  21.6k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 20.5k, False: 1.06k]
  |  Branch (4737:33): [True: 1.08k, False: 19.4k]
  ------------------
 4738|  1.08k|                  ++it;
 4739|  1.08k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|  1.08k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 5, False: 1.08k]
  ------------------
 4741|      5|                     return;
 4742|  1.08k|                  break;
 4743|  1.08k|               }
 4744|  20.5k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 19.4k, False: 1.06k]
  |  Branch (4744:38): [True: 17.8k, False: 1.62k]
  ------------------
 4745|  17.8k|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|  17.8k|                  yaml::skip_ws_and_newlines(it, end);
 4748|  17.8k|               }
 4749|  2.68k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 1.62k, False: 1.06k]
  |  Branch (4749:39): [True: 1.48k, False: 142]
  |  Branch (4749:54): [True: 93, False: 49]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|  1.57k|                  yaml::skip_ws_and_newlines(it, end);
 4753|  1.57k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 1.56k, False: 13]
  |  Branch (4753:36): [True: 147, False: 1.41k]
  ------------------
 4754|    147|                     ++it;
 4755|    147|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|    147|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 1, False: 146]
  ------------------
 4757|      1|                        return;
 4758|    146|                     break;
 4759|    147|                  }
 4760|  1.42k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 1.41k, False: 13]
  |  Branch (4760:36): [True: 1.40k, False: 7]
  ------------------
 4761|  1.40k|                     ++it;
 4762|  1.40k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  1.40k|                     continue;
 4764|  1.40k|                  }
 4765|     20|                  ctx.error = error_code::syntax_error;
 4766|     20|                  return;
 4767|  1.42k|               }
 4768|  1.11k|               else {
 4769|  1.11k|                  ctx.error = error_code::syntax_error;
 4770|  1.11k|                  return;
 4771|  1.11k|               }
 4772|  21.6k|            }
 4773|  23.4k|         }
 4774|   273k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   273k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   273k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   273k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   273k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   273k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   273k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   273k|                           if (ctx.stream_begin) {
 4788|   273k|                              auto is_line_content_start = [&](auto pos) {
 4789|   273k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   273k|                              };
 4791|       |
 4792|   273k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   273k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   273k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   273k|                                 return line != end && *line == ':';
 4796|   273k|                              };
 4797|       |
 4798|   273k|                              if (!is_line_content_start(it) &&
 4799|   273k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   273k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   273k|                                 ctx.error = error_code::syntax_error;
 4802|   273k|                                 return false;
 4803|   273k|                              }
 4804|   273k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   273k|                           }
 4806|   273k|                        }
 4807|       |
 4808|   273k|                        if (*it == '-' &&
 4809|   273k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   273k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   273k|                           ctx.error = error_code::syntax_error;
 4813|   273k|                           return false;
 4814|   273k|                        }
 4815|       |
 4816|   273k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   273k|                           return false;
 4818|   273k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   273k|                        ctx.pop_indent();
 4820|   273k|                     }
 4821|   273k|                     else {
 4822|   273k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   273k|                        if (nested_indent >= 0) {
 4824|   273k|                           yaml::skip_to_content(it, end);
 4825|   273k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   273k|                              ctx.error = error_code::syntax_error;
 4827|   273k|                              return false;
 4828|   273k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   273k|                           const int32_t value_indent =
 4832|   273k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   273k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   273k|                              return false;
 4835|   273k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   273k|                           ctx.pop_indent();
 4837|   273k|                        }
 4838|   273k|                     }
 4839|   273k|                     return !bool(ctx.error);
 4840|   273k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   273k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   273k|                     ctx.error = error_code::syntax_error;
 4847|   273k|                     return false;
 4848|   273k|                  }
 4849|   273k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   273k|                     ++it; // skip '?'
 4851|   273k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   273k|                     const int32_t explicit_value_indicator_indent =
 4854|   273k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   273k|                     key_t key{};
 4857|   273k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   273k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   273k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   273k|                        };
 4861|       |
 4862|   273k|                        auto key_it = it;
 4863|   273k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   273k|                        auto content = key_it;
 4866|   273k|                        yaml::skip_to_content(content, end);
 4867|   273k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   273k|                        if (content != end && *content == '&') {
 4873|   273k|                           auto anchor_probe = content + 1;
 4874|   273k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   273k|                           if (!anchor_name.empty()) {
 4876|   273k|                              auto after_anchor = anchor_probe;
 4877|   273k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   273k|                              auto value_indicator = after_anchor;
 4880|   273k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   273k|                                 key.clear();
 4882|   273k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   273k|                                 it = value_indicator;
 4884|   273k|                                 handled_anchor_only_empty_key = true;
 4885|   273k|                              }
 4886|   273k|                              else {
 4887|   273k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   273k|                                    yaml::skip_comment(value_indicator, end);
 4889|   273k|                                 }
 4890|   273k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   273k|                                    yaml::skip_newline(value_indicator, end);
 4892|   273k|                                    auto value_line = value_indicator;
 4893|   273k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   273k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   273k|                                       return false;
 4896|   273k|                                    if (value_line != end && *value_line == ':' &&
 4897|   273k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   273k|                                       key.clear();
 4899|   273k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   273k|                                       it = value_line;
 4901|   273k|                                       handled_anchor_only_empty_key = true;
 4902|   273k|                                    }
 4903|   273k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   273k|                                       ctx.error = error_code::syntax_error;
 4908|   273k|                                       return false;
 4909|   273k|                                    }
 4910|   273k|                                 }
 4911|   273k|                              }
 4912|   273k|                           }
 4913|   273k|                        }
 4914|       |
 4915|   273k|                        const bool key_content_spans_lines = [&] {
 4916|   273k|                           auto scan = key_it;
 4917|   273k|                           while (scan != content && scan != end) {
 4918|   273k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   273k|                              ++scan;
 4920|   273k|                           }
 4921|   273k|                           return false;
 4922|   273k|                        }();
 4923|       |
 4924|   273k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   273k|                        }
 4927|   273k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   273k|                           key.clear();
 4929|   273k|                           it = content;
 4930|   273k|                        }
 4931|   273k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   273k|                           auto key_node_it = content;
 4937|   273k|                           auto key_node_end = end;
 4938|   273k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   273k|                              auto scan = content;
 4943|   273k|                              while (scan != end) {
 4944|   273k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   273k|                                    ++scan;
 4946|   273k|                                 }
 4947|   273k|                                 if (scan == end) {
 4948|   273k|                                    break;
 4949|   273k|                                 }
 4950|       |
 4951|   273k|                                 yaml::skip_newline(scan, end);
 4952|   273k|                                 auto line_start = scan;
 4953|       |
 4954|   273k|                                 int32_t indicator_indent = 0;
 4955|   273k|                                 while (scan != end && *scan == ' ') {
 4956|   273k|                                    ++indicator_indent;
 4957|   273k|                                    ++scan;
 4958|   273k|                                 }
 4959|       |
 4960|   273k|                                 if (scan != end && *scan == ':') {
 4961|   273k|                                    const auto after_colon = scan + 1;
 4962|   273k|                                    if ((after_colon == end ||
 4963|   273k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   273k|                                        indicator_indent <= line_indent) {
 4965|   273k|                                       key_node_end = line_start;
 4966|   273k|                                       break;
 4967|   273k|                                    }
 4968|   273k|                                 }
 4969|   273k|                              }
 4970|   273k|                           }
 4971|       |
 4972|   273k|                           glz::generic key_node{};
 4973|   273k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   273k|                           ctx.explicit_mapping_key_context = true;
 4975|   273k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   273k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   273k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   273k|                              return false;
 4979|   273k|                           it = key_node_it;
 4980|   273k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   273k|                              return false;
 4982|   273k|                        }
 4983|   273k|                     }
 4984|   273k|                     else {
 4985|   273k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   273k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   273k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   273k|                              return false;
 4989|   273k|                        }
 4990|   273k|                     }
 4991|       |
 4992|   273k|                     yaml::skip_inline_ws(it, end);
 4993|   273k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   273k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   273k|                        auto probe = it;
 4998|   273k|                        bool found_value_indicator = false;
 4999|       |
 5000|   273k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   273k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   273k|                           auto value_line = probe;
 5004|   273k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   273k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   273k|                              return false;
 5007|       |
 5008|   273k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   273k|                              probe = value_line;
 5010|   273k|                              continue; // blank line
 5011|   273k|                           }
 5012|   273k|                           if (*value_line == '#') {
 5013|   273k|                              yaml::skip_comment(value_line, end);
 5014|   273k|                              probe = value_line;
 5015|   273k|                              continue; // comment-only line
 5016|   273k|                           }
 5017|   273k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   273k|                              it = value_line;
 5019|   273k|                              found_value_indicator = true;
 5020|   273k|                           }
 5021|   273k|                           break;
 5022|   273k|                        }
 5023|       |
 5024|   273k|                        if (found_value_indicator) {
 5025|   273k|                           yaml::skip_inline_ws(it, end);
 5026|   273k|                        }
 5027|   273k|                     }
 5028|       |
 5029|   273k|                     val_t val{};
 5030|   273k|                     if (it != end && *it == ':') {
 5031|   273k|                        ++it;
 5032|   273k|                        if (it != end && *it == '\t') {
 5033|   273k|                           ctx.error = error_code::syntax_error;
 5034|   273k|                           return false;
 5035|   273k|                        }
 5036|   273k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   273k|                           auto probe = it;
 5038|   273k|                           yaml::skip_newline(probe, end);
 5039|   273k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   273k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   273k|                              ctx.error = error_code::syntax_error;
 5042|   273k|                              return false;
 5043|   273k|                           }
 5044|   273k|                        }
 5045|   273k|                        yaml::skip_inline_ws(it, end);
 5046|   273k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   273k|                           return false;
 5048|   273k|                     }
 5049|       |
 5050|   273k|                     value.emplace(std::move(key), std::move(val));
 5051|   273k|                     return true;
 5052|   273k|                  }
 5053|       |
 5054|   273k|                  key_t key{};
 5055|   273k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   273k|                     auto key_probe = it;
 5057|   273k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   273k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   273k|                     if (complex_flow_key) {
 5060|   273k|                        glz::generic key_node{};
 5061|   273k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   273k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   273k|                           return false;
 5064|   273k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   273k|                           return false;
 5066|   273k|                     }
 5067|   273k|                     else {
 5068|   273k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   273k|                           return false;
 5070|   273k|                        }
 5071|   273k|                     }
 5072|   273k|                  }
 5073|   273k|                  else {
 5074|   273k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   273k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   273k|                        return false;
 5077|   273k|                  }
 5078|       |
 5079|   273k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   273k|                  if (it == end || *it != ':') {
 5082|   273k|                     ctx.error = error_code::syntax_error;
 5083|   273k|                     return false;
 5084|   273k|                  }
 5085|   273k|                  ++it;
 5086|   273k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   273k|                  val_t val{};
 5089|   273k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   273k|                     return false;
 5091|       |
 5092|   273k|                  value.emplace(std::move(key), std::move(val));
 5093|   273k|                  return true;
 5094|   273k|               });
 5095|   273k|         }
 5096|       |
 5097|   293k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|   293k|      }
_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|   298k|      {
  466|   298k|         skip_inline_ws(it, end);
  467|       |
  468|   298k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1, False: 298k]
  ------------------
  469|      1|            if constexpr (!AllowEmptyInput) {
  470|      1|               ctx.error = error_code::unexpected_end;
  471|      1|            }
  472|      1|            return true;
  473|      1|         }
  474|       |
  475|   298k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   298k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 298k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|   298k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 298k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   298k|         skip_inline_ws(it, end);
  486|       |
  487|   298k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 298k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|   298k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 809, False: 298k]
  ------------------
  495|    809|            return true;
  496|    809|         }
  497|       |
  498|   298k|         return false;
  499|   298k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4521|   298k|                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|   298k|      {
  409|   298k|         state.has_anchor = false;
  410|   298k|         state.anchor_name.clear();
  411|   298k|         state.anchor_start = nullptr;
  412|   298k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   298k|         if constexpr (Policy.allow_alias) {
  415|   298k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   298k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 293k, False: 4.96k]
  ------------------
  417|   293k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 777, False: 293k]
  ------------------
  418|   293k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   298k|         }
  424|       |
  425|   298k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 298k, False: 777]
  |  Branch (425:27): [True: 17.7k, False: 280k]
  ------------------
  426|  17.7k|            ++it;
  427|  17.7k|            auto name = parse_anchor_name(it, end);
  428|  17.7k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 13, False: 17.7k]
  ------------------
  429|     13|               ctx.error = error_code::syntax_error;
  430|     13|               return true;
  431|     13|            }
  432|  17.7k|            skip_inline_ws(it, end);
  433|  17.7k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 19, False: 17.6k]
  ------------------
  434|     19|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     19|                  ctx.error = error_code::unexpected_end;
  436|     19|               }
  437|     19|               return true;
  438|     19|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  17.6k|            state.has_anchor = true;
  446|  17.6k|            state.anchor_name = std::string(name);
  447|  17.6k|            state.anchor_start = &*it;
  448|  17.6k|         }
  449|       |
  450|   298k|         return false;
  451|   298k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   293k|      {
  301|   293k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 293k]
  |  Branch (301:27): [True: 293k, False: 777]
  ------------------
  302|       |
  303|    777|         ++it; // skip '*'
  304|    777|         auto name = parse_anchor_name(it, end);
  305|    777|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 4, False: 773]
  ------------------
  306|      4|            ctx.error = error_code::syntax_error;
  307|      4|            return true;
  308|      4|         }
  309|       |
  310|    773|         auto anchor_it = ctx.anchors.find(name);
  311|    773|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 22, False: 751]
  ------------------
  312|     22|            ctx.error = error_code::syntax_error; // undefined alias
  313|     22|            return true;
  314|     22|         }
  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|    751|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|    751|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 352, False: 399]
  ------------------
  322|    352|            return true;
  323|    352|         }
  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|    399|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 13, False: 386]
  ------------------
  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|    386|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    386|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 386]
  ------------------
  339|      0|            return true;
  340|       |
  341|    386|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 386]
  ------------------
  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|    386|         auto replay_it = span.begin;
  348|    386|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    386|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    386|         ctx.indent_stack.clear();
  353|    386|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 318, False: 68]
  ------------------
  354|    318|            ctx.push_indent(span.base_indent - 1);
  355|    318|         }
  356|       |
  357|    386|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    386|         using V = std::remove_cvref_t<T>;
  360|    386|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    386|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    386|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    386|         return true;
  367|    386|      }
_ZN3glz4yaml40inline_value_has_plain_mapping_indicatorIPKcS3_EEbT_T0_:
 3036|  2.88M|      {
 3037|  2.88M|         const auto stop = yaml::implicit_key_scan_end(pos, end);
 3038|  2.88M|         int flow_depth = 0;
 3039|  33.1M|         while (pos != stop) {
  ------------------
  |  Branch (3039:17): [True: 33.0M, False: 157k]
  ------------------
 3040|  33.0M|            const char c = *pos;
 3041|  33.0M|            if (c == '\n' || c == '\r' || c == '#') return false;
  ------------------
  |  Branch (3041:17): [True: 810k, False: 32.2M]
  |  Branch (3041:30): [True: 191k, False: 32.0M]
  |  Branch (3041:43): [True: 1.05M, False: 30.9M]
  ------------------
 3042|  30.9M|            if (c == '"' || c == '\'') {
  ------------------
  |  Branch (3042:17): [True: 58.2k, False: 30.9M]
  |  Branch (3042:29): [True: 115k, False: 30.8M]
  ------------------
 3043|   173k|               const char quote = c;
 3044|   173k|               ++pos;
 3045|  10.1M|               while (pos != stop && *pos != quote) {
  ------------------
  |  Branch (3045:23): [True: 10.1M, False: 52.1k]
  |  Branch (3045:38): [True: 10.0M, False: 121k]
  ------------------
 3046|  10.0M|                  if (*pos == '\\' && quote == '"') {
  ------------------
  |  Branch (3046:23): [True: 68.7k, False: 9.95M]
  |  Branch (3046:39): [True: 46.0k, False: 22.6k]
  ------------------
 3047|  46.0k|                     ++pos;
 3048|  46.0k|                     if (pos != stop) ++pos;
  ------------------
  |  Branch (3048:26): [True: 42.8k, False: 3.22k]
  ------------------
 3049|  46.0k|                  }
 3050|  9.97M|                  else {
 3051|  9.97M|                     ++pos;
 3052|  9.97M|                  }
 3053|  10.0M|               }
 3054|   173k|               if (pos != stop) ++pos;
  ------------------
  |  Branch (3054:20): [True: 121k, False: 52.1k]
  ------------------
 3055|   173k|               continue;
 3056|   173k|            }
 3057|  30.8M|            if (c == '[' || c == '{') {
  ------------------
  |  Branch (3057:17): [True: 138k, False: 30.6M]
  |  Branch (3057:29): [True: 515k, False: 30.1M]
  ------------------
 3058|   654k|               ++flow_depth;
 3059|   654k|               ++pos;
 3060|   654k|               continue;
 3061|   654k|            }
 3062|  30.1M|            if ((c == ']' || c == '}') && flow_depth > 0) {
  ------------------
  |  Branch (3062:18): [True: 76.3k, False: 30.0M]
  |  Branch (3062:30): [True: 225k, False: 29.8M]
  |  Branch (3062:43): [True: 114k, False: 186k]
  ------------------
 3063|   114k|               --flow_depth;
 3064|   114k|               ++pos;
 3065|   114k|               continue;
 3066|   114k|            }
 3067|  30.0M|            if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (3067:17): [True: 939k, False: 29.1M]
  |  Branch (3067:29): [True: 672k, False: 267k]
  ------------------
 3068|   672k|               const auto next = pos + 1;
 3069|   672k|               return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (3069:23): [True: 2.68k, False: 670k]
  |  Branch (3069:40): [True: 243k, False: 426k]
  |  Branch (3069:56): [True: 8.87k, False: 417k]
  |  Branch (3069:73): [True: 13.6k, False: 404k]
  |  Branch (3069:90): [True: 45.1k, False: 359k]
  ------------------
 3070|   672k|            }
 3071|  29.3M|            ++pos;
 3072|  29.3M|         }
 3073|   157k|         return false;
 3074|  2.88M|      }
_ZN3glz4yaml32validate_flow_node_adjacent_tailINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_:
  937|  5.36M|      {
  938|  5.36M|         if (it == end) return;
  ------------------
  |  Branch (938:14): [True: 1.90M, False: 3.46M]
  ------------------
  939|  3.46M|         const char c = *it;
  940|       |         // After a flow collection closes, the next character must be a structural
  941|       |         // separator or whitespace/comment. Adjacent plain content is malformed.
  942|  3.46M|         if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '#' || c == ',' || c == ']' || c == '}' ||
  ------------------
  |  Branch (942:14): [True: 352k, False: 3.10M]
  |  Branch (942:26): [True: 75.4k, False: 3.03M]
  |  Branch (942:39): [True: 108k, False: 2.92M]
  |  Branch (942:52): [True: 294k, False: 2.63M]
  |  Branch (942:65): [True: 37.6k, False: 2.59M]
  |  Branch (942:77): [True: 2.19M, False: 402k]
  |  Branch (942:89): [True: 40.9k, False: 361k]
  |  Branch (942:101): [True: 64.3k, False: 297k]
  ------------------
  943|  3.46M|             c == ':') {
  ------------------
  |  Branch (943:14): [True: 295k, False: 2.04k]
  ------------------
  944|  3.46M|            return;
  945|  3.46M|         }
  946|  2.04k|         ctx.error = error_code::syntax_error;
  947|  2.04k|      }
_ZN3glz4yaml20finalize_node_anchorINS0_12yaml_contextEPKcEEvRNS0_19node_property_stateERT_T0_:
  455|  20.5M|      {
  456|  20.5M|         if (state.has_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (456:14): [True: 360k, False: 20.2M]
  |  Branch (456:34): [True: 335k, False: 25.1k]
  ------------------
  457|   335k|            ctx.anchors[std::move(state.anchor_name)] = {state.anchor_start, &*it, state.anchor_indent};
  458|   335k|         }
  459|  20.5M|      }
_ZN3glz4yaml25skip_flow_ws_and_newlinesINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_Pb:
  859|  45.7M|      {
  860|  45.7M|         bool at_line_start = false;
  861|  45.7M|         bool saw_separation_ws = false;
  862|  45.7M|         bool line_has_indent = false;
  863|  69.4M|         while (it != end) {
  ------------------
  |  Branch (863:17): [True: 68.9M, False: 565k]
  ------------------
  864|  68.9M|            if (*it == ' ') {
  ------------------
  |  Branch (864:17): [True: 11.0M, False: 57.8M]
  ------------------
  865|  11.0M|               ++it;
  866|  11.0M|               saw_separation_ws = true;
  867|  11.0M|               if (at_line_start) line_has_indent = true;
  ------------------
  |  Branch (867:20): [True: 4.35M, False: 6.69M]
  ------------------
  868|  11.0M|               continue;
  869|  11.0M|            }
  870|  57.8M|            if (*it == '\t') {
  ------------------
  |  Branch (870:17): [True: 4.11M, False: 53.7M]
  ------------------
  871|  4.11M|               if (at_line_start && !line_has_indent) {
  ------------------
  |  Branch (871:20): [True: 288k, False: 3.82M]
  |  Branch (871:37): [True: 61.3k, False: 227k]
  ------------------
  872|  61.3k|                  auto probe = it;
  873|   258k|                  while (probe != end && (*probe == ' ' || *probe == '\t')) ++probe;
  ------------------
  |  Branch (873:26): [True: 252k, False: 5.38k]
  |  Branch (873:43): [True: 39.1k, False: 213k]
  |  Branch (873:60): [True: 157k, False: 55.9k]
  ------------------
  874|  61.3k|                  if (probe != end && *probe != '\n' && *probe != '\r' && *probe != '#') {
  ------------------
  |  Branch (874:23): [True: 55.9k, False: 5.38k]
  |  Branch (874:39): [True: 49.6k, False: 6.28k]
  |  Branch (874:57): [True: 22.1k, False: 27.4k]
  |  Branch (874:75): [True: 16.8k, False: 5.30k]
  ------------------
  875|  16.8k|                     const char c = *probe;
  876|  16.8k|                     const bool allowed_flow_delim = (c == ']' || c == '}' || c == '[' || c == '{' || c == ',');
  ------------------
  |  Branch (876:55): [True: 638, False: 16.2k]
  |  Branch (876:67): [True: 1.09k, False: 15.1k]
  |  Branch (876:79): [True: 62, False: 15.0k]
  |  Branch (876:91): [True: 320, False: 14.7k]
  |  Branch (876:103): [True: 14.5k, False: 176]
  ------------------
  877|  16.8k|                     if (!allowed_flow_delim) {
  ------------------
  |  Branch (877:26): [True: 176, False: 16.6k]
  ------------------
  878|    176|                        ctx.error = error_code::syntax_error;
  879|    176|                        return;
  880|    176|                     }
  881|  16.8k|                  }
  882|  61.3k|               }
  883|  4.11M|               ++it;
  884|  4.11M|               saw_separation_ws = true;
  885|  4.11M|               if (at_line_start) line_has_indent = true;
  ------------------
  |  Branch (885:20): [True: 288k, False: 3.82M]
  ------------------
  886|  4.11M|               continue;
  887|  4.11M|            }
  888|  53.7M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (888:17): [True: 3.09M, False: 50.6M]
  |  Branch (888:32): [True: 5.19M, False: 45.4M]
  ------------------
  889|  8.29M|               skip_newline(it, end);
  890|  8.29M|               if (saw_line_break) *saw_line_break = true;
  ------------------
  |  Branch (890:20): [True: 150k, False: 8.14M]
  ------------------
  891|  8.29M|               at_line_start = true;
  892|  8.29M|               saw_separation_ws = true;
  893|  8.29M|               line_has_indent = false;
  894|  8.29M|               continue;
  895|  8.29M|            }
  896|  45.4M|            if (*it == '#') {
  ------------------
  |  Branch (896:17): [True: 329k, False: 45.1M]
  ------------------
  897|       |               // In flow style, comments require separation from the previous token.
  898|       |               // Allow comment-only lines and comments after inline whitespace, but
  899|       |               // reject adjacency forms like ",#comment" (CVW2).
  900|   329k|               bool separated_by_prev_ws = false;
  901|   329k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
  902|   329k|                  if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (902:23): [True: 329k, False: 0]
  |  Branch (902:43): [True: 329k, False: 0]
  ------------------
  903|   329k|                     const char prev = *(it - 1);
  904|   329k|                     separated_by_prev_ws = (prev == ' ' || prev == '\t');
  ------------------
  |  Branch (904:46): [True: 128k, False: 201k]
  |  Branch (904:61): [True: 31.0k, False: 170k]
  ------------------
  905|   329k|                  }
  906|   329k|               }
  907|   329k|               if (!(at_line_start || saw_separation_ws || separated_by_prev_ws)) {
  ------------------
  |  Branch (907:22): [True: 196k, False: 132k]
  |  Branch (907:39): [True: 24.3k, False: 107k]
  |  Branch (907:60): [True: 87.3k, False: 20.5k]
  ------------------
  908|  20.5k|                  break;
  909|  20.5k|               }
  910|   308k|               skip_comment(it, end);
  911|   308k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (911:20): [True: 297k, False: 11.7k]
  |  Branch (911:34): [True: 121k, False: 175k]
  |  Branch (911:49): [True: 175k, False: 0]
  ------------------
  912|   297k|                  skip_newline(it, end);
  913|   297k|                  if (saw_line_break) *saw_line_break = true;
  ------------------
  |  Branch (913:23): [True: 1.01k, False: 295k]
  ------------------
  914|   297k|                  at_line_start = true;
  915|   297k|                  saw_separation_ws = true;
  916|   297k|                  continue;
  917|   297k|               }
  918|  11.7k|               continue;
  919|   308k|            }
  920|       |
  921|       |            // In block context, multiline flow nodes require indentation on content
  922|       |            // continuation lines (except structural tokens).
  923|  45.1M|            if (at_line_start && ctx.current_indent() >= 0 && !line_has_indent) {
  ------------------
  |  Branch (923:17): [True: 7.08M, False: 38.0M]
  |  Branch (923:34): [True: 411k, False: 6.67M]
  |  Branch (923:63): [True: 214k, False: 197k]
  ------------------
  924|   214k|               const char c = *it;
  925|   214k|               const bool structural = (c == ']' || c == '}' || c == ',');
  ------------------
  |  Branch (925:41): [True: 14.9k, False: 199k]
  |  Branch (925:53): [True: 2.61k, False: 196k]
  |  Branch (925:65): [True: 196k, False: 548]
  ------------------
  926|   214k|               if (!structural) {
  ------------------
  |  Branch (926:20): [True: 548, False: 213k]
  ------------------
  927|    548|                  ctx.error = error_code::syntax_error;
  928|    548|                  return;
  929|    548|               }
  930|   214k|            }
  931|  45.1M|            break;
  932|  45.1M|         }
  933|  45.7M|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  2.20M|      {
  275|  2.20M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  2.20M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  2.20M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  2.20M|      }
_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_:
 5635|  3.35M|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|  3.35M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|  3.35M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|  3.35M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|  3.35M|                       "the internally tagged shape, so it is rejected here instead.");
 5642|  3.35M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 3.35M]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|  3.35M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|  3.35M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 31, False: 3.35M]
  ------------------
 5650|     31|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|  3.35M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 2.61M, False: 742k]
  ------------------
 5655|  2.61M|            yaml::skip_ws_newlines_comments(it, end);
 5656|  2.61M|         }
 5657|   742k|         else {
 5658|   742k|            yaml::skip_inline_ws(it, end);
 5659|   742k|         }
 5660|       |
 5661|  3.35M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 694, False: 3.35M]
  ------------------
 5662|    694|            ctx.error = error_code::unexpected_end;
 5663|    694|            return;
 5664|    694|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|  3.35M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|  3.35M|            using V = std::remove_cvref_t<T>;
 5772|  3.35M|            using counts = yaml_variant_type_count<V>;
 5773|  3.35M|            const char c = *it;
 5774|  3.35M|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  3.35M|               switch (ch) {
 5776|  3.35M|               case ' ':
 5777|  3.35M|               case '\t':
 5778|  3.35M|               case '\n':
 5779|  3.35M|               case '\r':
 5780|  3.35M|               case ',':
 5781|  3.35M|               case ']':
 5782|  3.35M|               case '}':
 5783|  3.35M|                  return true;
 5784|  3.35M|               default:
 5785|  3.35M|                  return false;
 5786|  3.35M|               }
 5787|  3.35M|            };
 5788|       |
 5789|  3.35M|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  3.35M|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  3.35M|                  return false;
 5792|  3.35M|               }
 5793|  3.35M|               if (ctx.current_indent() < 0) {
 5794|  3.35M|                  return false;
 5795|  3.35M|               }
 5796|  3.35M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|  3.35M|                  return false;
 5798|  3.35M|               }
 5799|       |
 5800|  3.35M|               auto look = word_end;
 5801|  3.35M|               yaml::skip_newline(look, end);
 5802|  3.35M|               while (look != end) {
 5803|  3.35M|                  int32_t line_indent = 0;
 5804|  3.35M|                  while (look != end && *look == ' ') {
 5805|  3.35M|                     ++line_indent;
 5806|  3.35M|                     ++look;
 5807|  3.35M|                  }
 5808|  3.35M|                  if (look != end && *look == '\t') {
 5809|  3.35M|                     return false;
 5810|  3.35M|                  }
 5811|  3.35M|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|  3.35M|                     if (look != end) {
 5813|  3.35M|                        yaml::skip_newline(look, end);
 5814|  3.35M|                        continue;
 5815|  3.35M|                     }
 5816|  3.35M|                     return false;
 5817|  3.35M|                  }
 5818|  3.35M|                  if (*look == '#') {
 5819|  3.35M|                     yaml::skip_comment(look, end);
 5820|  3.35M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|  3.35M|                        yaml::skip_newline(look, end);
 5822|  3.35M|                        continue;
 5823|  3.35M|                     }
 5824|  3.35M|                     return false;
 5825|  3.35M|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  3.35M|                  {
 5831|  3.35M|                     auto scan = look;
 5832|  3.35M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|  3.35M|                        if (*scan == ':') {
 5834|  3.35M|                           auto after_colon = scan + 1;
 5835|  3.35M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|  3.35M|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|  3.35M|                              return false;
 5838|  3.35M|                           }
 5839|  3.35M|                        }
 5840|  3.35M|                        ++scan;
 5841|  3.35M|                     }
 5842|  3.35M|                  }
 5843|       |
 5844|  3.35M|                  return line_indent > ctx.current_indent();
 5845|  3.35M|               }
 5846|  3.35M|               return false;
 5847|  3.35M|            };
 5848|  3.35M|            auto is_word_boundary = [&](const auto ptr) {
 5849|  3.35M|               if (ptr == end) {
 5850|  3.35M|                  return true;
 5851|  3.35M|               }
 5852|  3.35M|               if (*ptr == ':') {
 5853|  3.35M|                  auto next = ptr + 1;
 5854|  3.35M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|  3.35M|               }
 5856|  3.35M|               return is_plain_scalar_boundary(*ptr);
 5857|  3.35M|            };
 5858|       |
 5859|  3.35M|            switch (c) {
 5860|   623k|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 623k, False: 2.73M]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|   623k|               ++it;
 5863|   623k|               auto aname = yaml::parse_anchor_name(it, end);
 5864|   623k|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 82, False: 623k]
  ------------------
 5865|     82|                  ctx.error = error_code::syntax_error;
 5866|     82|                  return;
 5867|     82|               }
 5868|   623k|               yaml::skip_inline_ws(it, end);
 5869|   623k|               bool anchor_on_same_line = true;
 5870|   623k|               bool value_is_indentless_sequence = false;
 5871|   623k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 2.87k, False: 620k]
  |  Branch (5871:33): [True: 22.8k, False: 598k]
  |  Branch (5871:48): [True: 40.1k, False: 557k]
  |  Branch (5871:63): [True: 9.09k, False: 548k]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|  74.9k|                  bool value_on_next_line = false;
 5875|  74.9k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 72.0k, False: 2.87k]
  ------------------
 5876|  72.0k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|  72.0k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 9.09k, False: 63.0k]
  ------------------
 5879|   291k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 291k, False: 17]
  |  Branch (5879:47): [True: 288k, False: 3.36k]
  |  Branch (5879:64): [True: 282k, False: 5.71k]
  ------------------
 5880|  9.09k|                     }
 5881|       |                     // Skip newline
 5882|  72.0k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 72.0k, False: 17]
  |  Branch (5882:42): [True: 26.1k, False: 45.8k]
  |  Branch (5882:59): [True: 45.8k, False: 0]
  ------------------
 5883|  72.0k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|  95.9k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 94.5k, False: 1.42k]
  |  Branch (5885:48): [True: 14.2k, False: 80.2k]
  |  Branch (5885:65): [True: 9.62k, False: 70.6k]
  ------------------
 5886|  23.8k|                           yaml::skip_newline(peek, end);
 5887|  23.8k|                        }
 5888|       |                        // Measure indent of next content line
 5889|  72.0k|                        int32_t next_indent = 0;
 5890|   133k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 131k, False: 1.86k]
  |  Branch (5890:47): [True: 61.6k, False: 70.2k]
  ------------------
 5891|  61.6k|                           ++next_indent;
 5892|  61.6k|                           ++peek;
 5893|  61.6k|                        }
 5894|  72.0k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 70.2k, False: 1.86k]
  |  Branch (5894:44): [True: 67.5k, False: 2.70k]
  |  Branch (5894:61): [True: 66.7k, False: 804]
  ------------------
 5895|  66.7k|                           const bool indentless_sequence =
 5896|  66.7k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 65.1k, False: 1.59k]
  |  Branch (5896:69): [True: 29.1k, False: 35.9k]
  ------------------
 5897|  29.1k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 376, False: 28.7k]
  ------------------
 5898|  28.7k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 28.0k, False: 753]
  ------------------
 5899|  28.3k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 1.48k, False: 26.9k]
  ------------------
 5900|  26.9k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 1.89k, False: 25.0k]
  |  Branch (5900:61): [True: 1.67k, False: 218]
  ------------------
 5901|  66.7k|                           value_is_indentless_sequence = indentless_sequence;
 5902|  66.7k|                           const bool same_indent_property_node =
 5903|  66.7k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 6.51k, False: 60.1k]
  ------------------
 5904|  6.51k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 462, False: 6.05k]
  |  Branch (5904:48): [True: 356, False: 5.69k]
  |  Branch (5904:64): [True: 2, False: 5.69k]
  |  Branch (5904:80): [True: 433, False: 5.26k]
  |  Branch (5904:96): [True: 385, False: 4.87k]
  ------------------
 5905|  4.87k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 406, False: 4.46k]
  |  Branch (5905:48): [True: 279, False: 4.19k]
  |  Branch (5905:65): [True: 525, False: 3.66k]
  |  Branch (5905:81): [True: 137, False: 3.52k]
  ------------------
 5906|  66.7k|                           value_on_next_line =
 5907|  66.7k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 56.4k, False: 10.2k]
  |  Branch (5907:71): [True: 3.15k, False: 7.08k]
  |  Branch (5907:94): [True: 2.98k, False: 4.09k]
  ------------------
 5908|  66.7k|                        }
 5909|  72.0k|                     }
 5910|  72.0k|                  }
 5911|  74.9k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 12.3k, False: 62.6k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  12.3k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  12.3k|                     return;
 5915|  12.3k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|  62.6k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 8.71k, False: 53.8k]
  ------------------
 5918|   287k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 287k, False: 0]
  |  Branch (5918:42): [True: 284k, False: 3.07k]
  |  Branch (5918:57): [True: 278k, False: 5.64k]
  ------------------
 5919|  8.71k|                  }
 5920|  62.6k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 62.6k, False: 0]
  ------------------
 5921|  79.9k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 79.9k, False: 0]
  |  Branch (5921:40): [True: 10.1k, False: 69.8k]
  |  Branch (5921:55): [True: 7.24k, False: 62.6k]
  ------------------
 5922|  17.3k|                     yaml::skip_newline(it, end);
 5923|  17.3k|                  }
 5924|  62.6k|                  yaml::skip_inline_ws(it, end);
 5925|  62.6k|                  anchor_on_same_line = false;
 5926|  62.6k|               }
 5927|       |
 5928|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|       |                  if (anchor_on_same_line && *it == '-' &&
 5930|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|       |                     ctx.error = error_code::syntax_error;
 5933|       |                     return;
 5934|       |                  }
 5935|       |               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|   611k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 611k, False: 6]
  |  Branch (5939:33): [True: 63, False: 611k]
  |  Branch (5939:47): [True: 29, False: 34]
  ------------------
 5940|     29|                  ctx.error = error_code::syntax_error;
 5941|     29|                  return;
 5942|     29|               }
 5943|       |
 5944|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 5946|       |                     auto probe = it + 1;
 5947|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|       |                     if (nested_anchor_name.empty()) {
 5949|       |                        ctx.error = error_code::syntax_error;
 5950|       |                        return;
 5951|       |                     }
 5952|       |                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 5957|       |                        ctx.error = error_code::syntax_error;
 5958|       |                        return;
 5959|       |                     }
 5960|       |                  }
 5961|       |               }
 5962|       |
 5963|   611k|               const char* anchor_start = &*it;
 5964|   611k|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 5971|       |                     auto key_start = it;
 5972|       |                     if (*key_start == '!') {
 5973|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 5975|       |                           ctx.error = error_code::syntax_error;
 5976|       |                           return;
 5977|       |                        }
 5978|       |                        yaml::skip_inline_ws(key_start, end);
 5979|       |                        if (key_start == end) {
 5980|       |                           ctx.error = error_code::unexpected_end;
 5981|       |                           return;
 5982|       |                        }
 5983|       |                        if (*key_start == '\n' || *key_start == '\r') {
 5984|       |                           ctx.error = error_code::syntax_error;
 5985|       |                           return;
 5986|       |                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 5993|       |                           ctx.error = error_code::syntax_error;
 5994|       |                           return;
 5995|       |                        }
 5996|       |                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|       |                     auto key_scan = key_start;
 6000|       |                     auto key_end = key_start;
 6001|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6002|       |                        // Quoted key: skip to closing quote
 6003|       |                        const char quote = *key_scan;
 6004|       |                        ++key_scan;
 6005|       |                        while (key_scan != end && *key_scan != quote) {
 6006|       |                           if (*key_scan == '\\' && quote == '"') {
 6007|       |                              ++key_scan;
 6008|       |                              if (key_scan != end) ++key_scan;
 6009|       |                           }
 6010|       |                           else {
 6011|       |                              ++key_scan;
 6012|       |                           }
 6013|       |                        }
 6014|       |                        if (key_scan == end) {
 6015|       |                           ctx.error = error_code::syntax_error;
 6016|       |                           return;
 6017|       |                        }
 6018|       |                        ++key_scan; // past closing quote
 6019|       |                        key_end = key_scan;
 6020|       |                        yaml::skip_inline_ws(key_scan, end);
 6021|       |                     }
 6022|       |                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|       |                        while (key_scan != end) {
 6025|       |                           if (*key_scan == ':') {
 6026|       |                              auto next = key_scan + 1;
 6027|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6028|       |                                 break;
 6029|       |                              }
 6030|       |                           }
 6031|       |                           ++key_scan;
 6032|       |                        }
 6033|       |                        key_end = key_scan;
 6034|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6035|       |                           --key_end;
 6036|       |                        }
 6037|       |                     }
 6038|       |                     if (key_scan == end || *key_scan != ':') {
 6039|       |                        ctx.error = error_code::syntax_error;
 6040|       |                        return;
 6041|       |                     }
 6042|       |                     // Store anchor with just the key text span
 6043|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|       |                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|       |                     if constexpr (counts::n_object > 0) {
 6047|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|       |                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|       |                     return;
 6054|       |                  }
 6055|       |               }
 6056|       |
 6057|   611k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|   611k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|   611k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|   611k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|   611k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 602k, False: 9.24k]
  ------------------
 6062|   602k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|   602k|               }
 6064|   611k|               return;
 6065|   611k|            }
 6066|   537k|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 537k, False: 2.81M]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6070|       |                     if constexpr (counts::n_object > 0) {
 6071|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|       |                                                                                                        end);
 6073|       |                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|       |                  }
 6080|       |               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|   537k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|   537k|               return;
 6085|   611k|            }
 6086|   162k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 162k, False: 3.19M]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|   162k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|   162k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 52, False: 162k]
  ------------------
 6090|     52|                  ctx.error = error_code::syntax_error;
 6091|     52|                  return;
 6092|     52|               }
 6093|   162k|               yaml::skip_inline_ws(it, end);
 6094|   162k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 161k, False: 936]
  |  Branch (6094:33): [True: 9.90k, False: 151k]
  ------------------
 6095|  9.90k|                  yaml::skip_comment(it, end);
 6096|  9.90k|               }
 6097|   162k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 161k, False: 1.33k]
  |  Branch (6097:34): [True: 28.3k, False: 133k]
  |  Branch (6097:49): [True: 21.0k, False: 111k]
  ------------------
 6098|  49.4k|                  auto content = it;
 6099|  49.4k|                  yaml::skip_newline(content, end);
 6100|  49.4k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  49.4k|                  bool consume_following_content = false;
 6103|  49.4k|                  auto content_token = content;
 6104|  49.4k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 48.3k, False: 1.05k]
  ------------------
 6105|  48.3k|                     auto indent_probe = content;
 6106|  48.3k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  48.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 3, False: 48.3k]
  ------------------
 6108|      3|                        return;
 6109|  48.3k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  48.3k|                     bool tagged_indentless_sequence = false;
 6114|  48.3k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 8.13k, False: 40.2k]
  |  Branch (6114:56): [True: 8.13k, False: 0]
  |  Branch (6114:79): [True: 7.03k, False: 1.10k]
  ------------------
 6115|  7.03k|                        const auto after_dash = indent_probe + 1;
 6116|  7.03k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 403, False: 6.62k]
  ------------------
 6117|  6.62k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 4.08k, False: 2.54k]
  ------------------
 6118|  4.48k|                           tagged_indentless_sequence =
 6119|  4.48k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 966, False: 3.52k]
  ------------------
 6120|  3.52k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 697, False: 2.82k]
  |  Branch (6120:60): [True: 179, False: 518]
  ------------------
 6121|  4.48k|                        }
 6122|  7.03k|                     }
 6123|       |
 6124|  48.3k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 28.3k, False: 20.0k]
  ------------------
 6125|  20.0k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 4.39k, False: 15.6k]
  |  Branch (6125:93): [True: 1.14k, False: 14.4k]
  ------------------
 6126|  48.3k|                  }
 6127|       |
 6128|  49.4k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 33.8k, False: 15.5k]
  ------------------
 6129|  33.8k|                     it = content_token;
 6130|  33.8k|                  }
 6131|  15.5k|                  else {
 6132|  15.5k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 443, False: 15.1k]
  ------------------
 6133|    443|                        if constexpr (counts::n_str > 0) {
 6134|    443|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|    443|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|    443|                           value = StrType{};
 6137|    443|                           return;
 6138|    443|                        }
 6139|    443|                     }
 6140|  15.5k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 120, False: 15.4k]
  ------------------
 6141|    120|                        if constexpr (counts::n_null > 0) {
 6142|    120|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|    120|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|    120|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 120]
  ------------------
 6145|    120|                           return;
 6146|    120|                        }
 6147|    120|                     }
 6148|  15.5k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 14.2k, False: 1.25k]
  ------------------
 6149|  14.2k|                        if constexpr (counts::n_null > 0) {
 6150|  14.2k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  14.2k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  14.2k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 14.2k]
  ------------------
 6153|  14.2k|                           return;
 6154|  14.2k|                        }
 6155|  14.2k|                     }
 6156|  15.5k|                  }
 6157|  49.4k|               }
 6158|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|       |                  if (it != end && *it == ',') {
 6162|       |                     ctx.error = error_code::syntax_error;
 6163|       |                     return;
 6164|       |                  }
 6165|       |                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|       |                     const bool starts_block_sequence_entry =
 6168|       |                        (it != end && *it == '-') &&
 6169|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6170|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|       |                        return;
 6175|       |                     }
 6176|       |                  }
 6177|       |               }
 6178|   162k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 1.33k, False: 161k]
  ------------------
 6179|  1.33k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 265, False: 1.06k]
  ------------------
 6180|    265|                     if constexpr (counts::n_str > 0) {
 6181|    265|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    265|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    265|                        value = StrType{};
 6184|    265|                        return;
 6185|    265|                     }
 6186|    265|                  }
 6187|  1.33k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 1.06k, False: 273]
  ------------------
 6188|  1.06k|                     if constexpr (counts::n_null > 0) {
 6189|  1.06k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|  1.06k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|  1.06k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 1.06k]
  ------------------
 6192|  1.06k|                        return;
 6193|  1.06k|                     }
 6194|  1.06k|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  1.33k|                  return;
 6197|  1.33k|               }
 6198|   161k|               switch (tag) {
 6199|  1.78k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 1.78k, False: 159k]
  ------------------
 6200|  1.78k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|  1.78k|                  return;
 6202|  4.58k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 4.58k, False: 156k]
  ------------------
 6203|  4.68k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 101, False: 161k]
  ------------------
 6204|  4.68k|                  if constexpr (counts::n_num > 0) {
 6205|  4.68k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  4.68k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  18.4k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 13.7k, False: 147k]
  ------------------
 6213|  18.4k|                  if constexpr (counts::n_bool > 0) {
 6214|  18.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  18.4k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  19.4k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 986, False: 160k]
  ------------------
 6222|  19.4k|                  if constexpr (counts::n_null > 0) {
 6223|  19.4k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  19.4k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  19.4k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 19.4k]
  ------------------
 6226|  19.4k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  19.4k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  32.3k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 12.8k, False: 148k]
  ------------------
 6234|  32.3k|                  if constexpr (counts::n_object > 0) {
 6235|  32.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  32.3k|                                                                                                     end);
 6237|  32.3k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|  65.4k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 33.1k, False: 128k]
  ------------------
 6244|  65.4k|                  if constexpr (counts::n_array > 0) {
 6245|  65.4k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|       |                        if (it != end && *it == '-') {
 6248|       |                           ctx.allow_indentless_sequence = true;
 6249|       |                        }
 6250|       |                     }
 6251|  65.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|  65.4k|                                                                                                    end);
 6253|  65.4k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|  65.4k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|   144k|               default: {
  ------------------
  |  Branch (6260:16): [True: 79.2k, False: 82.1k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|   144k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 79.2k, False: 65.4k]
  |  Branch (6263:36): [True: 11.8k, False: 67.4k]
  ------------------
 6264|  11.8k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  11.8k|                     return;
 6266|  11.8k|                  }
 6267|       |
 6268|   132k|                  if constexpr (counts::n_array > 0) {
 6269|   132k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 67.4k, False: 65.4k]
  |  Branch (6269:39): [True: 2.86k, False: 64.5k]
  ------------------
 6270|  2.86k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|  2.86k|                                                                                                       end);
 6272|  2.86k|                        return;
 6273|  2.86k|                     }
 6274|   132k|                  }
 6275|   132k|                  if constexpr (counts::n_object > 0) {
 6276|   132k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 64.5k, False: 68.3k]
  |  Branch (6276:39): [True: 11.6k, False: 52.9k]
  ------------------
 6277|  11.6k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|  11.6k|                                                                                                        end);
 6279|  11.6k|                        return;
 6280|  11.6k|                     }
 6281|   132k|                  }
 6282|       |
 6283|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|       |                     if constexpr (counts::n_array > 0) {
 6285|       |                        const bool starts_block_sequence_entry =
 6286|       |                           (it != end && *it == '-') &&
 6287|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6288|       |                        if (starts_block_sequence_entry) {
 6289|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|       |                                                                                                          it, end);
 6291|       |                           return;
 6292|       |                        }
 6293|       |                     }
 6294|       |                     if constexpr (counts::n_object > 0) {
 6295|       |                        const bool starts_explicit_mapping_indicator =
 6296|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6297|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6298|       |                        if (starts_explicit_mapping_indicator) {
 6299|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|       |                                                                                                           it, end);
 6301|       |                           return;
 6302|       |                        }
 6303|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6304|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|       |                                                                                                           it, end);
 6306|       |                           return;
 6307|       |                        }
 6308|       |                     }
 6309|       |                  }
 6310|       |
 6311|   132k|                  if constexpr (counts::n_str > 0) {
 6312|   132k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|   132k|                     return;
 6314|   132k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|   132k|                  return;
 6319|   144k|               }
 6320|   161k|               }
 6321|      0|               return;
 6322|   161k|            }
 6323|   667k|            case '{':
  ------------------
  |  Branch (6323:13): [True: 667k, False: 2.68M]
  ------------------
 6324|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6327|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|       |                                                                                                     end);
 6329|       |                     return;
 6330|       |                  }
 6331|       |               }
 6332|       |               // Flow mapping - object type
 6333|   667k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|   667k|               return;
 6335|  52.2k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 52.2k, False: 3.30M]
  ------------------
 6336|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6339|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|       |                                                                                                     end);
 6341|       |                     return;
 6342|       |                  }
 6343|       |               }
 6344|       |               // Flow sequence - array type
 6345|  52.2k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|  52.2k|               return;
 6347|   150k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 150k, False: 3.20M]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   150k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 148k, False: 1.64k]
  |  Branch (6349:39): [True: 3, False: 148k]
  ------------------
 6350|      3|                  ctx.error = error_code::syntax_error;
 6351|      3|                  return;
 6352|      3|               }
 6353|   150k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 148k, False: 1.64k]
  |  Branch (6353:40): [True: 44.6k, False: 103k]
  |  Branch (6353:56): [True: 59.2k, False: 44.5k]
  |  Branch (6353:73): [True: 23.4k, False: 21.1k]
  ------------------
 6354|   127k|                  if constexpr (counts::n_object > 0) {
 6355|   127k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   127k|                                                                                                     end);
 6357|   127k|                     return;
 6358|   127k|                  }
 6359|   127k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   150k|               return;
 6362|    127|            case '%':
  ------------------
  |  Branch (6362:13): [True: 127, False: 3.35M]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|    127|               ctx.error = error_code::syntax_error;
 6365|    127|               return;
 6366|  3.31k|            case '"':
  ------------------
  |  Branch (6366:13): [True: 3.31k, False: 3.35M]
  ------------------
 6367|  7.05k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 3.73k, False: 3.35M]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  7.05k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  7.05k|               return;
 6372|  30.7k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 30.7k, False: 3.32M]
  ------------------
 6373|  34.6k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 3.84k, False: 3.35M]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  34.6k|               if constexpr (counts::n_bool > 0) {
 6376|  34.6k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 34.2k, False: 395]
  |  Branch (6376:44): [True: 25.0k, False: 9.20k]
  |  Branch (6376:60): [True: 21.0k, False: 3.95k]
  |  Branch (6376:76): [True: 15.0k, False: 6.06k]
  ------------------
 6377|  19.2k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 4.86k, False: 14.3k]
  |  Branch (6377:60): [True: 903, False: 3.95k]
  |  Branch (6377:76): [True: 165, False: 738]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  15.1k|                     const auto after_true = it + 4;
 6380|  15.1k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  15.1k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 4.25k, False: 10.9k]
  ------------------
 6383|  4.25k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 0, False: 4.25k]
  ------------------
 6384|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|      0|                           return;
 6386|      0|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  4.25k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 3.57k, False: 677]
  |  Branch (6389:47): [True: 1.78k, False: 1.78k]
  ------------------
 6390|  1.78k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 416, False: 1.37k]
  |  Branch (6390:47): [True: 189, False: 1.18k]
  |  Branch (6390:63): [True: 456, False: 728]
  |  Branch (6390:80): [True: 224, False: 504]
  |  Branch (6390:97): [True: 504, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  1.78k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  1.78k|                           return;
 6394|  1.78k|                        }
 6395|  2.46k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  2.46k|                                                                                                      end);
 6397|  2.46k|                        return;
 6398|  4.25k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  15.1k|                  }
 6401|  34.6k|               }
 6402|  30.3k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  34.6k|               return;
 6404|  57.8k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 57.8k, False: 3.29M]
  ------------------
 6405|  72.3k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 14.5k, False: 3.34M]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|  72.3k|               if constexpr (counts::n_bool > 0) {
 6408|  72.3k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 70.9k, False: 1.40k]
  |  Branch (6408:44): [True: 35.2k, False: 35.7k]
  |  Branch (6408:60): [True: 27.0k, False: 8.23k]
  |  Branch (6408:76): [True: 25.7k, False: 1.24k]
  |  Branch (6408:92): [True: 20.0k, False: 5.73k]
  ------------------
 6409|  50.9k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 9.06k, False: 41.8k]
  |  Branch (6409:60): [True: 6.90k, False: 2.15k]
  |  Branch (6409:76): [True: 6.19k, False: 714]
  |  Branch (6409:92): [True: 4.45k, False: 1.74k]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  24.5k|                     const auto after_false = it + 5;
 6412|  24.5k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  24.5k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 22.0k, False: 2.44k]
  ------------------
 6415|  22.0k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 0, False: 22.0k]
  ------------------
 6416|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|      0|                           return;
 6418|      0|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  22.0k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 19.3k, False: 2.67k]
  |  Branch (6421:47): [True: 14.6k, False: 4.71k]
  ------------------
 6422|  14.6k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 209, False: 14.4k]
  |  Branch (6422:47): [True: 509, False: 13.9k]
  |  Branch (6422:63): [True: 352, False: 13.6k]
  |  Branch (6422:80): [True: 1.95k, False: 11.6k]
  |  Branch (6422:97): [True: 11.6k, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  14.6k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  14.6k|                           return;
 6426|  14.6k|                        }
 6427|  7.39k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  7.39k|                                                                                                      end);
 6429|  7.39k|                        return;
 6430|  22.0k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  24.5k|                  }
 6433|  72.3k|               }
 6434|  50.3k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|  72.3k|               return;
 6436|  38.1k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 38.1k, False: 3.31M]
  ------------------
 6437|  47.5k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 9.43k, False: 3.34M]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  47.5k|               if constexpr (counts::n_null > 0) {
 6440|  47.5k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 45.8k, False: 1.71k]
  |  Branch (6440:44): [True: 22.7k, False: 23.1k]
  |  Branch (6440:60): [True: 21.3k, False: 1.34k]
  |  Branch (6440:76): [True: 17.8k, False: 3.54k]
  ------------------
 6441|  28.0k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 1.29k, False: 26.7k]
  |  Branch (6441:60): [True: 1.05k, False: 246]
  |  Branch (6441:76): [True: 734, False: 316]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  18.5k|                     const auto after_null = it + 4;
 6444|  18.5k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  18.5k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 16.0k, False: 2.54k]
  ------------------
 6447|  16.0k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 0, False: 16.0k]
  ------------------
 6448|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|      0|                           return;
 6450|      0|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  16.0k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 15.8k, False: 213]
  |  Branch (6453:47): [True: 13.4k, False: 2.33k]
  ------------------
 6454|  13.4k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 21, False: 13.4k]
  |  Branch (6454:47): [True: 349, False: 13.1k]
  |  Branch (6454:63): [True: 12.6k, False: 490]
  |  Branch (6454:80): [True: 183, False: 307]
  |  Branch (6454:97): [True: 307, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  13.4k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  13.4k|                           return;
 6458|  13.4k|                        }
 6459|  2.55k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  2.55k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  2.55k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 2.55k]
  ------------------
 6462|  2.55k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  2.55k|                        return;
 6464|  16.0k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  18.5k|                  }
 6467|  47.5k|               }
 6468|  31.5k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  47.5k|               return;
 6470|  2.24k|            case '~':
  ------------------
  |  Branch (6470:13): [True: 2.24k, False: 3.35M]
  ------------------
 6471|       |               // Null indicator
 6472|  2.24k|               if constexpr (counts::n_null > 0) {
 6473|  2.24k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|  2.24k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|  2.24k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 2.24k]
  ------------------
 6476|  2.24k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|  2.24k|                  return;
 6478|  2.24k|               }
 6479|      0|               break; // Fall through to try other types
 6480|   377k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 377k, False: 2.97M]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|   377k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 2.07k, False: 375k]
  |  Branch (6482:41): [True: 305k, False: 69.9k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|   307k|                  if constexpr (counts::n_array > 0) {
 6485|   307k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|   307k|                                                                                                    end);
 6487|   307k|                     return;
 6488|   307k|                  }
 6489|   307k|               }
 6490|   377k|               if constexpr (counts::n_num > 0) {
 6491|   377k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 69.9k, False: 307k]
  |  Branch (6491:43): [True: 3.67k, False: 66.2k]
  |  Branch (6491:94): [True: 27.2k, False: 39.0k]
  ------------------
 6492|  30.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|  30.8k|                     return;
 6494|  30.8k|                  }
 6495|   377k|               }
 6496|   346k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|   377k|               return;
 6498|  31.6k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 31.6k, False: 3.32M]
  ------------------
 6499|  47.8k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 16.2k, False: 3.34M]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  47.8k|               if constexpr (counts::n_num > 0) {
 6503|  47.8k|                  auto start_it = it;
 6504|  47.8k|                  auto temp_ctx = ctx.make_speculative();
 6505|  47.8k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  47.8k|                                                                                               end);
 6507|  47.8k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  47.8k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  47.8k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 3.96k, False: 43.8k]
  ------------------
 6510|  3.96k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  3.96k|                     return; // Successfully parsed as number
 6512|  3.96k|                  }
 6513|  43.8k|                  it = start_it; // Restore and fall through to string
 6514|  43.8k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  47.8k|               return;
 6517|   573k|            default:
  ------------------
  |  Branch (6517:13): [True: 573k, False: 2.78M]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|   573k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 304k, False: 268k]
  |  Branch (6519:32): [True: 114k, False: 190k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|   114k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 6.87k, False: 107k]
  ------------------
 6522|  6.87k|                     return;
 6523|  6.87k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|   107k|                  if constexpr (counts::n_num > 0) {
 6526|   107k|                     auto start_it = it;
 6527|   107k|                     auto temp_ctx = ctx.make_speculative();
 6528|   107k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|   107k|                                                                                                  end);
 6530|   107k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|   107k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|   107k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 52.4k, False: 54.7k]
  ------------------
 6533|  52.4k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|  52.4k|                        return; // Successfully parsed as number
 6535|  52.4k|                     }
 6536|  54.7k|                     it = start_it; // Restore and fall through to string
 6537|  54.7k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|   107k|                  return;
 6541|   114k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   459k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   459k|               return;
 6545|  3.35M|            }
 6546|  3.35M|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|  3.35M|         error_code expansion_error{};
 6556|  3.35M|         std::string_view expansion_message{};
 6557|       |
 6558|  3.35M|         auto try_parse = [&]<size_t I>() -> bool {
 6559|  3.35M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|  3.35M|            auto start = it;
 6561|       |
 6562|  3.35M|            V v{};
 6563|  3.35M|            auto temp_ctx = ctx.make_speculative();
 6564|  3.35M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|  3.35M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|  3.35M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|  3.35M|            if (!bool(temp_ctx.error)) {
 6569|  3.35M|               value = std::move(v);
 6570|  3.35M|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|  3.35M|               return true;
 6572|  3.35M|            }
 6573|       |
 6574|  3.35M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|  3.35M|               expansion_error = temp_ctx.error;
 6576|  3.35M|               expansion_message = temp_ctx.custom_error_message;
 6577|  3.35M|            }
 6578|  3.35M|            it = start;
 6579|  3.35M|            return false;
 6580|  3.35M|         };
 6581|       |
 6582|  3.35M|         bool parsed = false;
 6583|  3.35M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|  3.35M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|  3.35M|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|  3.35M|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 3.35M]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|  3.35M|      }
_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|   549k|      {
  301|   549k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 549k]
  |  Branch (301:27): [True: 0, False: 549k]
  ------------------
  302|       |
  303|   549k|         ++it; // skip '*'
  304|   549k|         auto name = parse_anchor_name(it, end);
  305|   549k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 109, False: 549k]
  ------------------
  306|    109|            ctx.error = error_code::syntax_error;
  307|    109|            return true;
  308|    109|         }
  309|       |
  310|   549k|         auto anchor_it = ctx.anchors.find(name);
  311|   549k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 352, False: 548k]
  ------------------
  312|    352|            ctx.error = error_code::syntax_error; // undefined alias
  313|    352|            return true;
  314|    352|         }
  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|   548k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   548k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 5.69k, False: 543k]
  ------------------
  322|  5.69k|            return true;
  323|  5.69k|         }
  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|   543k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 17, False: 543k]
  ------------------
  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|   543k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   543k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 543k]
  ------------------
  339|      1|            return true;
  340|       |
  341|   543k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 8, False: 543k]
  ------------------
  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|   543k|         auto replay_it = span.begin;
  348|   543k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   543k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   543k|         ctx.indent_stack.clear();
  353|   543k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 15.1k, False: 528k]
  ------------------
  354|  15.1k|            ctx.push_indent(span.base_indent - 1);
  355|  15.1k|         }
  356|       |
  357|   543k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   543k|         using V = std::remove_cvref_t<T>;
  360|   543k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   543k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   543k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   543k|         return true;
  367|   543k|      }
_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_:
 5205|   636k|      {
 5206|   636k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   636k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   636k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   636k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   636k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 636k, False: 0]
  ------------------
 5216|   636k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   636k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1892|   659k|      {
 1893|   659k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 2.49k, False: 656k]
  ------------------
 1894|  2.49k|            return;
 1895|       |
 1896|   656k|         yaml::node_preamble_state preamble{};
 1897|   656k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 24.5k, False: 632k]
  ------------------
 1898|   656k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  24.5k|            return;
 1900|       |
 1901|   632k|         std::string str;
 1902|   632k|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|   632k|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 632k, False: 0]
  ------------------
 1905|  2.47k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 2.47k, False: 629k]
  ------------------
 1906|  2.47k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|  2.47k|            break;
 1908|  3.90k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 3.90k, False: 628k]
  ------------------
 1909|  3.90k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  3.90k|            break;
 1911|    700|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 700, False: 631k]
  ------------------
 1912|  4.17k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 3.47k, False: 628k]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  4.17k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  4.17k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 541, False: 3.63k]
  ------------------
 1918|  4.17k|            break;
 1919|   621k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 621k, False: 10.5k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|       |               if (ctx.current_indent() >= 0) {
 1924|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|       |               }
 1926|       |               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|       |               }
 1930|       |            }
 1931|   621k|            else {
 1932|   621k|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|   621k|            }
 1934|   621k|            break;
 1935|   632k|         }
 1936|       |
 1937|   632k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 632k, False: 225]
  ------------------
 1938|   632k|            value = std::move(str);
 1939|   632k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|   632k|         }
 1941|   632k|      }
_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|   656k|      {
  466|   656k|         skip_inline_ws(it, end);
  467|       |
  468|   656k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 5, False: 656k]
  ------------------
  469|      5|            if constexpr (!AllowEmptyInput) {
  470|      5|               ctx.error = error_code::unexpected_end;
  471|      5|            }
  472|      5|            return true;
  473|      5|         }
  474|       |
  475|   656k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   656k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 15, False: 656k]
  ------------------
  477|     15|            ctx.error = error_code::syntax_error;
  478|     15|            return true;
  479|     15|         }
  480|   656k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 656k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|   656k|         skip_inline_ws(it, end);
  486|       |
  487|   656k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 7, False: 656k]
  ------------------
  488|      7|            if constexpr (!AllowEmptyInput) {
  489|      7|               ctx.error = error_code::unexpected_end;
  490|      7|            }
  491|      7|            return true;
  492|      7|         }
  493|       |
  494|   656k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 24.5k, False: 632k]
  ------------------
  495|  24.5k|            return true;
  496|  24.5k|         }
  497|       |
  498|   632k|         return false;
  499|   656k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1898|   656k|                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|   656k|      {
  409|   656k|         state.has_anchor = false;
  410|   656k|         state.anchor_name.clear();
  411|   656k|         state.anchor_start = nullptr;
  412|   656k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   656k|         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|   656k|            else {
  421|   656k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 24.4k, False: 632k]
  ------------------
  422|   656k|            }
  423|   656k|         }
  424|       |
  425|   656k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 632k, False: 24.4k]
  |  Branch (425:27): [True: 10.3k, False: 622k]
  ------------------
  426|  10.3k|            ++it;
  427|  10.3k|            auto name = parse_anchor_name(it, end);
  428|  10.3k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 6, False: 10.3k]
  ------------------
  429|      6|               ctx.error = error_code::syntax_error;
  430|      6|               return true;
  431|      6|            }
  432|  10.3k|            skip_inline_ws(it, end);
  433|  10.3k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 15, False: 10.3k]
  ------------------
  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|  10.3k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  10.3k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 8, False: 10.3k]
  ------------------
  441|      8|                  ctx.error = error_code::syntax_error;
  442|      8|                  return true;
  443|      8|               }
  444|  10.3k|            }
  445|  10.3k|            state.has_anchor = true;
  446|  10.3k|            state.anchor_name = std::string(name);
  447|  10.3k|            state.anchor_start = &*it;
  448|  10.3k|         }
  449|       |
  450|   656k|         return false;
  451|   656k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   656k|      {
  301|   656k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 656k]
  |  Branch (301:27): [True: 632k, False: 24.4k]
  ------------------
  302|       |
  303|  24.4k|         ++it; // skip '*'
  304|  24.4k|         auto name = parse_anchor_name(it, end);
  305|  24.4k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 6, False: 24.4k]
  ------------------
  306|      6|            ctx.error = error_code::syntax_error;
  307|      6|            return true;
  308|      6|         }
  309|       |
  310|  24.4k|         auto anchor_it = ctx.anchors.find(name);
  311|  24.4k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 15, False: 24.4k]
  ------------------
  312|     15|            ctx.error = error_code::syntax_error; // undefined alias
  313|     15|            return true;
  314|     15|         }
  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|  24.4k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  24.4k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.26k, False: 23.2k]
  ------------------
  322|  1.26k|            return true;
  323|  1.26k|         }
  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.2k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 5, False: 23.2k]
  ------------------
  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|  23.2k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  23.2k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 23.2k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  23.2k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 23.2k]
  ------------------
  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|  23.2k|         auto replay_it = span.begin;
  348|  23.2k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  23.2k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  23.2k|         ctx.indent_stack.clear();
  353|  23.2k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.52k, False: 21.6k]
  ------------------
  354|  1.52k|            ctx.push_indent(span.base_indent - 1);
  355|  1.52k|         }
  356|       |
  357|  23.2k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  23.2k|         using V = std::remove_cvref_t<T>;
  360|  23.2k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  23.2k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  23.2k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  23.2k|         return true;
  367|  23.2k|      }
_ZN3glz4yaml26parse_double_quoted_stringINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_:
  505|  54.2k|      {
  506|  54.2k|         static constexpr size_t string_padding_bytes = 8;
  507|       |
  508|  54.2k|         if (it == end || *it != '"') [[unlikely]] {
  ------------------
  |  Branch (508:14): [True: 0, False: 54.2k]
  |  Branch (508:27): [True: 0, False: 54.2k]
  ------------------
  509|      0|            ctx.error = error_code::expected_quote;
  510|      0|            return;
  511|      0|         }
  512|       |
  513|  54.2k|         ++it; // skip opening quote
  514|  54.2k|         auto start = it;
  515|       |
  516|       |         // Pass 1: Find closing quote byte-by-byte (need to handle newlines and escapes)
  517|  24.5M|         while (it != end && *it != '"') {
  ------------------
  |  Branch (517:17): [True: 24.5M, False: 614]
  |  Branch (517:30): [True: 24.5M, False: 53.5k]
  ------------------
  518|  24.5M|            if (*it == '\\') {
  ------------------
  |  Branch (518:17): [True: 680k, False: 23.8M]
  ------------------
  519|   680k|               ++it;
  520|   680k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (520:20): [True: 34, False: 680k]
  ------------------
  521|     34|                  ctx.error = error_code::unexpected_end;
  522|     34|                  return;
  523|     34|               }
  524|   680k|            }
  525|  24.5M|            ++it;
  526|  24.5M|         }
  527|       |
  528|  54.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (528:14): [True: 614, False: 53.5k]
  ------------------
  529|    614|            ctx.error = error_code::unexpected_end;
  530|    614|            return;
  531|    614|         }
  532|       |
  533|       |         // Allocate buffer with room for potential expansion and SWAR padding
  534|       |         // Some YAML escapes expand: \L, \P -> 3 bytes UTF-8
  535|  53.5k|         const auto input_len = static_cast<size_t>(it - start);
  536|  53.5k|         value.resize(input_len + (input_len / 2) + string_padding_bytes);
  537|  53.5k|         auto* dst = value.data();
  538|  53.5k|         auto* const dst_start = dst;
  539|       |
  540|       |         // Pass 2: Copy and process escapes and line folding
  541|  53.5k|         auto src = start;
  542|  53.5k|         const auto* const src_end = &*it;
  543|       |         // Track position past which we should not trim. Escape-produced characters
  544|       |         // (even whitespace like \t) are content and must not be trimmed by line folding.
  545|  53.5k|         auto* last_non_trimmable = dst;
  546|       |
  547|  14.9M|         while (src < src_end) {
  ------------------
  |  Branch (547:17): [True: 14.9M, False: 52.9k]
  ------------------
  548|       |            // Check for newline - needs line folding
  549|  14.9M|            if (*src == '\n' || *src == '\r') {
  ------------------
  |  Branch (549:17): [True: 160k, False: 14.7M]
  |  Branch (549:33): [True: 201k, False: 14.5M]
  ------------------
  550|       |               // Trim trailing LITERAL whitespace from output before processing newline.
  551|       |               // Escape-produced whitespace (e.g. from \t) is preserved.
  552|   362k|               dst = (std::max)(last_non_trimmable, dst_start);
  553|       |
  554|       |               // Skip the newline
  555|   362k|               if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (555:20): [True: 201k, False: 160k]
  |  Branch (555:36): [True: 201k, False: 270]
  |  Branch (555:59): [True: 5.11k, False: 196k]
  ------------------
  556|  5.11k|                  src += 2; // CRLF
  557|  5.11k|               }
  558|   356k|               else {
  559|   356k|                  ++src;
  560|   356k|               }
  561|       |
  562|       |               // Skip leading indentation on the next line.
  563|   362k|               int indent_count = 0;
  564|   362k|               if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (564:20): [True: 54, False: 362k]
  ------------------
  565|   362k|               if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (565:20): [True: 269k, False: 92.9k]
  |  Branch (565:41): [True: 98, False: 269k]
  ------------------
  566|     98|                  ctx.error = error_code::syntax_error;
  567|     98|                  return;
  568|     98|               }
  569|       |
  570|       |               // Check if this is a blank line (another newline follows)
  571|   361k|               if (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (571:20): [True: 361k, False: 694]
  |  Branch (571:38): [True: 33.6k, False: 327k]
  |  Branch (571:54): [True: 61.3k, False: 266k]
  ------------------
  572|       |                  // Blank line(s) - output newlines for each blank line
  573|   416k|                  while (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (573:26): [True: 415k, False: 1.13k]
  |  Branch (573:44): [True: 168k, False: 247k]
  |  Branch (573:60): [True: 153k, False: 93.7k]
  ------------------
  574|   322k|                     *dst++ = '\n';
  575|       |                     // Skip the newline
  576|   322k|                     if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (576:26): [True: 153k, False: 168k]
  |  Branch (576:42): [True: 153k, False: 758]
  |  Branch (576:65): [True: 33.9k, False: 119k]
  ------------------
  577|  33.9k|                        src += 2; // CRLF
  578|  33.9k|                     }
  579|   288k|                     else {
  580|   288k|                        ++src;
  581|   288k|                     }
  582|   322k|                     int blank_indent_count = 0;
  583|   322k|                     if (!yaml::skip_folded_line_indent(src, src_end, ctx, &blank_indent_count)) return;
  ------------------
  |  Branch (583:26): [True: 34, False: 322k]
  ------------------
  584|   322k|                     if (blank_indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (584:26): [True: 270k, False: 51.1k]
  |  Branch (584:53): [True: 68, False: 270k]
  ------------------
  585|     68|                        ctx.error = error_code::syntax_error;
  586|     68|                        return;
  587|     68|                     }
  588|   322k|                  }
  589|       |                  // Don't add space - we're now at content after blank line(s)
  590|  95.0k|               }
  591|   266k|               else {
  592|       |                  // Single newline - fold to space
  593|   266k|                  *dst++ = ' ';
  594|   266k|               }
  595|   361k|               last_non_trimmable = dst;
  596|   361k|               continue;
  597|   361k|            }
  598|       |
  599|  14.5M|            if (*src == '\\') {
  ------------------
  |  Branch (599:17): [True: 352k, False: 14.2M]
  ------------------
  600|   352k|               ++src;
  601|   352k|               if (src >= src_end) [[unlikely]] {
  ------------------
  |  Branch (601:20): [True: 0, False: 352k]
  ------------------
  602|       |                  // Shouldn't happen - we validated in pass 1
  603|      0|                  ctx.error = error_code::syntax_error;
  604|      0|                  return;
  605|      0|               }
  606|       |
  607|   352k|               const unsigned char esc = static_cast<unsigned char>(*src);
  608|       |
  609|       |               // Check for escaped newline (line continuation - no space)
  610|   352k|               if (esc == '\n' || esc == '\r') {
  ------------------
  |  Branch (610:20): [True: 2.00k, False: 350k]
  |  Branch (610:35): [True: 3.90k, False: 346k]
  ------------------
  611|       |                  // Skip the newline
  612|  5.91k|                  if (esc == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (612:23): [True: 3.90k, False: 2.00k]
  |  Branch (612:38): [True: 3.59k, False: 308]
  |  Branch (612:61): [True: 2.15k, False: 1.43k]
  ------------------
  613|  2.15k|                     src += 2; // CRLF
  614|  2.15k|                  }
  615|  3.75k|                  else {
  616|  3.75k|                     ++src;
  617|  3.75k|                  }
  618|       |
  619|  5.91k|                  int indent_count = 0;
  620|  5.91k|                  if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (620:23): [True: 18, False: 5.89k]
  ------------------
  621|  5.89k|                  if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (621:23): [True: 4.31k, False: 1.58k]
  |  Branch (621:44): [True: 86, False: 4.22k]
  ------------------
  622|     86|                     ctx.error = error_code::syntax_error;
  623|     86|                     return;
  624|     86|                  }
  625|       |                  // No output - this is line continuation without space
  626|  5.80k|                  last_non_trimmable = dst;
  627|  5.80k|                  continue;
  628|  5.89k|               }
  629|       |
  630|       |               // Check simple escape table first
  631|   346k|               if (yaml_escape_is_simple[esc]) {
  ------------------
  |  Branch (631:20): [True: 171k, False: 175k]
  ------------------
  632|   171k|                  *dst++ = yaml_unescape_table[esc];
  633|   171k|                  ++src;
  634|   171k|               }
  635|       |               // Handle escapes requiring special processing
  636|   175k|               else if (yaml_escape_needs_special[esc]) {
  ------------------
  |  Branch (636:25): [True: 154k, False: 21.4k]
  ------------------
  637|   154k|                  ++src; // skip escape char
  638|   154k|                  switch (esc) {
  639|  19.6k|                  case 'x': {
  ------------------
  |  Branch (639:19): [True: 19.6k, False: 134k]
  ------------------
  640|       |                     // \xXX - 2 hex digits
  641|  19.6k|                     if (static_cast<size_t>(src_end - src) < 2) [[unlikely]] {
  ------------------
  |  Branch (641:26): [True: 8, False: 19.6k]
  ------------------
  642|      8|                        ctx.error = error_code::syntax_error;
  643|      8|                        return;
  644|      8|                     }
  645|  19.6k|                     const uint32_t hi = digit_hex_table[static_cast<unsigned char>(src[0])];
  646|  19.6k|                     const uint32_t lo = digit_hex_table[static_cast<unsigned char>(src[1])];
  647|  19.6k|                     if ((hi | lo) & 0xF0) [[unlikely]] {
  ------------------
  |  Branch (647:26): [True: 48, False: 19.6k]
  ------------------
  648|     48|                        ctx.error = error_code::syntax_error;
  649|     48|                        return;
  650|     48|                     }
  651|  19.6k|                     const uint32_t codepoint = (hi << 4) | lo;
  652|  19.6k|                     src += 2;
  653|  19.6k|                     dst += code_point_to_utf8(codepoint, dst);
  654|  19.6k|                     break;
  655|  19.6k|                  }
  656|  1.09k|                  case 'u': {
  ------------------
  |  Branch (656:19): [True: 1.09k, False: 153k]
  ------------------
  657|       |                     // \uXXXX - 4 hex digits
  658|  1.09k|                     if (static_cast<size_t>(src_end - src) < 4) [[unlikely]] {
  ------------------
  |  Branch (658:26): [True: 6, False: 1.09k]
  ------------------
  659|      6|                        ctx.error = error_code::syntax_error;
  660|      6|                        return;
  661|      6|                     }
  662|  1.09k|                     const uint32_t codepoint = hex_to_u32(src);
  663|  1.09k|                     if (codepoint == 0xFFFFFFFFu || (codepoint >= 0xD800 && codepoint <= 0xDFFF)) [[unlikely]] {
  ------------------
  |  Branch (663:26): [True: 32, False: 1.05k]
  |  Branch (663:55): [True: 406, False: 652]
  |  Branch (663:78): [True: 10, False: 396]
  ------------------
  664|     42|                        ctx.error = error_code::syntax_error;
  665|     42|                        return;
  666|     42|                     }
  667|  1.04k|                     src += 4;
  668|  1.04k|                     dst += code_point_to_utf8(codepoint, dst);
  669|  1.04k|                     break;
  670|  1.09k|                  }
  671|   126k|                  case 'U': {
  ------------------
  |  Branch (671:19): [True: 126k, False: 27.9k]
  ------------------
  672|       |                     // \UXXXXXXXX - 8 hex digits
  673|   126k|                     if (static_cast<size_t>(src_end - src) < 8) [[unlikely]] {
  ------------------
  |  Branch (673:26): [True: 14, False: 126k]
  ------------------
  674|     14|                        ctx.error = error_code::syntax_error;
  675|     14|                        return;
  676|     14|                     }
  677|   126k|                     const uint32_t hi = hex_to_u32(src);
  678|   126k|                     const uint32_t lo = hex_to_u32(src + 4);
  679|   126k|                     if ((hi | lo) == 0xFFFFFFFFu) [[unlikely]] {
  ------------------
  |  Branch (679:26): [True: 92, False: 126k]
  ------------------
  680|     92|                        ctx.error = error_code::syntax_error;
  681|     92|                        return;
  682|     92|                     }
  683|   126k|                     const uint32_t codepoint = (hi << 16) | lo;
  684|   126k|                     src += 8;
  685|   126k|                     if (codepoint >= 0xD800 && codepoint <= 0xDFFF) [[unlikely]] {
  ------------------
  |  Branch (685:26): [True: 61.7k, False: 64.3k]
  |  Branch (685:49): [True: 10, False: 61.7k]
  ------------------
  686|     10|                        ctx.error = error_code::syntax_error;
  687|     10|                        return;
  688|     10|                     }
  689|   126k|                     if (codepoint <= 0x10FFFF) {
  ------------------
  |  Branch (689:26): [True: 64.6k, False: 61.3k]
  ------------------
  690|  64.6k|                        dst += code_point_to_utf8(codepoint, dst);
  691|  64.6k|                     }
  692|   126k|                     break;
  693|   126k|                  }
  694|  6.60k|                  case 'N': {
  ------------------
  |  Branch (694:19): [True: 6.60k, False: 147k]
  ------------------
  695|       |                     // Next line U+0085
  696|  6.60k|                     dst += code_point_to_utf8(0x0085, dst);
  697|  6.60k|                     break;
  698|   126k|                  }
  699|    300|                  case '_': {
  ------------------
  |  Branch (699:19): [True: 300, False: 153k]
  ------------------
  700|       |                     // Non-breaking space U+00A0
  701|    300|                     dst += code_point_to_utf8(0x00A0, dst);
  702|    300|                     break;
  703|   126k|                  }
  704|     78|                  case 'L': {
  ------------------
  |  Branch (704:19): [True: 78, False: 154k]
  ------------------
  705|       |                     // Line separator U+2028
  706|     78|                     dst += code_point_to_utf8(0x2028, dst);
  707|     78|                     break;
  708|   126k|                  }
  709|    198|                  case 'P': {
  ------------------
  |  Branch (709:19): [True: 198, False: 153k]
  ------------------
  710|       |                     // Paragraph separator U+2029
  711|    198|                     dst += code_point_to_utf8(0x2029, dst);
  712|    198|                     break;
  713|   126k|                  }
  714|      0|                  default:
  ------------------
  |  Branch (714:19): [True: 0, False: 154k]
  ------------------
  715|      0|                     break;
  716|   154k|                  }
  717|   154k|               }
  718|  21.4k|               else {
  719|       |                  // Preserve unknown escapes for compatibility, but reject a subset that
  720|       |                  // YAML test-suite marks as malformed in double-quoted scalars.
  721|  21.4k|                  if (esc == '.' || esc == '\'') {
  ------------------
  |  Branch (721:23): [True: 16, False: 21.4k]
  |  Branch (721:37): [True: 24, False: 21.4k]
  ------------------
  722|     40|                     ctx.error = error_code::syntax_error;
  723|     40|                     return;
  724|     40|                  }
  725|  21.4k|                  *dst++ = '\\';
  726|  21.4k|                  *dst++ = static_cast<char>(esc);
  727|  21.4k|                  ++src;
  728|  21.4k|               }
  729|       |               // All escape-produced characters are content, not trimmable
  730|   346k|               last_non_trimmable = dst;
  731|   346k|            }
  732|  14.2M|            else {
  733|  14.2M|               const char ch = *src++;
  734|  14.2M|               *dst++ = ch;
  735|       |               // Only update non-trimmable for non-whitespace literal characters
  736|  14.2M|               if (ch != ' ' && ch != '\t') {
  ------------------
  |  Branch (736:20): [True: 13.3M, False: 903k]
  |  Branch (736:33): [True: 12.2M, False: 1.05M]
  ------------------
  737|  12.2M|                  last_non_trimmable = dst;
  738|  12.2M|               }
  739|  14.2M|            }
  740|  14.5M|         }
  741|       |
  742|       |         // Resize to actual length
  743|  52.9k|         value.resize(static_cast<size_t>(dst - dst_start));
  744|  52.9k|         ++it; // skip closing quote
  745|  52.9k|      }
_ZN3glz4yaml26parse_single_quoted_stringINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_:
  752|   175k|      {
  753|   175k|         static constexpr size_t string_padding_bytes = 8;
  754|       |
  755|   175k|         if (it == end || *it != '\'') [[unlikely]] {
  ------------------
  |  Branch (755:14): [True: 0, False: 175k]
  |  Branch (755:27): [True: 0, False: 175k]
  ------------------
  756|      0|            ctx.error = error_code::expected_quote;
  757|      0|            return;
  758|      0|         }
  759|       |
  760|   175k|         ++it; // skip opening quote
  761|   175k|         auto start = it;
  762|       |
  763|       |         // Pass 1: Find closing quote (handling '' escapes)
  764|  9.93M|         while (it != end) {
  ------------------
  |  Branch (764:17): [True: 9.93M, False: 782]
  ------------------
  765|  9.93M|            if (*it == '\'') {
  ------------------
  |  Branch (765:17): [True: 181k, False: 9.75M]
  ------------------
  766|   181k|               if ((it + 1) != end && *(it + 1) == '\'') {
  ------------------
  |  Branch (766:20): [True: 178k, False: 2.28k]
  |  Branch (766:39): [True: 6.81k, False: 172k]
  ------------------
  767|  6.81k|                  it += 2; // Skip escaped quote
  768|  6.81k|               }
  769|   174k|               else {
  770|   174k|                  break; // Found closing quote
  771|   174k|               }
  772|   181k|            }
  773|  9.75M|            else {
  774|  9.75M|               ++it;
  775|  9.75M|            }
  776|  9.93M|         }
  777|       |
  778|   175k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (778:14): [True: 782, False: 174k]
  ------------------
  779|    782|            ctx.error = error_code::unexpected_end;
  780|    782|            return;
  781|    782|         }
  782|       |
  783|   174k|         const auto input_len = static_cast<size_t>(it - start);
  784|   174k|         value.resize(input_len + string_padding_bytes);
  785|   174k|         auto* dst = value.data();
  786|   174k|         auto* const dst_start = dst;
  787|   174k|         auto src = start;
  788|   174k|         const auto* const src_end = &*it;
  789|       |
  790|       |         // Pass 2: Process content with line folding and '' escapes
  791|  9.61M|         while (src < src_end) {
  ------------------
  |  Branch (791:17): [True: 9.44M, False: 174k]
  ------------------
  792|       |            // Check for newline - needs line folding
  793|  9.44M|            if (*src == '\n' || *src == '\r') {
  ------------------
  |  Branch (793:17): [True: 210k, False: 9.23M]
  |  Branch (793:33): [True: 69.6k, False: 9.16M]
  ------------------
  794|       |               // Trim trailing whitespace from output before processing newline
  795|   307k|               while (dst > dst_start && (*(dst - 1) == ' ' || *(dst - 1) == '\t')) {
  ------------------
  |  Branch (795:23): [True: 305k, False: 1.85k]
  |  Branch (795:43): [True: 24.3k, False: 281k]
  |  Branch (795:64): [True: 3.16k, False: 278k]
  ------------------
  796|  27.5k|                  --dst;
  797|  27.5k|               }
  798|       |
  799|       |               // Skip the newline
  800|   279k|               if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (800:20): [True: 69.6k, False: 210k]
  |  Branch (800:36): [True: 69.0k, False: 586]
  |  Branch (800:59): [True: 3.67k, False: 65.3k]
  ------------------
  801|  3.67k|                  src += 2; // CRLF
  802|  3.67k|               }
  803|   276k|               else {
  804|   276k|                  ++src;
  805|   276k|               }
  806|       |
  807|       |               // Skip leading indentation on the next line.
  808|   279k|               int indent_count = 0;
  809|   279k|               if (!yaml::skip_folded_line_indent(src, src_end, ctx, &indent_count)) return;
  ------------------
  |  Branch (809:20): [True: 34, False: 279k]
  ------------------
  810|   279k|               if (indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (810:20): [True: 232k, False: 47.7k]
  |  Branch (810:41): [True: 82, False: 232k]
  ------------------
  811|     82|                  ctx.error = error_code::syntax_error;
  812|     82|                  return;
  813|     82|               }
  814|       |
  815|       |               // Check if this is a blank line (another newline follows)
  816|   279k|               if (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (816:20): [True: 215k, False: 64.1k]
  |  Branch (816:38): [True: 8.60k, False: 207k]
  |  Branch (816:54): [True: 24.4k, False: 182k]
  ------------------
  817|       |                  // Blank line(s) - output newlines for each blank line
  818|   126k|                  while (src < src_end && (*src == '\n' || *src == '\r')) {
  ------------------
  |  Branch (818:26): [True: 124k, False: 2.13k]
  |  Branch (818:44): [True: 22.6k, False: 101k]
  |  Branch (818:60): [True: 70.8k, False: 30.7k]
  ------------------
  819|  93.5k|                     *dst++ = '\n';
  820|       |                     // Skip the newline
  821|  93.5k|                     if (*src == '\r' && (src + 1) < src_end && *(src + 1) == '\n') {
  ------------------
  |  Branch (821:26): [True: 70.8k, False: 22.6k]
  |  Branch (821:42): [True: 70.0k, False: 844]
  |  Branch (821:65): [True: 1.33k, False: 68.7k]
  ------------------
  822|  1.33k|                        src += 2; // CRLF
  823|  1.33k|                     }
  824|  92.1k|                     else {
  825|  92.1k|                        ++src;
  826|  92.1k|                     }
  827|  93.5k|                     int blank_indent_count = 0;
  828|  93.5k|                     if (!yaml::skip_folded_line_indent(src, src_end, ctx, &blank_indent_count)) return;
  ------------------
  |  Branch (828:26): [True: 70, False: 93.4k]
  ------------------
  829|  93.4k|                     if (blank_indent_count == 0 && yaml::starts_with_document_marker(src, src_end)) {
  ------------------
  |  Branch (829:26): [True: 81.3k, False: 12.1k]
  |  Branch (829:53): [True: 78, False: 81.2k]
  ------------------
  830|     78|                        ctx.error = error_code::syntax_error;
  831|     78|                        return;
  832|     78|                     }
  833|  93.4k|                  }
  834|       |                  // Don't add space - we're now at content after blank line(s)
  835|  33.0k|               }
  836|   246k|               else {
  837|       |                  // Single newline - fold to space
  838|   246k|                  *dst++ = ' ';
  839|   246k|               }
  840|   279k|               continue;
  841|   279k|            }
  842|       |
  843|  9.16M|            if (*src == '\'') {
  ------------------
  |  Branch (843:17): [True: 5.97k, False: 9.15M]
  ------------------
  844|       |               // Must be '' (escaped quote) - we validated this in pass 1
  845|  5.97k|               *dst++ = '\'';
  846|  5.97k|               src += 2;
  847|  5.97k|            }
  848|  9.15M|            else {
  849|  9.15M|               *dst++ = *src++;
  850|  9.15M|            }
  851|  9.16M|         }
  852|       |
  853|   174k|         value.resize(static_cast<size_t>(dst - dst_start));
  854|   174k|         ++it; // skip closing quote
  855|   174k|      }
_ZN3glz4yaml18parse_block_scalarINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_i:
 1315|  30.6k|      {
 1316|  30.6k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (1316:14): [True: 0, False: 30.6k]
  ------------------
 1317|      0|            ctx.error = error_code::unexpected_end;
 1318|      0|            return;
 1319|      0|         }
 1320|       |
 1321|  30.6k|         const char indicator = *it;
 1322|  30.6k|         ++it;
 1323|  30.6k|         const auto header_start = it;
 1324|       |
 1325|       |         // Chomping indicator: - (strip), + (keep), or none (clip)
 1326|  30.6k|         char chomping = ' '; // default: clip
 1327|  30.6k|         int explicit_indent = 0;
 1328|  30.6k|         bool seen_chomping = false;
 1329|  30.6k|         bool seen_indent = false;
 1330|       |
 1331|  48.0k|         while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1331:17): [True: 43.7k, False: 4.27k]
  |  Branch (1331:30): [True: 27.5k, False: 16.2k]
  |  Branch (1331:45): [True: 18.7k, False: 8.80k]
  ------------------
 1332|  18.7k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (1332:17): [True: 834, False: 17.8k]
  |  Branch (1332:31): [True: 8.33k, False: 9.54k]
  ------------------
 1333|  9.16k|               if (seen_chomping) {
  ------------------
  |  Branch (1333:20): [True: 10, False: 9.15k]
  ------------------
 1334|     10|                  ctx.error = error_code::syntax_error;
 1335|     10|                  return;
 1336|     10|               }
 1337|  9.15k|               seen_chomping = true;
 1338|  9.15k|               chomping = *it;
 1339|  9.15k|            }
 1340|  9.54k|            else if (*it >= '1' && *it <= '9') {
  ------------------
  |  Branch (1340:22): [True: 542, False: 9.00k]
  |  Branch (1340:36): [True: 452, False: 90]
  ------------------
 1341|    452|               if (seen_indent) {
  ------------------
  |  Branch (1341:20): [True: 6, False: 446]
  ------------------
 1342|       |                  // YAML indentation indicator is a single digit [1-9].
 1343|      6|                  ctx.error = error_code::syntax_error;
 1344|      6|                  return;
 1345|      6|               }
 1346|    446|               seen_indent = true;
 1347|    446|               explicit_indent = *it - '0';
 1348|    446|            }
 1349|  9.09k|            else if (*it == '0') {
  ------------------
  |  Branch (1349:22): [True: 10, False: 9.08k]
  ------------------
 1350|       |               // Indentation indicator 0 is invalid by spec.
 1351|     10|               ctx.error = error_code::syntax_error;
 1352|     10|               return;
 1353|     10|            }
 1354|  9.08k|            else if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (1354:22): [True: 7.07k, False: 2.00k]
  |  Branch (1354:36): [True: 716, False: 1.28k]
  ------------------
 1355|       |               // Skip whitespace
 1356|  7.79k|            }
 1357|  1.28k|            else if (*it == '#') {
  ------------------
  |  Branch (1357:22): [True: 1.04k, False: 240]
  ------------------
 1358|       |               // Block scalar comments require separation whitespace.
 1359|  1.04k|               if (it == header_start || (*(it - 1) != ' ' && *(it - 1) != '\t')) {
  ------------------
  |  Branch (1359:20): [True: 16, False: 1.03k]
  |  Branch (1359:43): [True: 362, False: 668]
  |  Branch (1359:63): [True: 8, False: 354]
  ------------------
 1360|     24|                  ctx.error = error_code::syntax_error;
 1361|     24|                  return;
 1362|     24|               }
 1363|       |               // Skip comment
 1364|  11.1k|               while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1364:23): [True: 11.0k, False: 106]
  |  Branch (1364:36): [True: 10.7k, False: 334]
  |  Branch (1364:51): [True: 10.1k, False: 582]
  ------------------
 1365|  10.1k|                  ++it;
 1366|  10.1k|               }
 1367|  1.02k|               break;
 1368|  1.04k|            }
 1369|    240|            else {
 1370|    240|               ctx.error = error_code::syntax_error;
 1371|    240|               return;
 1372|    240|            }
 1373|  17.3k|            ++it;
 1374|  17.3k|         }
 1375|       |
 1376|       |         // Skip newline after indicator
 1377|  30.3k|         if (!skip_newline(it, end)) {
  ------------------
  |  Branch (1377:14): [True: 4.37k, False: 25.9k]
  ------------------
 1378|       |            // Empty block scalar
 1379|  4.37k|            value.clear();
 1380|  4.37k|            return;
 1381|  4.37k|         }
 1382|       |
 1383|  25.9k|         value.clear();
 1384|       |
 1385|       |         // Determine content indentation
 1386|  25.9k|         int32_t content_indent = -1;
 1387|  25.9k|         int32_t leading_blank_indent_max = -1;
 1388|  25.9k|         bool first_line = true;
 1389|  25.9k|         bool previous_line_starts_with_tab = false;
 1390|  25.9k|         bool previous_line_more_indented = false;
 1391|  25.9k|         std::string trailing_newlines;
 1392|       |
 1393|   426k|         while (it != end) {
  ------------------
  |  Branch (1393:17): [True: 416k, False: 9.31k]
  ------------------
 1394|   416k|            auto line_start = it;
 1395|   416k|            int32_t line_indent = measure_indent<false>(it, end, ctx);
 1396|   416k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1396:17): [True: 40, False: 416k]
  ------------------
 1397|     40|               return;
 1398|       |
 1399|       |            // Check for blank line
 1400|   416k|            if (it == end || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (1400:17): [True: 598, False: 416k]
  |  Branch (1400:30): [True: 279k, False: 137k]
  |  Branch (1400:45): [True: 43.1k, False: 94.1k]
  ------------------
 1401|       |               // In literal mode, a line with more spaces than content_indent
 1402|       |               // has whitespace content that must be preserved.
 1403|   322k|               if (content_indent >= 0 && line_indent > content_indent && indicator == '|') {
  ------------------
  |  Branch (1403:20): [True: 269k, False: 52.9k]
  |  Branch (1403:43): [True: 2.29k, False: 267k]
  |  Branch (1403:75): [True: 916, False: 1.37k]
  ------------------
 1404|    916|                  it = line_start;
 1405|  1.85k|                  for (int32_t i = 0; i < content_indent && it != end && *it == ' '; ++i) {
  ------------------
  |  Branch (1405:39): [True: 938, False: 916]
  |  Branch (1405:61): [True: 938, False: 0]
  |  Branch (1405:74): [True: 938, False: 0]
  ------------------
 1406|    938|                     ++it;
 1407|    938|                  }
 1408|       |                  // Fall through to content processing below
 1409|    916|               }
 1410|   321k|               else {
 1411|   321k|                  if (content_indent < 0) {
  ------------------
  |  Branch (1411:23): [True: 52.9k, False: 268k]
  ------------------
 1412|  52.9k|                     leading_blank_indent_max = (std::max)(leading_blank_indent_max, line_indent);
 1413|  52.9k|                  }
 1414|   321k|                  trailing_newlines.push_back('\n');
 1415|   321k|                  skip_newline(it, end);
 1416|   321k|                  continue;
 1417|   321k|               }
 1418|   322k|            }
 1419|       |
 1420|       |            // Top-level zero-indented block scalars must stop at document boundary markers.
 1421|  95.0k|            if (base_indent < 0 && line_indent == 0 && (at_document_start(it, end) || at_document_end(it, end))) {
  ------------------
  |  Branch (1421:17): [True: 87.7k, False: 7.36k]
  |  Branch (1421:36): [True: 77.0k, False: 10.6k]
  |  Branch (1421:57): [True: 4.31k, False: 72.7k]
  |  Branch (1421:87): [True: 5.49k, False: 67.2k]
  ------------------
 1422|  9.80k|               it = line_start;
 1423|  9.80k|               break;
 1424|  9.80k|            }
 1425|       |
 1426|       |            // First content line determines indentation
 1427|  85.2k|            if (content_indent < 0) {
  ------------------
  |  Branch (1427:17): [True: 24.0k, False: 61.2k]
  ------------------
 1428|  24.0k|               if (explicit_indent > 0) {
  ------------------
  |  Branch (1428:20): [True: 334, False: 23.7k]
  ------------------
 1429|    334|                  content_indent = base_indent + explicit_indent;
 1430|    334|               }
 1431|  23.7k|               else {
 1432|  23.7k|                  content_indent = line_indent;
 1433|  23.7k|               }
 1434|       |
 1435|  24.0k|               if (content_indent <= base_indent) {
  ------------------
  |  Branch (1435:20): [True: 5.36k, False: 18.6k]
  ------------------
 1436|  5.36k|                  it = line_start;
 1437|  5.36k|                  break;
 1438|  5.36k|               }
 1439|  18.6k|               if (leading_blank_indent_max > content_indent) {
  ------------------
  |  Branch (1439:20): [True: 16, False: 18.6k]
  ------------------
 1440|     16|                  ctx.error = error_code::syntax_error;
 1441|     16|                  return;
 1442|     16|               }
 1443|  18.6k|            }
 1444|       |
 1445|       |            // Check if we've dedented
 1446|  79.8k|            if (line_indent < content_indent) {
  ------------------
  |  Branch (1446:17): [True: 1.41k, False: 78.4k]
  ------------------
 1447|  1.41k|               it = line_start;
 1448|  1.41k|               break;
 1449|  1.41k|            }
 1450|       |
 1451|       |            // Skip to content_indent level
 1452|  78.4k|            it = line_start;
 1453|  89.5k|            for (int32_t i = 0; i < content_indent && it != end && *it == ' '; ++i) {
  ------------------
  |  Branch (1453:33): [True: 11.0k, False: 78.4k]
  |  Branch (1453:55): [True: 11.0k, False: 0]
  |  Branch (1453:68): [True: 11.0k, False: 0]
  ------------------
 1454|  11.0k|               ++it;
 1455|  11.0k|            }
 1456|       |
 1457|  78.4k|            const bool current_line_starts_with_tab = (it != end && *it == '\t');
  ------------------
  |  Branch (1457:56): [True: 78.4k, False: 0]
  |  Branch (1457:69): [True: 1.20k, False: 77.2k]
  ------------------
 1458|  78.4k|            const bool current_line_more_indented = (line_indent > content_indent);
 1459|       |
 1460|       |            // Add previous newlines
 1461|  78.4k|            if (first_line) {
  ------------------
  |  Branch (1461:17): [True: 18.5k, False: 59.9k]
  ------------------
 1462|       |               // Leading blank lines are part of block scalar content
 1463|  18.5k|               value += trailing_newlines;
 1464|  18.5k|            }
 1465|  59.9k|            else {
 1466|  59.9k|               if (indicator == '|') {
  ------------------
  |  Branch (1466:20): [True: 25.2k, False: 34.6k]
  ------------------
 1467|       |                  // Literal: preserve newlines
 1468|  25.2k|                  value += trailing_newlines;
 1469|  25.2k|               }
 1470|  34.6k|               else {
 1471|       |                  // Folded: single newline becomes space, paragraph breaks keep one newline.
 1472|       |                  // Folding does not apply adjacent to "more indented" or tab-leading lines.
 1473|  34.6k|                  const size_t break_count = trailing_newlines.size();
 1474|  34.6k|                  const bool adjacent_special = previous_line_starts_with_tab || current_line_starts_with_tab ||
  ------------------
  |  Branch (1474:49): [True: 886, False: 33.8k]
  |  Branch (1474:82): [True: 520, False: 33.2k]
  ------------------
 1475|  33.2k|                                                previous_line_more_indented || current_line_more_indented;
  ------------------
  |  Branch (1475:49): [True: 3.13k, False: 30.1k]
  |  Branch (1475:80): [True: 2.26k, False: 27.8k]
  ------------------
 1476|  34.6k|                  if (break_count == 1) {
  ------------------
  |  Branch (1476:23): [True: 22.9k, False: 11.7k]
  ------------------
 1477|  22.9k|                     if (adjacent_special) {
  ------------------
  |  Branch (1477:26): [True: 5.61k, False: 17.3k]
  ------------------
 1478|  5.61k|                        value.push_back('\n');
 1479|  5.61k|                     }
 1480|  17.3k|                     else {
 1481|  17.3k|                        value.push_back(' ');
 1482|  17.3k|                     }
 1483|  22.9k|                  }
 1484|  11.7k|                  else if (break_count > 1) {
  ------------------
  |  Branch (1484:28): [True: 11.7k, False: 0]
  ------------------
 1485|  11.7k|                     const size_t preserve_count = adjacent_special ? break_count : (break_count - 1);
  ------------------
  |  Branch (1485:52): [True: 1.18k, False: 10.5k]
  ------------------
 1486|  11.7k|                     value.append(preserve_count, '\n');
 1487|  11.7k|                  }
 1488|  34.6k|               }
 1489|  59.9k|            }
 1490|  78.4k|            trailing_newlines.clear();
 1491|  78.4k|            first_line = false;
 1492|  78.4k|            previous_line_starts_with_tab = current_line_starts_with_tab;
 1493|  78.4k|            previous_line_more_indented = current_line_more_indented;
 1494|       |
 1495|       |            // Read line content
 1496|  30.1M|            while (it != end && *it != '\n' && *it != '\r') {
  ------------------
  |  Branch (1496:20): [True: 30.1M, False: 5.52k]
  |  Branch (1496:33): [True: 30.1M, False: 27.5k]
  |  Branch (1496:48): [True: 30.1M, False: 45.3k]
  ------------------
 1497|  30.1M|               value.push_back(*it);
 1498|  30.1M|               ++it;
 1499|  30.1M|            }
 1500|       |
 1501|  78.4k|            trailing_newlines.push_back('\n');
 1502|  78.4k|            skip_newline(it, end);
 1503|  78.4k|         }
 1504|       |
 1505|       |         // Apply chomping
 1506|  25.9k|         if (chomping == '-') {
  ------------------
  |  Branch (1506:14): [True: 790, False: 25.1k]
  ------------------
 1507|       |            // Strip: remove all trailing newlines
 1508|    790|         }
 1509|  25.1k|         else if (chomping == '+') {
  ------------------
  |  Branch (1509:19): [True: 8.30k, False: 16.8k]
  ------------------
 1510|       |            // Keep: preserve all trailing newlines
 1511|  8.30k|            value += trailing_newlines;
 1512|  8.30k|         }
 1513|  16.8k|         else {
 1514|       |            // Clip: single trailing newline
 1515|  16.8k|            if (!value.empty()) {
  ------------------
  |  Branch (1515:17): [True: 11.0k, False: 5.77k]
  ------------------
 1516|  11.0k|               value.push_back('\n');
 1517|  11.0k|            }
 1518|  16.8k|         }
 1519|  25.9k|      }
_ZN3glz4yaml18parse_plain_scalarINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_b:
 1009|  4.99M|      {
 1010|  4.99M|         value.clear();
 1011|       |
 1012|   210M|         while (it != end) {
  ------------------
  |  Branch (1012:17): [True: 208M, False: 1.34M]
  ------------------
 1013|   208M|            const char c = *it;
 1014|       |
 1015|       |            // End conditions
 1016|   208M|            if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1016:17): [True: 3.30M, False: 205M]
  |  Branch (1016:30): [True: 3.74M, False: 201M]
  ------------------
 1017|  7.05M|               if (in_flow) {
  ------------------
  |  Branch (1017:20): [True: 7.03M, False: 24.3k]
  ------------------
 1018|  7.03M|                  auto continuation = it;
 1019|  7.03M|                  skip_newline(continuation, end);
 1020|  7.03M|                  bool continuation_is_comment = false;
 1021|       |
 1022|  7.03M|                  while (continuation != end) {
  ------------------
  |  Branch (1022:26): [True: 6.98M, False: 50.4k]
  ------------------
 1023|  12.0M|                     while (continuation != end && (*continuation == ' ' || *continuation == '\t')) {
  ------------------
  |  Branch (1023:29): [True: 12.0M, False: 6.40k]
  |  Branch (1023:53): [True: 3.82M, False: 8.18M]
  |  Branch (1023:77): [True: 1.21M, False: 6.97M]
  ------------------
 1024|  5.03M|                        ++continuation;
 1025|  5.03M|                     }
 1026|  6.98M|                     if (continuation != end && *continuation == '#') {
  ------------------
  |  Branch (1026:26): [True: 6.97M, False: 6.40k]
  |  Branch (1026:49): [True: 155k, False: 6.81M]
  ------------------
 1027|       |                        // Comment lines terminate plain flow scalars; the caller
 1028|       |                        // will consume comments/separators outside this scalar.
 1029|   155k|                        continuation_is_comment = true;
 1030|   155k|                        break;
 1031|   155k|                     }
 1032|  6.82M|                     break;
 1033|  6.98M|                  }
 1034|       |
 1035|  7.03M|                  if (continuation_is_comment || continuation == end || *continuation == ',' || *continuation == ']' ||
  ------------------
  |  Branch (1035:23): [True: 155k, False: 6.87M]
  |  Branch (1035:50): [True: 56.8k, False: 6.81M]
  |  Branch (1035:73): [True: 325k, False: 6.49M]
  |  Branch (1035:97): [True: 960, False: 6.49M]
  ------------------
 1036|  6.49M|                      *continuation == '}' || *continuation == ':') {
  ------------------
  |  Branch (1036:23): [True: 26.4k, False: 6.46M]
  |  Branch (1036:47): [True: 25.9k, False: 6.43M]
  ------------------
 1037|   591k|                     break;
 1038|   591k|                  }
 1039|       |
 1040|  12.1M|                  while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1040:26): [True: 11.9M, False: 249k]
  |  Branch (1040:45): [True: 5.28M, False: 6.63M]
  |  Branch (1040:68): [True: 445k, False: 6.19M]
  ------------------
 1041|  5.72M|                     value.pop_back();
 1042|  5.72M|                  }
 1043|  6.43M|                  if (!value.empty()) {
  ------------------
  |  Branch (1043:23): [True: 6.19M, False: 249k]
  ------------------
 1044|  6.19M|                     value.push_back(' ');
 1045|  6.19M|                  }
 1046|  6.43M|                  it = continuation;
 1047|  6.43M|                  continue;
 1048|  7.03M|               }
 1049|  24.3k|               break;
 1050|  7.05M|            }
 1051|       |
 1052|       |            // Per YAML spec: # only starts a comment when preceded by whitespace
 1053|       |            // "foo#bar" is a valid plain scalar, but "foo #bar" has a comment
 1054|   201M|            if (c == '#') {
  ------------------
  |  Branch (1054:17): [True: 2.44M, False: 199M]
  ------------------
 1055|       |               // Check if preceded by whitespace (comment indicator)
 1056|  2.44M|               if (value.empty() || value.back() == ' ' || value.back() == '\t') {
  ------------------
  |  Branch (1056:20): [True: 4.00k, False: 2.43M]
  |  Branch (1056:37): [True: 28.6k, False: 2.40M]
  |  Branch (1056:60): [True: 2.95k, False: 2.40M]
  ------------------
 1057|  35.6k|                  break; // This is a comment
 1058|  35.6k|               }
 1059|       |               // Otherwise # is part of the scalar value
 1060|  2.44M|            }
 1061|       |
 1062|       |            // Flow indicators end plain scalars in flow context
 1063|   201M|            if (in_flow && (c == ',' || c == ']' || c == '}')) break;
  ------------------
  |  Branch (1063:17): [True: 190M, False: 11.1M]
  |  Branch (1063:29): [True: 2.23M, False: 188M]
  |  Branch (1063:41): [True: 143k, False: 188M]
  |  Branch (1063:53): [True: 322k, False: 187M]
  ------------------
 1064|       |
 1065|       |            // Colon followed by space/newline ends plain scalar
 1066|   199M|            if (c == ':') {
  ------------------
  |  Branch (1066:17): [True: 1.34M, False: 197M]
  ------------------
 1067|  1.34M|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (1067:20): [True: 21.5k, False: 1.32M]
  |  Branch (1067:39): [True: 82.6k, False: 1.24M]
  |  Branch (1067:59): [True: 10.8k, False: 1.22M]
  |  Branch (1067:80): [True: 35.1k, False: 1.19M]
  |  Branch (1067:101): [True: 105k, False: 1.08M]
  ------------------
 1068|   255k|                  break;
 1069|   255k|               }
 1070|  1.08M|               if (in_flow && (*(it + 1) == ',' || *(it + 1) == ']' || *(it + 1) == '}')) {
  ------------------
  |  Branch (1070:20): [True: 1.08M, False: 3.71k]
  |  Branch (1070:32): [True: 30.5k, False: 1.05M]
  |  Branch (1070:52): [True: 15.0k, False: 1.03M]
  |  Branch (1070:72): [True: 512, False: 1.03M]
  ------------------
 1071|  46.1k|                  break;
 1072|  46.1k|               }
 1073|  1.08M|            }
 1074|       |
 1075|   198M|            value.push_back(c);
 1076|   198M|            ++it;
 1077|   198M|         }
 1078|       |
 1079|       |         // Trim trailing whitespace
 1080|  7.63M|         while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1080:17): [True: 7.25M, False: 379k]
  |  Branch (1080:36): [True: 1.45M, False: 5.79M]
  |  Branch (1080:59): [True: 1.18M, False: 4.61M]
  ------------------
 1081|  2.64M|            value.pop_back();
 1082|  2.64M|         }
 1083|       |
 1084|  4.99M|         if (in_flow && (value == "---" || value == "..." || value == "-")) {
  ------------------
  |  Branch (1084:14): [True: 4.90M, False: 84.3k]
  |  Branch (1084:26): [True: 10, False: 4.90M]
  |  Branch (1084:44): [True: 8, False: 4.90M]
  |  Branch (1084:62): [True: 40, False: 4.90M]
  ------------------
 1085|     58|            ctx.error = error_code::syntax_error;
 1086|     58|         }
 1087|  4.99M|      }
_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_:
 5205|   190k|      {
 5206|   190k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   190k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   190k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   190k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   190k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 190k, False: 0]
  ------------------
 5216|   190k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   190k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2047|   192k|      {
 2048|   192k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 192k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|   192k|         yaml::node_preamble_state preamble{};
 2052|   192k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 3.16k, False: 189k]
  ------------------
 2053|   192k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   192k|                   return yaml::tag_valid_for_float(tag);
 2055|   192k|                }
 2056|   192k|                else {
 2057|   192k|                   return yaml::tag_valid_for_int(tag);
 2058|   192k|                }
 2059|   192k|             }))
 2060|  3.16k|            return;
 2061|       |
 2062|   189k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|   189k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|   189k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|   189k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 16.6k, False: 172k]
  ------------------
 2070|  16.6k|               ++it;
 2071|  16.6k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 15.6k, False: 952]
  |  Branch (2071:38): [True: 1.15k, False: 14.5k]
  |  Branch (2071:74): [True: 418, False: 14.1k]
  ------------------
 2072|  14.1k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 213, False: 13.8k]
  ------------------
 2073|  1.78k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  1.78k|                  it += 3;
 2075|  1.78k|                  finalize();
 2076|  1.78k|                  return;
 2077|  1.78k|               }
 2078|  14.8k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 13.8k, False: 952]
  |  Branch (2078:38): [True: 337, False: 13.5k]
  |  Branch (2078:74): [True: 630, False: 12.9k]
  ------------------
 2079|  12.9k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 586, False: 12.3k]
  ------------------
 2080|  1.55k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  1.55k|                  it += 3;
 2082|  1.55k|                  finalize();
 2083|  1.55k|                  return;
 2084|  1.55k|               }
 2085|  13.2k|               it = start;
 2086|  13.2k|            }
 2087|       |
 2088|   185k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 32.0k, False: 153k]
  |  Branch (2088:31): [True: 31.6k, False: 122k]
  ------------------
 2089|  63.6k|               const char sign = *it;
 2090|  63.6k|               ++it;
 2091|  63.6k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 63.2k, False: 413]
  |  Branch (2091:33): [True: 33.5k, False: 29.7k]
  ------------------
 2092|  33.5k|                  ++it;
 2093|  33.5k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 32.4k, False: 1.03k]
  |  Branch (2093:41): [True: 26.7k, False: 5.73k]
  |  Branch (2093:77): [True: 1.42k, False: 4.30k]
  ------------------
 2094|  28.5k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 345, False: 3.96k]
  ------------------
 2095|  28.5k|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 28.0k, False: 516]
  ------------------
 2096|  28.0k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|  28.0k|                     }
 2098|    516|                     else {
 2099|    516|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|    516|                     }
 2101|  28.5k|                     it += 3;
 2102|  28.5k|                     finalize();
 2103|  28.5k|                     return;
 2104|  28.5k|                  }
 2105|  33.5k|               }
 2106|  35.1k|               it = start;
 2107|  35.1k|            }
 2108|   185k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|   157k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  15.5M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 15.5M, False: 39.2k]
  ------------------
 2115|  15.5M|            const char c = *it;
 2116|  15.5M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 45.2k, False: 15.4M]
  |  Branch (2116:29): [True: 35.4k, False: 15.4M]
  |  Branch (2116:42): [True: 4.92k, False: 15.4M]
  |  Branch (2116:55): [True: 28.7k, False: 15.4M]
  |  Branch (2116:68): [True: 12.7k, False: 15.3M]
  |  Branch (2116:80): [True: 1.78k, False: 15.3M]
  |  Branch (2116:92): [True: 4.01k, False: 15.3M]
  |  Branch (2116:104): [True: 12.6k, False: 15.3M]
  ------------------
 2117|   145k|               break;
 2118|   145k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  15.3M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 25.1k, False: 15.3M]
  ------------------
 2121|  25.1k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 345, False: 24.8k]
  |  Branch (2121:39): [True: 1.07k, False: 23.7k]
  |  Branch (2121:59): [True: 400, False: 23.3k]
  |  Branch (2121:80): [True: 1.63k, False: 21.7k]
  |  Branch (2121:101): [True: 871, False: 20.8k]
  ------------------
 2122|  4.32k|                  break;
 2123|  4.32k|               }
 2124|  25.1k|            }
 2125|  15.3M|            ++it;
 2126|  15.3M|         }
 2127|       |
 2128|   189k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|   189k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 574, False: 188k]
  ------------------
 2131|    574|            ctx.error = error_code::parse_number_failure;
 2132|    574|            return;
 2133|    574|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|   188k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|   188k|            bool negative = false;
 2186|   188k|            std::string_view digits = num_str;
 2187|       |
 2188|   188k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 156k, False: 31.8k]
  |  Branch (2188:37): [True: 31.1k, False: 125k]
  |  Branch (2188:62): [True: 4.00k, False: 121k]
  ------------------
 2189|  35.1k|               negative = (digits.front() == '-');
 2190|  35.1k|               digits.remove_prefix(1);
 2191|  35.1k|            }
 2192|       |
 2193|   188k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 108k, False: 80.3k]
  |  Branch (2193:38): [True: 40.7k, False: 67.4k]
  ------------------
 2194|  40.7k|               int base = 10;
 2195|  40.7k|               size_t offset = 0;
 2196|       |
 2197|  40.7k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 2.54k, False: 38.2k]
  |  Branch (2197:40): [True: 179, False: 38.0k]
  ------------------
 2198|  2.72k|                  base = 16;
 2199|  2.72k|                  offset = 2;
 2200|  2.72k|               }
 2201|  38.0k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 878, False: 37.1k]
  |  Branch (2201:45): [True: 894, False: 36.2k]
  ------------------
 2202|  1.77k|                  base = 8;
 2203|  1.77k|                  offset = 2;
 2204|  1.77k|               }
 2205|  36.2k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 1.65k, False: 34.6k]
  |  Branch (2205:45): [True: 429, False: 34.2k]
  ------------------
 2206|  2.08k|                  base = 2;
 2207|  2.08k|                  offset = 2;
 2208|  2.08k|               }
 2209|       |
 2210|  40.7k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 6.58k, False: 34.2k]
  ------------------
 2211|  6.58k|                  auto raw_digits = digits.substr(offset);
 2212|  6.58k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  6.58k|                  std::string clean_storage;
 2215|  6.58k|                  std::string_view clean_view;
 2216|  6.58k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 1.60k, False: 4.97k]
  ------------------
 2217|  1.60k|                     clean_storage.reserve(raw_digits.size());
 2218|  1.86M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 1.86M, False: 1.60k]
  ------------------
 2219|  1.86M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 1.86M, False: 3.14k]
  ------------------
 2220|  1.86M|                           clean_storage.push_back(c);
 2221|  1.86M|                        }
 2222|  1.86M|                     }
 2223|  1.60k|                     clean_view = clean_storage;
 2224|  1.60k|                  }
 2225|  4.97k|                  else {
 2226|  4.97k|                     clean_view = raw_digits;
 2227|  4.97k|                  }
 2228|       |
 2229|  6.58k|                  uint64_t parsed_int{};
 2230|  6.58k|                  auto [ptr, ec] =
 2231|  6.58k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  6.58k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 2.46k, False: 4.11k]
  |  Branch (2232:44): [True: 1.76k, False: 2.34k]
  ------------------
 2233|  4.23k|                     ctx.error = error_code::parse_number_failure;
 2234|  4.23k|                     finalize();
 2235|  4.23k|                     return;
 2236|  4.23k|                  }
 2237|       |
 2238|  2.34k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  2.34k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 1.65k, False: 688]
  ------------------
 2240|  2.34k|                  finalize();
 2241|  2.34k|                  return;
 2242|  6.58k|               }
 2243|  40.7k|            }
 2244|   188k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|   181k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|   188k|         std::string clean_storage;
 2250|   188k|         std::string_view clean_view;
 2251|       |
 2252|   188k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 2.03k, False: 186k]
  ------------------
 2253|  2.03k|            clean_storage.reserve(num_str.size());
 2254|  9.49M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 9.49M, False: 2.03k]
  ------------------
 2255|  9.49M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 9.48M, False: 10.3k]
  ------------------
 2256|  9.48M|                  clean_storage.push_back(c);
 2257|  9.48M|               }
 2258|  9.49M|            }
 2259|  2.03k|            clean_view = clean_storage;
 2260|  2.03k|         }
 2261|   186k|         else {
 2262|   186k|            clean_view = num_str;
 2263|   186k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|   188k|         auto parse_view = clean_view;
 2268|   188k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 150k, False: 38.5k]
  |  Branch (2268:37): [True: 31.1k, False: 118k]
  ------------------
 2269|  31.1k|            parse_view.remove_prefix(1);
 2270|  31.1k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 8.48k, False: 22.6k]
  ------------------
 2271|  8.48k|               ctx.error = error_code::parse_number_failure;
 2272|  8.48k|               return;
 2273|  8.48k|            }
 2274|  31.1k|         }
 2275|       |
 2276|   180k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|   180k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|   180k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 71.9k, False: 108k]
  |  Branch (2279:45): [True: 50.7k, False: 57.3k]
  ------------------
 2280|  84.3k|               ctx.error = error_code::parse_number_failure;
 2281|  84.3k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|   180k|         finalize();
 2292|   180k|      }
_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|   192k|      {
  466|   192k|         skip_inline_ws(it, end);
  467|       |
  468|   192k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 219, False: 192k]
  ------------------
  469|    219|            if constexpr (!AllowEmptyInput) {
  470|    219|               ctx.error = error_code::unexpected_end;
  471|    219|            }
  472|    219|            return true;
  473|    219|         }
  474|       |
  475|   192k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   192k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 106, False: 191k]
  ------------------
  477|    106|            ctx.error = error_code::syntax_error;
  478|    106|            return true;
  479|    106|         }
  480|   191k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 94, False: 191k]
  ------------------
  481|     94|            ctx.error = error_code::syntax_error;
  482|     94|            return true;
  483|     94|         }
  484|       |
  485|   191k|         skip_inline_ws(it, end);
  486|       |
  487|   191k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 89, False: 191k]
  ------------------
  488|     89|            if constexpr (!AllowEmptyInput) {
  489|     89|               ctx.error = error_code::unexpected_end;
  490|     89|            }
  491|     89|            return true;
  492|     89|         }
  493|       |
  494|   191k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 2.65k, False: 189k]
  ------------------
  495|  2.65k|            return true;
  496|  2.65k|         }
  497|       |
  498|   189k|         return false;
  499|   191k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2052|   191k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|   191k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   191k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|   191k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   191k|      {
  409|   191k|         state.has_anchor = false;
  410|   191k|         state.anchor_name.clear();
  411|   191k|         state.anchor_start = nullptr;
  412|   191k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   191k|         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|   191k|            else {
  421|   191k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 2.45k, False: 189k]
  ------------------
  422|   191k|            }
  423|   191k|         }
  424|       |
  425|   191k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 189k, False: 2.45k]
  |  Branch (425:27): [True: 3.66k, False: 185k]
  ------------------
  426|  3.66k|            ++it;
  427|  3.66k|            auto name = parse_anchor_name(it, end);
  428|  3.66k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 105, False: 3.56k]
  ------------------
  429|    105|               ctx.error = error_code::syntax_error;
  430|    105|               return true;
  431|    105|            }
  432|  3.56k|            skip_inline_ws(it, end);
  433|  3.56k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 97, False: 3.46k]
  ------------------
  434|     97|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     97|                  ctx.error = error_code::unexpected_end;
  436|     97|               }
  437|     97|               return true;
  438|     97|            }
  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.46k|            state.has_anchor = true;
  446|  3.46k|            state.anchor_name = std::string(name);
  447|  3.46k|            state.anchor_start = &*it;
  448|  3.46k|         }
  449|       |
  450|   191k|         return false;
  451|   191k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   191k|      {
  301|   191k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 191k]
  |  Branch (301:27): [True: 189k, False: 2.45k]
  ------------------
  302|       |
  303|  2.45k|         ++it; // skip '*'
  304|  2.45k|         auto name = parse_anchor_name(it, end);
  305|  2.45k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 82, False: 2.37k]
  ------------------
  306|     82|            ctx.error = error_code::syntax_error;
  307|     82|            return true;
  308|     82|         }
  309|       |
  310|  2.37k|         auto anchor_it = ctx.anchors.find(name);
  311|  2.37k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 357, False: 2.01k]
  ------------------
  312|    357|            ctx.error = error_code::syntax_error; // undefined alias
  313|    357|            return true;
  314|    357|         }
  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.01k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.01k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 358, False: 1.65k]
  ------------------
  322|    358|            return true;
  323|    358|         }
  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.65k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 2, False: 1.65k]
  ------------------
  329|      2|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      2|            return true;
  331|      2|         }
  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.65k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.65k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 1.65k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  1.65k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.65k]
  ------------------
  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.65k|         auto replay_it = span.begin;
  348|  1.65k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.65k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.65k|         ctx.indent_stack.clear();
  353|  1.65k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 205, False: 1.45k]
  ------------------
  354|    205|            ctx.push_indent(span.base_indent - 1);
  355|    205|         }
  356|       |
  357|  1.65k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.65k|         using V = std::remove_cvref_t<T>;
  360|  1.65k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.65k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.65k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.65k|         return true;
  367|  1.65k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|   180k|         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_:
 5205|  23.6k|      {
 5206|  23.6k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  23.6k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  23.6k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  23.6k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  23.6k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 23.6k, False: 0]
  ------------------
 5216|  23.6k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  23.6k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2012|  30.4k|      {
 2013|  30.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 30.4k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  30.4k|         yaml::node_preamble_state preamble{};
 2017|  30.4k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 7.80k, False: 22.6k]
  ------------------
 2018|  30.4k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|  7.80k|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  22.6k|         std::string str;
 2023|  22.6k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  22.6k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 1.55k, False: 21.0k]
  |  Branch (2025:31): [True: 764, False: 20.3k]
  |  Branch (2025:48): [True: 142, False: 20.1k]
  |  Branch (2025:65): [True: 268, False: 19.8k]
  |  Branch (2025:81): [True: 912, False: 18.9k]
  |  Branch (2025:97): [True: 348, False: 18.6k]
  ------------------
 2026|  18.6k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 609, False: 18.0k]
  |  Branch (2026:29): [True: 81, False: 17.9k]
  |  Branch (2026:44): [True: 439, False: 17.5k]
  ------------------
 2027|  5.11k|            value = true;
 2028|  5.11k|         }
 2029|  17.5k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 10.0k, False: 7.41k]
  |  Branch (2029:37): [True: 311, False: 7.10k]
  |  Branch (2029:55): [True: 3.20k, False: 3.90k]
  |  Branch (2029:73): [True: 360, False: 3.54k]
  |  Branch (2029:88): [True: 492, False: 3.05k]
  |  Branch (2029:103): [True: 2.08k, False: 967]
  ------------------
 2030|  17.3k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 350, False: 617]
  |  Branch (2030:35): [True: 258, False: 359]
  |  Branch (2030:51): [True: 228, False: 131]
  ------------------
 2031|  17.3k|            value = false;
 2032|  17.3k|         }
 2033|    131|         else {
 2034|    131|            ctx.error = error_code::expected_true_or_false;
 2035|    131|         }
 2036|       |
 2037|  22.6k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  22.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|  30.4k|      {
  466|  30.4k|         skip_inline_ws(it, end);
  467|       |
  468|  30.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 4, False: 30.4k]
  ------------------
  469|      4|            if constexpr (!AllowEmptyInput) {
  470|      4|               ctx.error = error_code::unexpected_end;
  471|      4|            }
  472|      4|            return true;
  473|      4|         }
  474|       |
  475|  30.4k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  30.4k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 4, False: 30.4k]
  ------------------
  477|      4|            ctx.error = error_code::syntax_error;
  478|      4|            return true;
  479|      4|         }
  480|  30.4k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 30.4k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  30.4k|         skip_inline_ws(it, end);
  486|       |
  487|  30.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 1, False: 30.4k]
  ------------------
  488|      1|            if constexpr (!AllowEmptyInput) {
  489|      1|               ctx.error = error_code::unexpected_end;
  490|      1|            }
  491|      1|            return true;
  492|      1|         }
  493|       |
  494|  30.4k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 7.79k, False: 22.6k]
  ------------------
  495|  7.79k|            return true;
  496|  7.79k|         }
  497|       |
  498|  22.6k|         return false;
  499|  30.4k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2018|  30.4k|                                             [](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|  30.4k|      {
  409|  30.4k|         state.has_anchor = false;
  410|  30.4k|         state.anchor_name.clear();
  411|  30.4k|         state.anchor_start = nullptr;
  412|  30.4k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  30.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|  30.4k|            else {
  421|  30.4k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 7.78k, False: 22.6k]
  ------------------
  422|  30.4k|            }
  423|  30.4k|         }
  424|       |
  425|  30.4k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 22.6k, False: 7.78k]
  |  Branch (425:27): [True: 6.34k, False: 16.2k]
  ------------------
  426|  6.34k|            ++it;
  427|  6.34k|            auto name = parse_anchor_name(it, end);
  428|  6.34k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 3, False: 6.33k]
  ------------------
  429|      3|               ctx.error = error_code::syntax_error;
  430|      3|               return true;
  431|      3|            }
  432|  6.33k|            skip_inline_ws(it, end);
  433|  6.33k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 10, False: 6.32k]
  ------------------
  434|     10|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     10|                  ctx.error = error_code::unexpected_end;
  436|     10|               }
  437|     10|               return true;
  438|     10|            }
  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.32k|            state.has_anchor = true;
  446|  6.32k|            state.anchor_name = std::string(name);
  447|  6.32k|            state.anchor_start = &*it;
  448|  6.32k|         }
  449|       |
  450|  30.4k|         return false;
  451|  30.4k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  30.4k|      {
  301|  30.4k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 30.4k]
  |  Branch (301:27): [True: 22.6k, False: 7.78k]
  ------------------
  302|       |
  303|  7.78k|         ++it; // skip '*'
  304|  7.78k|         auto name = parse_anchor_name(it, end);
  305|  7.78k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 9, False: 7.77k]
  ------------------
  306|      9|            ctx.error = error_code::syntax_error;
  307|      9|            return true;
  308|      9|         }
  309|       |
  310|  7.77k|         auto anchor_it = ctx.anchors.find(name);
  311|  7.77k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 19, False: 7.75k]
  ------------------
  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|  7.75k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  7.75k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 944, False: 6.80k]
  ------------------
  322|    944|            return true;
  323|    944|         }
  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.80k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 7, False: 6.80k]
  ------------------
  329|      7|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      7|            return true;
  331|      7|         }
  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.80k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  6.80k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 6.80k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  6.80k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 6.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|  6.80k|         auto replay_it = span.begin;
  348|  6.80k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  6.80k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  6.80k|         ctx.indent_stack.clear();
  353|  6.80k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 500, False: 6.30k]
  ------------------
  354|    500|            ctx.push_indent(span.base_indent - 1);
  355|    500|         }
  356|       |
  357|  6.80k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  6.80k|         using V = std::remove_cvref_t<T>;
  360|  6.80k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  6.80k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  6.80k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  6.80k|         return true;
  367|  6.80k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2398|  5.78k|      {
 2399|  5.78k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 5.78k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  5.78k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  5.78k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 3, False: 5.77k]
  ------------------
 2405|      3|            ctx.error = error_code::unexpected_end;
 2406|      3|            return;
 2407|      3|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  5.77k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 2.24k, False: 3.53k]
  ------------------
 2411|  2.24k|            ++it;
 2412|  2.24k|            return;
 2413|  2.24k|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  3.53k|         auto start = it;
 2417|  54.2k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 54.0k, False: 218]
  |  Branch (2417:30): [True: 50.7k, False: 3.31k]
  ------------------
 2418|  50.7k|            ++it;
 2419|  50.7k|         }
 2420|       |
 2421|  3.53k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  3.53k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 37, False: 3.49k]
  ------------------
 2423|     37|            ctx.error = error_code::syntax_error;
 2424|     37|         }
 2425|  3.53k|      }
_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_:
 5205|  1.01M|      {
 5206|  1.01M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  1.01M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  1.01M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  1.01M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  1.01M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 1.01M, False: 0]
  ------------------
 5216|  1.01M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  1.01M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4515|  1.02M|      {
 4516|  1.02M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 1.02M]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|  1.02M|         yaml::node_preamble_state preamble{};
 4520|  1.02M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 5.83k, False: 1.01M]
  ------------------
 4521|  1.02M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  5.83k|            return;
 4523|       |
 4524|  1.01M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|  1.01M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|  1.01M|         std::remove_cvref_t<T> preexisting_entries;
 4538|  1.01M|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 1.01M]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|  1.01M|         struct merge_restore_guard
 4543|  1.01M|         {
 4544|  1.01M|            std::remove_cvref_t<T>& target;
 4545|  1.01M|            std::remove_cvref_t<T>& saved;
 4546|  1.01M|            ~merge_restore_guard()
 4547|  1.01M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  1.01M|               for (auto& entry : saved) {
 4551|  1.01M|                  target.emplace(entry.first, std::move(entry.second));
 4552|  1.01M|               }
 4553|  1.01M|            }
 4554|  1.01M|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|  1.01M|         const bool treat_as_block_mapping =
 4557|  1.01M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [Folded, False: 1.01M]
  |  Branch (4557:48): [True: 0, False: 0]
  |  Branch (4557:62): [True: 0, False: 0]
  ------------------
 4558|       |
 4559|  1.01M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 683k, False: 331k]
  |  Branch (4559:28): [True: 0, Folded]
  ------------------
 4560|       |            // Flow mapping
 4561|   683k|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|   683k|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|   683k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 682k, False: 1.40k]
  |  Branch (4565:30): [True: 13.2k, False: 669k]
  ------------------
 4566|  13.2k|               ++it;
 4567|  13.2k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  13.2k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 8, False: 13.2k]
  ------------------
 4569|      8|                  return;
 4570|  13.2k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  13.2k|               return;
 4572|  13.2k|            }
 4573|       |
 4574|  3.57M|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 3.57M, False: 2.72k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|  3.57M|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|  3.57M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 3.57M, False: 0]
  |  Branch (4578:33): [True: 29.2k, False: 3.54M]
  ------------------
 4579|  29.2k|                  ++it;
 4580|  29.2k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|  29.2k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 15, False: 29.2k]
  ------------------
 4582|     15|                     return;
 4583|  29.2k|                  break;
 4584|  29.2k|               }
 4585|       |
 4586|  3.54M|               bool explicit_flow_key = false;
 4587|  3.54M|               auto explicit_probe = it;
 4588|  3.54M|               yaml::skip_inline_ws(explicit_probe, end);
 4589|  3.54M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 3.54M, False: 0]
  |  Branch (4589:45): [True: 61.3k, False: 3.48M]
  ------------------
 4590|  61.3k|                  const auto after_q = explicit_probe + 1;
 4591|  61.3k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 6, False: 61.3k]
  |  Branch (4591:41): [True: 27.7k, False: 33.5k]
  ------------------
 4592|  33.5k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 5.37k, False: 28.1k]
  |  Branch (4592:42): [True: 326, False: 27.8k]
  ------------------
 4593|  33.4k|                     explicit_flow_key = true;
 4594|  33.4k|                     it = explicit_probe + 1;
 4595|  33.4k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  33.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 2, False: 33.4k]
  ------------------
 4597|      2|                        return;
 4598|  33.4k|                  }
 4599|  61.3k|               }
 4600|       |               // Parse key
 4601|  3.54M|               key_t key{};
 4602|  3.54M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|  3.54M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 33.4k, False: 3.50M]
  |  Branch (4603:44): [True: 33.4k, False: 13]
  |  Branch (4603:58): [True: 1.40k, False: 32.0k]
  |  Branch (4603:72): [True: 6.65k, False: 25.3k]
  |  Branch (4603:86): [True: 633, False: 24.7k]
  ------------------
 4604|  8.69k|                     key.clear();
 4605|  8.69k|                  }
 4606|  3.53M|                  else {
 4607|  3.53M|                     auto key_probe = it;
 4608|  3.53M|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|  3.53M|                     bool parse_complex_flow_key = false;
 4613|  3.53M|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 3.53M, False: 13]
  ------------------
 4614|  3.53M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 8.51k, False: 3.52M]
  |  Branch (4614:50): [True: 19.3k, False: 3.50M]
  ------------------
 4615|  27.8k|                           parse_complex_flow_key = true;
 4616|  27.8k|                        }
 4617|  3.50M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 665k, False: 2.84M]
  ------------------
 4618|   665k|                           ++key_probe;
 4619|   665k|                           yaml::parse_anchor_name(key_probe, end);
 4620|   665k|                           yaml::skip_inline_ws(key_probe, end);
 4621|   665k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 665k, False: 61]
  |  Branch (4621:53): [True: 4.50k, False: 660k]
  |  Branch (4621:74): [True: 134k, False: 525k]
  ------------------
 4622|   139k|                              parse_complex_flow_key = true;
 4623|   139k|                           }
 4624|   665k|                        }
 4625|  3.53M|                     }
 4626|       |
 4627|  3.53M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 166k, False: 3.36M]
  ------------------
 4628|   166k|                        glz::generic key_node{};
 4629|   166k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|   166k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 8.71k, False: 158k]
  ------------------
 4631|  8.71k|                           return;
 4632|   158k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 30, False: 158k]
  ------------------
 4633|     30|                           return;
 4634|   158k|                     }
 4635|  3.36M|                     else {
 4636|  3.36M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 3.74k, False: 3.36M]
  ------------------
 4637|  3.74k|                           return;
 4638|  3.74k|                        }
 4639|  3.36M|                     }
 4640|  3.53M|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|  3.53M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|  3.54M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 17, False: 3.54M]
  ------------------
 4656|     17|                  return;
 4657|       |
 4658|  3.54M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|  3.54M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|  3.54M|                     val = {};
 4661|  3.54M|                     return true;
 4662|  3.54M|                  }
 4663|  3.54M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  3.54M|                     val = glz::generic{};
 4665|  3.54M|                     return true;
 4666|  3.54M|                  }
 4667|  3.54M|                  else {
 4668|  3.54M|                     static constexpr std::string_view null_value{"null"};
 4669|  3.54M|                     auto null_it = null_value.data();
 4670|  3.54M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|  3.54M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|  3.54M|                     return !bool(ctx.error);
 4673|  3.54M|                  }
 4674|  3.54M|               };
 4675|       |
 4676|  3.54M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 3.52M, False: 14.7k]
  |  Branch (4676:34): [True: 2.04M, False: 1.48M]
  |  Branch (4676:48): [True: 91.4k, False: 1.39M]
  ------------------
 4677|  2.13M|                  val_t val{};
 4678|  2.13M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 2.13M]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|  2.13M|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|  2.13M|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 91.4k, False: 2.04M]
  ------------------
 4684|  91.4k|                     ++it;
 4685|  91.4k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  91.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 91, False: 91.3k]
  ------------------
 4687|     91|                        return;
 4688|  91.3k|                     break;
 4689|  91.4k|                  }
 4690|       |
 4691|  2.04M|                  ++it; // skip comma
 4692|  2.04M|                  yaml::skip_ws_and_newlines(it, end);
 4693|  2.04M|                  continue;
 4694|  2.13M|               }
 4695|       |
 4696|  1.40M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 14.7k, False: 1.39M]
  |  Branch (4696:33): [True: 741, False: 1.38M]
  ------------------
 4697|  2.99k|                  ctx.error = error_code::syntax_error;
 4698|  2.99k|                  return;
 4699|  2.99k|               }
 4700|  1.40M|               ++it;
 4701|       |
 4702|  1.40M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  1.40M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 10, False: 1.40M]
  ------------------
 4704|     10|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  1.40M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 1.38M, False: 12.6k]
  |  Branch (4707:34): [True: 178k, False: 1.21M]
  |  Branch (4707:48): [True: 10.3k, False: 1.20M]
  ------------------
 4708|   189k|                  val_t val{};
 4709|   189k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 189k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|   189k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|   189k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 10.3k, False: 178k]
  ------------------
 4715|  10.3k|                     ++it;
 4716|  10.3k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  10.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 14, False: 10.3k]
  ------------------
 4718|     14|                        return;
 4719|  10.3k|                     break;
 4720|  10.3k|                  }
 4721|       |
 4722|   178k|                  ++it; // skip comma
 4723|   178k|                  yaml::skip_ws_and_newlines(it, end);
 4724|   178k|                  continue;
 4725|   189k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  1.21M|               val_t val{};
 4729|  1.21M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  1.21M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 3.35k, False: 1.20M]
  ------------------
 4731|  3.35k|                  return;
 4732|       |
 4733|  1.20M|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  1.20M|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  1.20M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 1.19M, False: 12.8k]
  |  Branch (4737:33): [True: 495k, False: 701k]
  ------------------
 4738|   495k|                  ++it;
 4739|   495k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|   495k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 133, False: 495k]
  ------------------
 4741|    133|                     return;
 4742|   495k|                  break;
 4743|   495k|               }
 4744|   714k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 701k, False: 12.8k]
  |  Branch (4744:38): [True: 637k, False: 64.1k]
  ------------------
 4745|   637k|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|   637k|                  yaml::skip_ws_and_newlines(it, end);
 4748|   637k|               }
 4749|  77.0k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 64.1k, False: 12.8k]
  |  Branch (4749:39): [True: 26.7k, False: 37.4k]
  |  Branch (4749:54): [True: 37.1k, False: 306]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|  63.8k|                  yaml::skip_ws_and_newlines(it, end);
 4753|  63.8k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 63.8k, False: 37]
  |  Branch (4753:36): [True: 21.4k, False: 42.4k]
  ------------------
 4754|  21.4k|                     ++it;
 4755|  21.4k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|  21.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 17, False: 21.3k]
  ------------------
 4757|     17|                        return;
 4758|  21.3k|                     break;
 4759|  21.4k|                  }
 4760|  42.4k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 42.4k, False: 37]
  |  Branch (4760:36): [True: 42.3k, False: 84]
  ------------------
 4761|  42.3k|                     ++it;
 4762|  42.3k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  42.3k|                     continue;
 4764|  42.3k|                  }
 4765|    121|                  ctx.error = error_code::syntax_error;
 4766|    121|                  return;
 4767|  42.4k|               }
 4768|  13.1k|               else {
 4769|  13.1k|                  ctx.error = error_code::syntax_error;
 4770|  13.1k|                  return;
 4771|  13.1k|               }
 4772|  1.20M|            }
 4773|   670k|         }
 4774|   331k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   331k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   331k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   331k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   331k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   331k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   331k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   331k|                           if (ctx.stream_begin) {
 4788|   331k|                              auto is_line_content_start = [&](auto pos) {
 4789|   331k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   331k|                              };
 4791|       |
 4792|   331k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   331k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   331k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   331k|                                 return line != end && *line == ':';
 4796|   331k|                              };
 4797|       |
 4798|   331k|                              if (!is_line_content_start(it) &&
 4799|   331k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   331k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   331k|                                 ctx.error = error_code::syntax_error;
 4802|   331k|                                 return false;
 4803|   331k|                              }
 4804|   331k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   331k|                           }
 4806|   331k|                        }
 4807|       |
 4808|   331k|                        if (*it == '-' &&
 4809|   331k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   331k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   331k|                           ctx.error = error_code::syntax_error;
 4813|   331k|                           return false;
 4814|   331k|                        }
 4815|       |
 4816|   331k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   331k|                           return false;
 4818|   331k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   331k|                        ctx.pop_indent();
 4820|   331k|                     }
 4821|   331k|                     else {
 4822|   331k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   331k|                        if (nested_indent >= 0) {
 4824|   331k|                           yaml::skip_to_content(it, end);
 4825|   331k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   331k|                              ctx.error = error_code::syntax_error;
 4827|   331k|                              return false;
 4828|   331k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   331k|                           const int32_t value_indent =
 4832|   331k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   331k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   331k|                              return false;
 4835|   331k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   331k|                           ctx.pop_indent();
 4837|   331k|                        }
 4838|   331k|                     }
 4839|   331k|                     return !bool(ctx.error);
 4840|   331k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   331k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   331k|                     ctx.error = error_code::syntax_error;
 4847|   331k|                     return false;
 4848|   331k|                  }
 4849|   331k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   331k|                     ++it; // skip '?'
 4851|   331k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   331k|                     const int32_t explicit_value_indicator_indent =
 4854|   331k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   331k|                     key_t key{};
 4857|   331k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   331k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   331k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   331k|                        };
 4861|       |
 4862|   331k|                        auto key_it = it;
 4863|   331k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   331k|                        auto content = key_it;
 4866|   331k|                        yaml::skip_to_content(content, end);
 4867|   331k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   331k|                        if (content != end && *content == '&') {
 4873|   331k|                           auto anchor_probe = content + 1;
 4874|   331k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   331k|                           if (!anchor_name.empty()) {
 4876|   331k|                              auto after_anchor = anchor_probe;
 4877|   331k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   331k|                              auto value_indicator = after_anchor;
 4880|   331k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   331k|                                 key.clear();
 4882|   331k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   331k|                                 it = value_indicator;
 4884|   331k|                                 handled_anchor_only_empty_key = true;
 4885|   331k|                              }
 4886|   331k|                              else {
 4887|   331k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   331k|                                    yaml::skip_comment(value_indicator, end);
 4889|   331k|                                 }
 4890|   331k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   331k|                                    yaml::skip_newline(value_indicator, end);
 4892|   331k|                                    auto value_line = value_indicator;
 4893|   331k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   331k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   331k|                                       return false;
 4896|   331k|                                    if (value_line != end && *value_line == ':' &&
 4897|   331k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   331k|                                       key.clear();
 4899|   331k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   331k|                                       it = value_line;
 4901|   331k|                                       handled_anchor_only_empty_key = true;
 4902|   331k|                                    }
 4903|   331k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   331k|                                       ctx.error = error_code::syntax_error;
 4908|   331k|                                       return false;
 4909|   331k|                                    }
 4910|   331k|                                 }
 4911|   331k|                              }
 4912|   331k|                           }
 4913|   331k|                        }
 4914|       |
 4915|   331k|                        const bool key_content_spans_lines = [&] {
 4916|   331k|                           auto scan = key_it;
 4917|   331k|                           while (scan != content && scan != end) {
 4918|   331k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   331k|                              ++scan;
 4920|   331k|                           }
 4921|   331k|                           return false;
 4922|   331k|                        }();
 4923|       |
 4924|   331k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   331k|                        }
 4927|   331k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   331k|                           key.clear();
 4929|   331k|                           it = content;
 4930|   331k|                        }
 4931|   331k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   331k|                           auto key_node_it = content;
 4937|   331k|                           auto key_node_end = end;
 4938|   331k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   331k|                              auto scan = content;
 4943|   331k|                              while (scan != end) {
 4944|   331k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   331k|                                    ++scan;
 4946|   331k|                                 }
 4947|   331k|                                 if (scan == end) {
 4948|   331k|                                    break;
 4949|   331k|                                 }
 4950|       |
 4951|   331k|                                 yaml::skip_newline(scan, end);
 4952|   331k|                                 auto line_start = scan;
 4953|       |
 4954|   331k|                                 int32_t indicator_indent = 0;
 4955|   331k|                                 while (scan != end && *scan == ' ') {
 4956|   331k|                                    ++indicator_indent;
 4957|   331k|                                    ++scan;
 4958|   331k|                                 }
 4959|       |
 4960|   331k|                                 if (scan != end && *scan == ':') {
 4961|   331k|                                    const auto after_colon = scan + 1;
 4962|   331k|                                    if ((after_colon == end ||
 4963|   331k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   331k|                                        indicator_indent <= line_indent) {
 4965|   331k|                                       key_node_end = line_start;
 4966|   331k|                                       break;
 4967|   331k|                                    }
 4968|   331k|                                 }
 4969|   331k|                              }
 4970|   331k|                           }
 4971|       |
 4972|   331k|                           glz::generic key_node{};
 4973|   331k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   331k|                           ctx.explicit_mapping_key_context = true;
 4975|   331k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   331k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   331k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   331k|                              return false;
 4979|   331k|                           it = key_node_it;
 4980|   331k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   331k|                              return false;
 4982|   331k|                        }
 4983|   331k|                     }
 4984|   331k|                     else {
 4985|   331k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   331k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   331k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   331k|                              return false;
 4989|   331k|                        }
 4990|   331k|                     }
 4991|       |
 4992|   331k|                     yaml::skip_inline_ws(it, end);
 4993|   331k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   331k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   331k|                        auto probe = it;
 4998|   331k|                        bool found_value_indicator = false;
 4999|       |
 5000|   331k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   331k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   331k|                           auto value_line = probe;
 5004|   331k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   331k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   331k|                              return false;
 5007|       |
 5008|   331k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   331k|                              probe = value_line;
 5010|   331k|                              continue; // blank line
 5011|   331k|                           }
 5012|   331k|                           if (*value_line == '#') {
 5013|   331k|                              yaml::skip_comment(value_line, end);
 5014|   331k|                              probe = value_line;
 5015|   331k|                              continue; // comment-only line
 5016|   331k|                           }
 5017|   331k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   331k|                              it = value_line;
 5019|   331k|                              found_value_indicator = true;
 5020|   331k|                           }
 5021|   331k|                           break;
 5022|   331k|                        }
 5023|       |
 5024|   331k|                        if (found_value_indicator) {
 5025|   331k|                           yaml::skip_inline_ws(it, end);
 5026|   331k|                        }
 5027|   331k|                     }
 5028|       |
 5029|   331k|                     val_t val{};
 5030|   331k|                     if (it != end && *it == ':') {
 5031|   331k|                        ++it;
 5032|   331k|                        if (it != end && *it == '\t') {
 5033|   331k|                           ctx.error = error_code::syntax_error;
 5034|   331k|                           return false;
 5035|   331k|                        }
 5036|   331k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   331k|                           auto probe = it;
 5038|   331k|                           yaml::skip_newline(probe, end);
 5039|   331k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   331k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   331k|                              ctx.error = error_code::syntax_error;
 5042|   331k|                              return false;
 5043|   331k|                           }
 5044|   331k|                        }
 5045|   331k|                        yaml::skip_inline_ws(it, end);
 5046|   331k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   331k|                           return false;
 5048|   331k|                     }
 5049|       |
 5050|   331k|                     value.emplace(std::move(key), std::move(val));
 5051|   331k|                     return true;
 5052|   331k|                  }
 5053|       |
 5054|   331k|                  key_t key{};
 5055|   331k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   331k|                     auto key_probe = it;
 5057|   331k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   331k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   331k|                     if (complex_flow_key) {
 5060|   331k|                        glz::generic key_node{};
 5061|   331k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   331k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   331k|                           return false;
 5064|   331k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   331k|                           return false;
 5066|   331k|                     }
 5067|   331k|                     else {
 5068|   331k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   331k|                           return false;
 5070|   331k|                        }
 5071|   331k|                     }
 5072|   331k|                  }
 5073|   331k|                  else {
 5074|   331k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   331k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   331k|                        return false;
 5077|   331k|                  }
 5078|       |
 5079|   331k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   331k|                  if (it == end || *it != ':') {
 5082|   331k|                     ctx.error = error_code::syntax_error;
 5083|   331k|                     return false;
 5084|   331k|                  }
 5085|   331k|                  ++it;
 5086|   331k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   331k|                  val_t val{};
 5089|   331k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   331k|                     return false;
 5091|       |
 5092|   331k|                  value.emplace(std::move(key), std::move(val));
 5093|   331k|                  return true;
 5094|   331k|               });
 5095|   331k|         }
 5096|       |
 5097|   982k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|   982k|      }
_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|  1.02M|      {
  466|  1.02M|         skip_inline_ws(it, end);
  467|       |
  468|  1.02M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 4, False: 1.02M]
  ------------------
  469|      4|            if constexpr (!AllowEmptyInput) {
  470|      4|               ctx.error = error_code::unexpected_end;
  471|      4|            }
  472|      4|            return true;
  473|      4|         }
  474|       |
  475|  1.02M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.02M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 1.02M]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|  1.02M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 1.02M]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|  1.02M|         skip_inline_ws(it, end);
  486|       |
  487|  1.02M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 4, False: 1.02M]
  ------------------
  488|      4|            if constexpr (!AllowEmptyInput) {
  489|      4|               ctx.error = error_code::unexpected_end;
  490|      4|            }
  491|      4|            return true;
  492|      4|         }
  493|       |
  494|  1.02M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.82k, False: 1.01M]
  ------------------
  495|  5.82k|            return true;
  496|  5.82k|         }
  497|       |
  498|  1.01M|         return false;
  499|  1.02M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4521|  1.02M|                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|  1.02M|      {
  409|  1.02M|         state.has_anchor = false;
  410|  1.02M|         state.anchor_name.clear();
  411|  1.02M|         state.anchor_start = nullptr;
  412|  1.02M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.02M|         if constexpr (Policy.allow_alias) {
  415|  1.02M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  1.02M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 1.02M, False: 226]
  ------------------
  417|  1.02M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 5.80k, False: 1.01M]
  ------------------
  418|  1.02M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  1.02M|         }
  424|       |
  425|  1.02M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.01M, False: 5.80k]
  |  Branch (425:27): [True: 6.85k, False: 1.00M]
  ------------------
  426|  6.85k|            ++it;
  427|  6.85k|            auto name = parse_anchor_name(it, end);
  428|  6.85k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 6.84k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  6.84k|            skip_inline_ws(it, end);
  433|  6.84k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 16, False: 6.83k]
  ------------------
  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.83k|            state.has_anchor = true;
  446|  6.83k|            state.anchor_name = std::string(name);
  447|  6.83k|            state.anchor_start = &*it;
  448|  6.83k|         }
  449|       |
  450|  1.02M|         return false;
  451|  1.02M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  1.02M|      {
  301|  1.02M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.02M]
  |  Branch (301:27): [True: 1.01M, False: 5.80k]
  ------------------
  302|       |
  303|  5.80k|         ++it; // skip '*'
  304|  5.80k|         auto name = parse_anchor_name(it, end);
  305|  5.80k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 9, False: 5.79k]
  ------------------
  306|      9|            ctx.error = error_code::syntax_error;
  307|      9|            return true;
  308|      9|         }
  309|       |
  310|  5.79k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.79k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 33, False: 5.76k]
  ------------------
  312|     33|            ctx.error = error_code::syntax_error; // undefined alias
  313|     33|            return true;
  314|     33|         }
  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.76k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.76k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 492, False: 5.27k]
  ------------------
  322|    492|            return true;
  323|    492|         }
  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.27k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 5, False: 5.26k]
  ------------------
  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|  5.26k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  5.26k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 5.26k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  5.26k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 5.26k]
  ------------------
  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.26k|         auto replay_it = span.begin;
  348|  5.26k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  5.26k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  5.26k|         ctx.indent_stack.clear();
  353|  5.26k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 269, False: 4.99k]
  ------------------
  354|    269|            ctx.push_indent(span.base_indent - 1);
  355|    269|         }
  356|       |
  357|  5.26k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  5.26k|         using V = std::remove_cvref_t<T>;
  360|  5.26k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  5.26k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  5.26k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  5.26k|         return true;
  367|  5.26k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|  2.32M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|  2.32M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  2.32M|                     val = glz::generic{};
 4665|  2.32M|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|  2.32M|               };
_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_:
 3633|   331k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   331k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 331k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   331k|         const int32_t parent_indent = ctx.current_indent();
 3644|   331k|         const bool discover_indent = (mapping_indent < 0);
 3645|   331k|         bool first_key = !discover_indent;
 3646|   331k|         bool discovered_first_key_mid_line = false;
 3647|   331k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|   737k|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 447k, False: 289k]
  ------------------
 3650|   447k|            auto line_start = it;
 3651|   447k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 447k]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|   511k|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 504k, False: 7.15k]
  ------------------
 3655|   504k|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 15.9k, False: 488k]
  ------------------
 3656|  15.9k|                  skip_comment(it, end);
 3657|  15.9k|                  skip_newline(it, end);
 3658|  15.9k|                  first_key = false;
 3659|  15.9k|                  line_indent = 0;
 3660|  15.9k|               }
 3661|   488k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 13.7k, False: 474k]
  |  Branch (3661:40): [True: 18.6k, False: 456k]
  ------------------
 3662|  32.4k|                  skip_newline(it, end);
 3663|  32.4k|                  first_key = false;
 3664|  32.4k|                  line_indent = 0;
 3665|  32.4k|               }
 3666|   456k|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 60.8k, False: 395k]
  ------------------
 3667|  60.8k|                  line_start = it;
 3668|  60.8k|                  line_indent = 0;
 3669|   156k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 154k, False: 1.19k]
  |  Branch (3669:39): [True: 95.2k, False: 59.6k]
  ------------------
 3670|  95.2k|                     ++line_indent;
 3671|  95.2k|                     ++it;
 3672|  95.2k|                  }
 3673|       |
 3674|  60.8k|                  bool saw_tab = false;
 3675|  71.9k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 70.5k, False: 1.46k]
  |  Branch (3675:40): [True: 5.71k, False: 64.8k]
  |  Branch (3675:54): [True: 5.44k, False: 59.3k]
  ------------------
 3676|  11.1k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 9.75k, False: 1.40k]
  |  Branch (3676:43): [True: 1.40k, False: 0]
  ------------------
 3677|  11.1k|                     ++it;
 3678|  11.1k|                  }
 3679|       |
 3680|  60.8k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 1.46k, False: 59.3k]
  |  Branch (3680:36): [True: 3.86k, False: 55.5k]
  |  Branch (3680:51): [True: 2.99k, False: 52.5k]
  |  Branch (3680:66): [True: 2.11k, False: 50.3k]
  ------------------
 3681|  10.4k|                     first_key = false;
 3682|  10.4k|                     line_indent = 0;
 3683|  10.4k|                     continue; // Blank or comment line
 3684|  10.4k|                  }
 3685|       |
 3686|  50.3k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 15, False: 50.3k]
  ------------------
 3687|     15|                     ctx.error = error_code::syntax_error;
 3688|     15|                     return;
 3689|     15|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|  50.3k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 48.7k, False: 1.63k]
  |  Branch (3692:46): [True: 127, False: 48.6k]
  ------------------
 3693|    127|                     it = line_start;
 3694|    127|                     return;
 3695|    127|                  }
 3696|       |
 3697|  50.2k|                  first_key = false;
 3698|  50.2k|                  break; // Found content
 3699|  50.3k|               }
 3700|   395k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 5.46k, False: 389k]
  ------------------
 3701|  5.46k|                  line_start = it;
 3702|  18.5k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 17.4k, False: 1.09k]
  |  Branch (3702:40): [True: 3.36k, False: 14.0k]
  |  Branch (3702:54): [True: 9.72k, False: 4.37k]
  ------------------
 3703|  5.46k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 1.09k, False: 4.37k]
  |  Branch (3703:36): [True: 1.88k, False: 2.49k]
  |  Branch (3703:51): [True: 404, False: 2.08k]
  |  Branch (3703:66): [True: 2.07k, False: 14]
  ------------------
 3704|  5.45k|                     first_key = false;
 3705|  5.45k|                     line_indent = 0;
 3706|  5.45k|                     continue; // Blank or comment-only line with tab indentation
 3707|  5.45k|                  }
 3708|     14|                  ctx.error = error_code::syntax_error;
 3709|     14|                  return;
 3710|  5.46k|               }
 3711|   389k|               else {
 3712|   389k|                  line_start = it;
 3713|   389k|                  break; // Content at column 0
 3714|   389k|               }
 3715|   504k|            }
 3716|       |
 3717|   447k|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 7.15k, False: 440k]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|   440k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 1.91k, False: 438k]
  |  Branch (3721:45): [True: 1.62k, False: 436k]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|   436k|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 436k, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|   436k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 436k, False: 0]
  |  Branch (3728:39): [True: 105k, False: 331k]
  |  Branch (3728:62): [True: 36.0k, False: 69.3k]
  |  Branch (3728:84): [True: 23.2k, False: 12.8k]
  ------------------
 3729|  23.2k|                  it = line_start;
 3730|  23.2k|                  return;
 3731|  23.2k|               }
 3732|   413k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 82.1k, False: 331k]
  |  Branch (3732:43): [True: 63, False: 82.0k]
  ------------------
 3733|     63|                  it = line_start;
 3734|     63|                  return;
 3735|     63|               }
 3736|   413k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   413k|            bool established_mapping_indent_this_line = false;
 3740|   413k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 331k, False: 82.0k]
  ------------------
 3741|   331k|               mapping_indent = line_indent;
 3742|   331k|               established_mapping_indent_this_line = true;
 3743|   331k|               discovered_first_key_visual_indent = line_indent;
 3744|   331k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   331k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 331k, False: 0]
  |  Branch (3745:43): [True: 331k, False: 0]
  ------------------
 3746|   331k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   331k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 192, False: 331k]
  ------------------
 3748|    192|                        ctx.error = error_code::syntax_error;
 3749|    192|                        return;
 3750|    192|                     }
 3751|       |
 3752|   331k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   331k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 329k, False: 1.63k]
  |  Branch (3753:49): [True: 242k, False: 87.0k]
  ------------------
 3754|   242k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   242k|                     }
 3756|   331k|                  }
 3757|   331k|               }
 3758|   331k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   413k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 413k, False: 192]
  |  Branch (3762:36): [True: 413k, False: 0]
  |  Branch (3762:59): [True: 82.0k, False: 331k]
  ------------------
 3763|  82.0k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 18.3k, False: 63.7k]
  ------------------
 3764|  18.3k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 18.0k, False: 259]
  |  Branch (3764:43): [True: 10.5k, False: 7.58k]
  ------------------
 3765|  10.5k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 8, False: 10.4k]
  ------------------
 3766|      8|                     ctx.error = error_code::syntax_error;
 3767|      8|                     return;
 3768|      8|                  }
 3769|  10.4k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 700, False: 9.79k]
  ------------------
 3770|    700|                     it = line_start;
 3771|    700|                     return;
 3772|    700|                  }
 3773|  10.4k|               }
 3774|  7.84k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 563, False: 7.28k]
  ------------------
 3775|    563|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 27, False: 536]
  |  Branch (3775:47): [True: 1, False: 535]
  ------------------
 3776|    535|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 535, False: 0]
  |  Branch (3776:49): [True: 535, False: 0]
  |  Branch (3776:72): [True: 3, False: 532]
  ------------------
 3777|     31|                  ctx.error = error_code::syntax_error;
 3778|     31|                  return;
 3779|     31|               }
 3780|  18.3k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   412k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 412k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   412k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 412k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   412k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 192, False: 412k]
  |  Branch (3798:32): [True: 0, False: 412k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   412k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 93.5k, False: 319k]
  |  Branch (3807:53): [True: 9.52k, False: 84.0k]
  |  Branch (3807:94): [True: 1.71k, False: 7.80k]
  ------------------
 3808|  1.71k|               const auto after_colon = it + 1;
 3809|  1.71k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 1.36k, False: 349]
  ------------------
 3810|  1.71k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 77, False: 1.64k]
  |  Branch (3810:43): [True: 1.26k, False: 377]
  ------------------
 3811|  1.34k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 111, False: 1.22k]
  ------------------
 3812|    111|                  it = line_start;
 3813|    111|                  return;
 3814|    111|               }
 3815|  1.71k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   412k|            int32_t effective_line_indent = line_indent;
 3819|   412k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 412k, False: 192]
  |  Branch (3819:36): [True: 331k, False: 81.2k]
  ------------------
 3820|   331k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 242k, False: 88.6k]
  ------------------
 3821|   242k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 198k, False: 43.9k]
  |  Branch (3821:52): [True: 118k, False: 80.4k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   124k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   124k|            }
 3834|       |
 3835|   412k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 6.69k, False: 405k]
  ------------------
 3836|  6.69k|               return;
 3837|  6.69k|            }
 3838|   405k|            first_key = false;
 3839|       |
 3840|   405k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 405k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|   405k|            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|   405k|               auto flow_end = it;
 3847|   405k|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|   405k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3848:20): [True: 35, False: 405k]
  ------------------
 3849|     35|                  return;
 3850|   405k|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3850:20): [True: 327k, False: 77.8k]
  |  Branch (3850:40): [True: 178k, False: 149k]
  |  Branch (3850:60): [True: 8.59k, False: 141k]
  |  Branch (3850:80): [True: 31.5k, False: 109k]
  ------------------
 3851|   218k|                  it = flow_end;
 3852|   218k|                  return;
 3853|   218k|               }
 3854|   405k|            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   405k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 130k, False: 275k]
  ------------------
 3860|   130k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 47.1k, False: 83.2k]
  |  Branch (3860:34): [True: 663, False: 82.5k]
  ------------------
 3861|  47.8k|                  auto peek = it;
 3862|  47.8k|                  skip_inline_ws(peek, end);
 3863|  47.8k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 42.9k, False: 4.92k]
  |  Branch (3863:38): [True: 41.2k, False: 1.67k]
  |  Branch (3863:55): [True: 40.8k, False: 433]
  |  Branch (3863:72): [True: 40.0k, False: 753]
  ------------------
 3864|  40.0k|                     continue; // At leading indent of new line
 3865|  40.0k|                  }
 3866|  47.8k|               }
 3867|  90.3k|               skip_inline_ws(it, end);
 3868|  90.3k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 85.4k, False: 4.92k]
  |  Branch (3868:33): [True: 3.71k, False: 81.7k]
  ------------------
 3869|  3.71k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  3.71k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 3.71k, False: 0]
  ------------------
 3871|  3.71k|                        const char prev = *(it - 1);
 3872|  3.71k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 2.13k, False: 1.57k]
  |  Branch (3872:44): [True: 1.34k, False: 787]
  |  Branch (3872:60): [True: 398, False: 949]
  |  Branch (3872:76): [True: 6, False: 392]
  ------------------
 3873|      6|                           ctx.error = error_code::syntax_error;
 3874|      6|                           return;
 3875|      6|                        }
 3876|  3.71k|                     }
 3877|  3.71k|                  }
 3878|  3.71k|               }
 3879|  3.70k|               skip_comment(it, end);
 3880|  90.3k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 85.3k, False: 4.96k]
  |  Branch (3880:34): [True: 25.0k, False: 60.3k]
  |  Branch (3880:49): [True: 28.8k, False: 31.5k]
  ------------------
 3881|  53.8k|                  skip_newline(it, end);
 3882|  53.8k|               }
 3883|  36.5k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 31.5k, False: 4.96k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|  31.5k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|  31.5k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 354, False: 31.2k]
  ------------------
 3890|    354|                        ctx.error = error_code::syntax_error;
 3891|    354|                        return;
 3892|    354|                     }
 3893|  31.5k|                  }
 3894|  31.5k|               }
 3895|  90.3k|            }
 3896|   405k|         }
 3897|   331k|      }
_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:
 4777|   412k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   412k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   412k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   412k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   412k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   412k|                           if (ctx.stream_begin) {
 4788|   412k|                              auto is_line_content_start = [&](auto pos) {
 4789|   412k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   412k|                              };
 4791|       |
 4792|   412k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   412k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   412k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   412k|                                 return line != end && *line == ':';
 4796|   412k|                              };
 4797|       |
 4798|   412k|                              if (!is_line_content_start(it) &&
 4799|   412k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   412k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   412k|                                 ctx.error = error_code::syntax_error;
 4802|   412k|                                 return false;
 4803|   412k|                              }
 4804|   412k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   412k|                           }
 4806|   412k|                        }
 4807|       |
 4808|   412k|                        if (*it == '-' &&
 4809|   412k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   412k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   412k|                           ctx.error = error_code::syntax_error;
 4813|   412k|                           return false;
 4814|   412k|                        }
 4815|       |
 4816|   412k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   412k|                           return false;
 4818|   412k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   412k|                        ctx.pop_indent();
 4820|   412k|                     }
 4821|   412k|                     else {
 4822|   412k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   412k|                        if (nested_indent >= 0) {
 4824|   412k|                           yaml::skip_to_content(it, end);
 4825|   412k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   412k|                              ctx.error = error_code::syntax_error;
 4827|   412k|                              return false;
 4828|   412k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   412k|                           const int32_t value_indent =
 4832|   412k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   412k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   412k|                              return false;
 4835|   412k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   412k|                           ctx.pop_indent();
 4837|   412k|                        }
 4838|   412k|                     }
 4839|   412k|                     return !bool(ctx.error);
 4840|   412k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   412k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 167k, False: 244k]
  |  Branch (4845:37): [True: 167k, False: 102]
  |  Branch (4845:58): [True: 3, False: 167k]
  ------------------
 4846|      3|                     ctx.error = error_code::syntax_error;
 4847|      3|                     return false;
 4848|      3|                  }
 4849|   412k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 167k, False: 244k]
  |  Branch (4849:38): [True: 102, False: 167k]
  |  Branch (4849:57): [True: 67.8k, False: 99.9k]
  |  Branch (4849:77): [True: 62.9k, False: 36.9k]
  |  Branch (4849:98): [True: 29.2k, False: 7.70k]
  ------------------
 4850|   160k|                     ++it; // skip '?'
 4851|   160k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   160k|                     const int32_t explicit_value_indicator_indent =
 4854|   160k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 92.8k, False: 67.3k]
  ------------------
 4855|       |
 4856|   160k|                     key_t key{};
 4857|   160k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   160k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   160k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   160k|                        };
 4861|       |
 4862|   160k|                        auto key_it = it;
 4863|   160k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   160k|                        auto content = key_it;
 4866|   160k|                        yaml::skip_to_content(content, end);
 4867|   160k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   160k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 153k, False: 6.61k]
  |  Branch (4872:47): [True: 51.3k, False: 102k]
  ------------------
 4873|  51.3k|                           auto anchor_probe = content + 1;
 4874|  51.3k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|  51.3k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 51.3k, False: 11]
  ------------------
 4876|  51.3k|                              auto after_anchor = anchor_probe;
 4877|  51.3k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|  51.3k|                              auto value_indicator = after_anchor;
 4880|  51.3k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 49.9k, False: 1.37k]
  |  Branch (4880:61): [True: 2.03k, False: 47.9k]
  ------------------
 4881|  2.03k|                                 key.clear();
 4882|  2.03k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  2.03k|                                 it = value_indicator;
 4884|  2.03k|                                 handled_anchor_only_empty_key = true;
 4885|  2.03k|                              }
 4886|  49.3k|                              else {
 4887|  49.3k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 47.9k, False: 1.37k]
  |  Branch (4887:64): [True: 866, False: 47.0k]
  ------------------
 4888|    866|                                    yaml::skip_comment(value_indicator, end);
 4889|    866|                                 }
 4890|  49.3k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 47.9k, False: 1.38k]
  |  Branch (4890:65): [True: 13.9k, False: 33.9k]
  |  Branch (4890:93): [True: 9.93k, False: 24.0k]
  ------------------
 4891|  23.9k|                                    yaml::skip_newline(value_indicator, end);
 4892|  23.9k|                                    auto value_line = value_indicator;
 4893|  23.9k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  23.9k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 3, False: 23.8k]
  ------------------
 4895|      3|                                       return false;
 4896|  23.8k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 22.9k, False: 902]
  |  Branch (4896:62): [True: 4.22k, False: 18.7k]
  ------------------
 4897|  4.22k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 4.22k, False: 3]
  ------------------
 4898|  4.22k|                                       key.clear();
 4899|  4.22k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  4.22k|                                       it = value_line;
 4901|  4.22k|                                       handled_anchor_only_empty_key = true;
 4902|  4.22k|                                    }
 4903|  19.6k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 18.7k, False: 902]
  |  Branch (4903:67): [True: 3, False: 18.7k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|      3|                                       ctx.error = error_code::syntax_error;
 4908|      3|                                       return false;
 4909|      3|                                    }
 4910|  23.8k|                                 }
 4911|  49.3k|                              }
 4912|  51.3k|                           }
 4913|  51.3k|                        }
 4914|       |
 4915|   160k|                        const bool key_content_spans_lines = [&] {
 4916|   160k|                           auto scan = key_it;
 4917|   160k|                           while (scan != content && scan != end) {
 4918|   160k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   160k|                              ++scan;
 4920|   160k|                           }
 4921|   160k|                           return false;
 4922|   160k|                        }();
 4923|       |
 4924|   160k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 6.26k, False: 153k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  6.26k|                        }
 4927|   153k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 6.61k, False: 147k]
  |  Branch (4927:53): [True: 3.59k, False: 143k]
  |  Branch (4927:72): [True: 1.63k, False: 1.96k]
  ------------------
 4928|  8.24k|                           key.clear();
 4929|  8.24k|                           it = content;
 4930|  8.24k|                        }
 4931|   145k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   145k|                           auto key_node_it = content;
 4937|   145k|                           auto key_node_end = end;
 4938|   145k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   145k|                              auto scan = content;
 4943|  3.44M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 3.42M, False: 28.5k]
  ------------------
 4944|  84.3M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 84.3M, False: 83.1k]
  |  Branch (4944:56): [True: 82.7M, False: 1.51M]
  |  Branch (4944:73): [True: 80.9M, False: 1.82M]
  ------------------
 4945|  80.9M|                                    ++scan;
 4946|  80.9M|                                 }
 4947|  3.42M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 83.1k, False: 3.33M]
  ------------------
 4948|  83.1k|                                    break;
 4949|  83.1k|                                 }
 4950|       |
 4951|  3.33M|                                 yaml::skip_newline(scan, end);
 4952|  3.33M|                                 auto line_start = scan;
 4953|       |
 4954|  3.33M|                                 int32_t indicator_indent = 0;
 4955|  4.04M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 4.01M, False: 28.5k]
  |  Branch (4955:56): [True: 704k, False: 3.30M]
  ------------------
 4956|   704k|                                    ++indicator_indent;
 4957|   704k|                                    ++scan;
 4958|   704k|                                 }
 4959|       |
 4960|  3.33M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 3.30M, False: 28.5k]
  |  Branch (4960:53): [True: 83.1k, False: 3.22M]
  ------------------
 4961|  83.1k|                                    const auto after_colon = scan + 1;
 4962|  83.1k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 309, False: 82.7k]
  ------------------
 4963|  82.7k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 52.1k, False: 30.6k]
  ------------------
 4964|  52.4k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 33.8k, False: 18.5k]
  ------------------
 4965|  33.8k|                                       key_node_end = line_start;
 4966|  33.8k|                                       break;
 4967|  33.8k|                                    }
 4968|  83.1k|                                 }
 4969|  3.33M|                              }
 4970|   145k|                           }
 4971|       |
 4972|   145k|                           glz::generic key_node{};
 4973|   145k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   145k|                           ctx.explicit_mapping_key_context = true;
 4975|   145k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   145k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   145k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 1.15k, False: 144k]
  ------------------
 4978|  1.15k|                              return false;
 4979|   144k|                           it = key_node_it;
 4980|   144k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 5, False: 144k]
  ------------------
 4981|      5|                              return false;
 4982|   144k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   158k|                     yaml::skip_inline_ws(it, end);
 4993|   160k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   160k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 132k, False: 27.5k]
  |  Branch (4996:40): [True: 10.0k, False: 122k]
  |  Branch (4996:55): [True: 22.3k, False: 100k]
  ------------------
 4997|  32.3k|                        auto probe = it;
 4998|  32.3k|                        bool found_value_indicator = false;
 4999|       |
 5000|  64.9k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 55.5k, False: 9.42k]
  |  Branch (5000:49): [True: 19.2k, False: 36.3k]
  |  Branch (5000:67): [True: 36.3k, False: 0]
  ------------------
 5001|  55.5k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|  55.5k|                           auto value_line = probe;
 5004|  55.5k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|  55.5k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 8, False: 55.5k]
  ------------------
 5006|      8|                              return false;
 5007|       |
 5008|  55.5k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 8.07k, False: 47.4k]
  |  Branch (5008:53): [True: 6.03k, False: 41.4k]
  |  Branch (5008:76): [True: 10.4k, False: 30.9k]
  ------------------
 5009|  24.5k|                              probe = value_line;
 5010|  24.5k|                              continue; // blank line
 5011|  24.5k|                           }
 5012|  30.9k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 8.02k, False: 22.9k]
  ------------------
 5013|  8.02k|                              yaml::skip_comment(value_line, end);
 5014|  8.02k|                              probe = value_line;
 5015|  8.02k|                              continue; // comment-only line
 5016|  8.02k|                           }
 5017|  22.9k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 6.54k, False: 16.4k]
  |  Branch (5017:54): [True: 3.63k, False: 2.90k]
  ------------------
 5018|  3.63k|                              it = value_line;
 5019|  3.63k|                              found_value_indicator = true;
 5020|  3.63k|                           }
 5021|  22.9k|                           break;
 5022|  30.9k|                        }
 5023|       |
 5024|  32.3k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 3.63k, False: 28.7k]
  ------------------
 5025|  3.63k|                           yaml::skip_inline_ws(it, end);
 5026|  3.63k|                        }
 5027|  32.3k|                     }
 5028|       |
 5029|   160k|                     val_t val{};
 5030|   160k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 132k, False: 27.5k]
  |  Branch (5030:39): [True: 44.5k, False: 88.0k]
  ------------------
 5031|  44.5k|                        ++it;
 5032|  44.5k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 44.2k, False: 255]
  |  Branch (5032:42): [True: 12, False: 44.2k]
  ------------------
 5033|     12|                           ctx.error = error_code::syntax_error;
 5034|     12|                           return false;
 5035|     12|                        }
 5036|  44.5k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 44.2k, False: 255]
  |  Branch (5036:43): [True: 2.92k, False: 41.3k]
  |  Branch (5036:58): [True: 6.71k, False: 34.6k]
  ------------------
 5037|  9.63k|                           auto probe = it;
 5038|  9.63k|                           yaml::skip_newline(probe, end);
 5039|  28.1k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 27.4k, False: 636]
  |  Branch (5039:51): [True: 18.4k, False: 8.99k]
  ------------------
 5040|  9.63k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 8.99k, False: 636]
  |  Branch (5040:48): [True: 484, False: 8.51k]
  |  Branch (5040:65): [True: 482, False: 2]
  |  Branch (5040:89): [True: 1, False: 481]
  ------------------
 5041|      1|                              ctx.error = error_code::syntax_error;
 5042|      1|                              return false;
 5043|      1|                           }
 5044|  9.63k|                        }
 5045|  44.5k|                        yaml::skip_inline_ws(it, end);
 5046|  44.5k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 267, False: 44.2k]
  ------------------
 5047|    267|                           return false;
 5048|  44.5k|                     }
 5049|       |
 5050|   159k|                     value.emplace(std::move(key), std::move(val));
 5051|   159k|                     return true;
 5052|   160k|                  }
 5053|       |
 5054|   252k|                  key_t key{};
 5055|   252k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   252k|                     auto key_probe = it;
 5057|   252k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   252k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 252k, False: 0]
  |  Branch (5058:74): [True: 523, False: 251k]
  |  Branch (5058:95): [True: 577, False: 251k]
  ------------------
 5059|   252k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 1.10k, False: 251k]
  ------------------
 5060|  1.10k|                        glz::generic key_node{};
 5061|  1.10k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  1.10k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 503, False: 597]
  ------------------
 5063|    503|                           return false;
 5064|    597|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 0, False: 597]
  ------------------
 5065|      0|                           return false;
 5066|    597|                     }
 5067|   251k|                     else {
 5068|   251k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 120, False: 250k]
  ------------------
 5069|    120|                           return false;
 5070|    120|                        }
 5071|   251k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   251k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   252k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 818, False: 251k]
  |  Branch (5081:36): [True: 206, False: 251k]
  ------------------
 5082|    401|                     ctx.error = error_code::syntax_error;
 5083|    401|                     return false;
 5084|    401|                  }
 5085|   251k|                  ++it;
 5086|   251k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   251k|                  val_t val{};
 5089|   251k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 4.21k, False: 247k]
  ------------------
 5090|  4.21k|                     return false;
 5091|       |
 5092|   247k|                  value.emplace(std::move(key), std::move(val));
 5093|   247k|                  return true;
 5094|   251k|               });
_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:
 4915|   160k|                        const bool key_content_spans_lines = [&] {
 4916|   160k|                           auto scan = key_it;
 4917|   176k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 112k, False: 64.0k]
  |  Branch (4917:54): [True: 112k, False: 0]
  ------------------
 4918|   112k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 63.5k, False: 48.4k]
  |  Branch (4918:52): [True: 32.4k, False: 15.9k]
  ------------------
 4919|  15.9k|                              ++scan;
 4920|  15.9k|                           }
 4921|  64.0k|                           return false;
 4922|   160k|                        }();
_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_:
 4858|   144k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   144k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   144k|                        };
_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_:
 4778|   295k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   295k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 288k, False: 7.04k]
  |  Branch (4779:39): [True: 201k, False: 86.9k]
  ------------------
 4780|   201k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   201k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   201k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 201k, False: 0]
  ------------------
 4788|   201k|                              auto is_line_content_start = [&](auto pos) {
 4789|   201k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   201k|                              };
 4791|       |
 4792|   201k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   201k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   201k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   201k|                                 return line != end && *line == ':';
 4796|   201k|                              };
 4797|       |
 4798|   201k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 201k, False: 0]
  ------------------
 4799|   201k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 30.5k, False: 171k]
  ------------------
 4800|  30.5k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 362, False: 30.1k]
  ------------------
 4801|    362|                                 ctx.error = error_code::syntax_error;
 4802|    362|                                 return false;
 4803|    362|                              }
 4804|   201k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   201k|                           }
 4806|   201k|                        }
 4807|       |
 4808|   201k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 2.39k, False: 199k]
  ------------------
 4809|  2.39k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 409, False: 1.98k]
  |  Branch (4809:49): [True: 1.00k, False: 982]
  ------------------
 4810|  1.41k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 6, False: 1.40k]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|      6|                           ctx.error = error_code::syntax_error;
 4813|      6|                           return false;
 4814|      6|                        }
 4815|       |
 4816|   201k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 201k]
  ------------------
 4817|      0|                           return false;
 4818|   201k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   201k|                        ctx.pop_indent();
 4820|   201k|                     }
 4821|  93.9k|                     else {
 4822|  93.9k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|  93.9k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 40.5k, False: 53.4k]
  ------------------
 4824|  40.5k|                           yaml::skip_to_content(it, end);
 4825|  40.5k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 40.5k, False: 0]
  |  Branch (4825:45): [True: 0, False: 40.5k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  40.5k|                           const int32_t value_indent =
 4832|  40.5k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 40.5k]
  ------------------
 4833|  40.5k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 40.5k]
  ------------------
 4834|      0|                              return false;
 4835|  40.5k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  40.5k|                           ctx.pop_indent();
 4837|  40.5k|                        }
 4838|  93.9k|                     }
 4839|   295k|                     return !bool(ctx.error);
 4840|   295k|                  };
_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_:
 4788|   201k|                              auto is_line_content_start = [&](auto pos) {
 4789|   201k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   201k|                              };
_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_:
 4792|   231k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   231k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   370k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 370k, False: 0]
  |  Branch (4794:57): [True: 138k, False: 232k]
  |  Branch (4794:73): [True: 436, False: 231k]
  ------------------
 4795|   231k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 231k, False: 0]
  |  Branch (4795:56): [True: 120k, False: 110k]
  ------------------
 4796|   231k|                              };
_ZN3glz4yaml26detect_nested_value_indentINS0_12yaml_contextEPKcS4_EEiRT_RT0_T1_i:
 3418|  1.25M|      {
 3419|  1.25M|         skip_ws_and_comment(it, end);
 3420|  1.25M|         if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3420:14): [True: 78.4k, False: 1.17M]
  |  Branch (3420:28): [True: 836k, False: 338k]
  |  Branch (3420:43): [True: 0, False: 836k]
  ------------------
 3421|  78.4k|            return -1;
 3422|  78.4k|         }
 3423|  1.17M|         skip_newline(it, end);
 3424|  1.17M|         auto content_start = it;
 3425|       |
 3426|       |         // Peek ahead to find the first content line (skip blank/comment lines)
 3427|  1.17M|         auto peek = it;
 3428|  1.55M|         while (peek != end) {
  ------------------
  |  Branch (3428:17): [True: 1.41M, False: 136k]
  ------------------
 3429|  1.41M|            if (*peek == '\n' || *peek == '\r') {
  ------------------
  |  Branch (3429:17): [True: 84.9k, False: 1.33M]
  |  Branch (3429:34): [True: 111k, False: 1.22M]
  ------------------
 3430|   196k|               skip_newline(peek, end);
 3431|   196k|            }
 3432|  1.22M|            else if (*peek == '#') {
  ------------------
  |  Branch (3432:22): [True: 39.5k, False: 1.18M]
  ------------------
 3433|  39.5k|               skip_comment(peek, end);
 3434|  39.5k|            }
 3435|  1.18M|            else if (*peek == ' ') {
  ------------------
  |  Branch (3435:22): [True: 928k, False: 254k]
  ------------------
 3436|   928k|               auto line_start = peek;
 3437|  2.62M|               while (peek != end && *peek == ' ') ++peek;
  ------------------
  |  Branch (3437:23): [True: 2.55M, False: 76.4k]
  |  Branch (3437:38): [True: 1.70M, False: 851k]
  ------------------
 3438|   928k|               if (peek == end || *peek == '\n' || *peek == '\r') {
  ------------------
  |  Branch (3438:20): [True: 76.4k, False: 851k]
  |  Branch (3438:35): [True: 14.4k, False: 837k]
  |  Branch (3438:52): [True: 12.9k, False: 824k]
  ------------------
 3439|   103k|                  continue; // blank line with trailing spaces
 3440|   103k|               }
 3441|   824k|               if (*peek == '#') {
  ------------------
  |  Branch (3441:20): [True: 19.8k, False: 804k]
  ------------------
 3442|  19.8k|                  skip_comment(peek, end);
 3443|  19.8k|                  continue; // comment-only line
 3444|  19.8k|               }
 3445|       |               // YAML allows node properties to appear on standalone lines before the
 3446|       |               // actual node value, for example:
 3447|       |               //   key:
 3448|       |               //     !tag
 3449|       |               //     &anchor
 3450|       |               //     actual: value
 3451|       |               // This loop recognizes chains of properties (`!tag`, `&anchor`, optional
 3452|       |               // inline spaces/comments) and treats those lines as non-content so they do
 3453|       |               // not incorrectly define nested indentation.
 3454|   804k|               {
 3455|   804k|                  auto prop = peek;
 3456|   804k|                  bool saw_property = false;
 3457|   854k|                  while (prop != end) {
  ------------------
  |  Branch (3457:26): [True: 854k, False: 290]
  ------------------
 3458|   854k|                     if (*prop == '!') {
  ------------------
  |  Branch (3458:26): [True: 15.2k, False: 838k]
  ------------------
 3459|  15.2k|                        const auto tag = parse_yaml_tag(prop, end, ctx);
 3460|  15.2k|                        if (tag == yaml_tag::unknown) break;
  ------------------
  |  Branch (3460:29): [True: 168, False: 15.0k]
  ------------------
 3461|  15.0k|                        saw_property = true;
 3462|  15.0k|                        skip_inline_ws(prop, end);
 3463|  15.0k|                        continue;
 3464|  15.2k|                     }
 3465|   838k|                     if (*prop == '&') {
  ------------------
  |  Branch (3465:26): [True: 35.3k, False: 803k]
  ------------------
 3466|  35.3k|                        ++prop;
 3467|  35.3k|                        auto aname = parse_anchor_name(prop, end);
 3468|  35.3k|                        if (aname.empty()) break;
  ------------------
  |  Branch (3468:29): [True: 540, False: 34.7k]
  ------------------
 3469|  34.7k|                        saw_property = true;
 3470|  34.7k|                        skip_inline_ws(prop, end);
 3471|  34.7k|                        continue;
 3472|  35.3k|                     }
 3473|   803k|                     break;
 3474|   838k|                  }
 3475|   804k|                  if (saw_property) {
  ------------------
  |  Branch (3475:23): [True: 31.3k, False: 773k]
  ------------------
 3476|  31.3k|                     auto tail = prop;
 3477|  31.3k|                     skip_inline_ws(tail, end);
 3478|  31.3k|                     if (tail == end || *tail == '\n' || *tail == '\r' || *tail == '#') {
  ------------------
  |  Branch (3478:26): [True: 304, False: 31.0k]
  |  Branch (3478:41): [True: 3.51k, False: 27.5k]
  |  Branch (3478:58): [True: 14.9k, False: 12.6k]
  |  Branch (3478:75): [True: 1.09k, False: 11.5k]
  ------------------
 3479|  19.8k|                        if (tail != end && *tail == '#') {
  ------------------
  |  Branch (3479:29): [True: 19.5k, False: 304]
  |  Branch (3479:44): [True: 1.09k, False: 18.4k]
  ------------------
 3480|  1.09k|                           skip_comment(tail, end);
 3481|  1.09k|                        }
 3482|  19.8k|                        if (tail != end && (*tail == '\n' || *tail == '\r')) {
  ------------------
  |  Branch (3482:29): [True: 19.4k, False: 394]
  |  Branch (3482:45): [True: 3.78k, False: 15.6k]
  |  Branch (3482:62): [True: 15.6k, False: 0]
  ------------------
 3483|  19.4k|                           skip_newline(tail, end);
 3484|  19.4k|                        }
 3485|  19.8k|                        peek = tail;
 3486|  19.8k|                        continue;
 3487|  19.8k|                     }
 3488|  31.3k|                  }
 3489|   804k|               }
 3490|   784k|               peek = line_start; // content found, restore to measure properly
 3491|   784k|               break;
 3492|   804k|            }
 3493|   254k|            else {
 3494|   254k|               break; // content at column 0
 3495|   254k|            }
 3496|  1.41M|         }
 3497|       |
 3498|       |         // Measure indent of the content line
 3499|  1.17M|         int32_t content_indent = measure_indent<false>(peek, end, ctx);
 3500|  1.17M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3500:14): [True: 166, False: 1.17M]
  ------------------
 3501|    166|            return -1;
 3502|       |
 3503|       |         // Tabs in indentation-like positions are only allowed when they are plain
 3504|       |         // scalar content. Structural lines (mapping keys/entries) remain errors.
 3505|  1.17M|         if (peek != end && *peek == '\t') {
  ------------------
  |  Branch (3505:14): [True: 1.03M, False: 136k]
  |  Branch (3505:29): [True: 17.0k, False: 1.02M]
  ------------------
 3506|  17.0k|            auto probe = peek;
 3507|  70.8k|            while (probe != end && (*probe == ' ' || *probe == '\t')) ++probe;
  ------------------
  |  Branch (3507:20): [True: 70.6k, False: 260]
  |  Branch (3507:37): [True: 14.3k, False: 56.3k]
  |  Branch (3507:54): [True: 39.5k, False: 16.8k]
  ------------------
 3508|  17.0k|            if (probe != end && *probe != '\n' && *probe != '\r' && *probe != '#') {
  ------------------
  |  Branch (3508:17): [True: 16.8k, False: 260]
  |  Branch (3508:33): [True: 16.0k, False: 756]
  |  Branch (3508:51): [True: 15.7k, False: 314]
  |  Branch (3508:69): [True: 15.2k, False: 510]
  ------------------
 3509|  15.2k|               const bool looks_sequence_entry =
 3510|  15.2k|                  (*probe == '-') &&
  ------------------
  |  Branch (3510:19): [True: 98, False: 15.1k]
  ------------------
 3511|     98|                  ((probe + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(probe + 1))]);
  ------------------
  |  Branch (3511:20): [True: 2, False: 96]
  |  Branch (3511:42): [True: 4, False: 92]
  ------------------
 3512|  15.2k|               const bool looks_explicit_entry =
 3513|  15.2k|                  (*probe == '?' || *probe == ':') &&
  ------------------
  |  Branch (3513:20): [True: 410, False: 14.8k]
  |  Branch (3513:37): [True: 364, False: 14.4k]
  ------------------
 3514|    774|                  ((probe + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(probe + 1))]);
  ------------------
  |  Branch (3514:20): [True: 24, False: 750]
  |  Branch (3514:42): [True: 14, False: 736]
  ------------------
 3515|  15.2k|               bool looks_mapping_key = false;
 3516|  15.2k|               auto scan = probe;
 3517|   212k|               while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (3517:23): [True: 211k, False: 1.04k]
  |  Branch (3517:38): [True: 209k, False: 1.87k]
  |  Branch (3517:55): [True: 197k, False: 12.1k]
  ------------------
 3518|   197k|                  if (*scan == ':') {
  ------------------
  |  Branch (3518:23): [True: 2.28k, False: 195k]
  ------------------
 3519|  2.28k|                     const auto after = scan + 1;
 3520|  2.28k|                     if (after == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after)]) {
  ------------------
  |  Branch (3520:26): [True: 122, False: 2.15k]
  |  Branch (3520:42): [True: 66, False: 2.09k]
  ------------------
 3521|    188|                        looks_mapping_key = true;
 3522|    188|                        break;
 3523|    188|                     }
 3524|  2.28k|                  }
 3525|   197k|                  ++scan;
 3526|   197k|               }
 3527|  15.2k|               if (looks_sequence_entry || looks_explicit_entry || looks_mapping_key) {
  ------------------
  |  Branch (3527:20): [True: 6, False: 15.2k]
  |  Branch (3527:44): [True: 38, False: 15.1k]
  |  Branch (3527:68): [True: 156, False: 15.0k]
  ------------------
 3528|    200|                  ctx.error = error_code::syntax_error;
 3529|    200|                  return -1;
 3530|    200|               }
 3531|  15.2k|            }
 3532|  17.0k|         }
 3533|       |
 3534|  1.17M|         const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3534:48): [True: 0, False: 1.17M]
  ------------------
 3535|  1.17M|         if (content_indent > effective_line_indent && peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (3535:14): [True: 415k, False: 759k]
  |  Branch (3535:56): [True: 415k, False: 0]
  |  Branch (3535:71): [True: 415k, False: 0]
  |  Branch (3535:88): [True: 415k, False: 0]
  ------------------
 3536|   415k|            it = content_start;
 3537|   415k|            return content_indent;
 3538|   415k|         }
 3539|       |
 3540|       |         // YAML allows "indentless sequences" as mapping values:
 3541|       |         // key:
 3542|       |         // - item
 3543|   759k|         if (content_indent == effective_line_indent && peek != end && *peek == '-') {
  ------------------
  |  Branch (3543:14): [True: 500k, False: 258k]
  |  Branch (3543:57): [True: 393k, False: 107k]
  |  Branch (3543:72): [True: 43.7k, False: 349k]
  ------------------
 3544|  43.7k|            const auto after_dash = peek + 1;
 3545|  43.7k|            if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3545:17): [True: 98, False: 43.6k]
  |  Branch (3545:38): [True: 39.2k, False: 4.45k]
  ------------------
 3546|  39.3k|               it = content_start;
 3547|  39.3k|               return content_indent;
 3548|  39.3k|            }
 3549|  43.7k|         }
 3550|       |
 3551|   720k|         it = content_start;
 3552|   720k|         return -1;
 3553|   759k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|  1.01M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  1.01M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 1.01M]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|  1.01M|            }
_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_:
 5205|   396k|      {
 5206|   396k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   396k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   396k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   396k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   396k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 396k, False: 0]
  ------------------
 5216|   396k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   396k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4098|   417k|      {
 4099|   417k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 417k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|   417k|         auto peek = it;
 4104|   417k|         yaml::node_preamble_state preamble{};
 4105|   417k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 22.0k, False: 395k]
  ------------------
 4106|   417k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  22.0k|            it = peek;
 4108|  22.0k|            return;
 4109|  22.0k|         }
 4110|       |
 4111|   395k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 56.0k, False: 339k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|  56.0k|            it = peek;
 4114|  56.0k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|  56.0k|         }
 4116|   339k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 339k, False: 73]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|   339k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 2.63k, False: 336k]
  |  Branch (4119:57): [True: 1.97k, False: 334k]
  ------------------
 4120|  4.61k|               it = peek;
 4121|  4.61k|            }
 4122|   339k|            int32_t seq_indent = ctx.current_indent();
 4123|   339k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 338k, False: 441]
  |  Branch (4123:31): [True: 67.9k, False: 270k]
  ------------------
 4124|  67.9k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 3.77k, False: 64.1k]
  |  Branch (4124:62): [True: 2.33k, False: 1.44k]
  ------------------
 4125|  67.9k|                                                          : (ctx.current_indent() + 1);
 4126|  67.9k|            }
 4127|   339k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|   339k|         }
 4129|     73|         else {
 4130|     73|            ctx.error = error_code::syntax_error;
 4131|     73|         }
 4132|       |
 4133|   395k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|   395k|      }
_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|   417k|      {
  466|   417k|         skip_inline_ws(it, end);
  467|       |
  468|   417k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 8, False: 417k]
  ------------------
  469|      8|            if constexpr (!AllowEmptyInput) {
  470|      8|               ctx.error = error_code::unexpected_end;
  471|      8|            }
  472|      8|            return true;
  473|      8|         }
  474|       |
  475|   417k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   417k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 417k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|   417k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 1, False: 417k]
  ------------------
  481|      1|            ctx.error = error_code::syntax_error;
  482|      1|            return true;
  483|      1|         }
  484|       |
  485|   417k|         skip_inline_ws(it, end);
  486|       |
  487|   417k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 417k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|   417k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 22.0k, False: 395k]
  ------------------
  495|  22.0k|            return true;
  496|  22.0k|         }
  497|       |
  498|   395k|         return false;
  499|   417k|      }
_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_:
 4106|   417k|                                             [](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|   417k|      {
  409|   417k|         state.has_anchor = false;
  410|   417k|         state.anchor_name.clear();
  411|   417k|         state.anchor_start = nullptr;
  412|   417k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   417k|         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|   417k|            else {
  421|   417k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 22.0k, False: 395k]
  ------------------
  422|   417k|            }
  423|   417k|         }
  424|       |
  425|   417k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 395k, False: 22.0k]
  |  Branch (425:27): [True: 2.42k, False: 392k]
  ------------------
  426|  2.42k|            ++it;
  427|  2.42k|            auto name = parse_anchor_name(it, end);
  428|  2.42k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 2.41k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  2.41k|            skip_inline_ws(it, end);
  433|  2.41k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 23, False: 2.39k]
  ------------------
  434|     23|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     23|                  ctx.error = error_code::unexpected_end;
  436|     23|               }
  437|     23|               return true;
  438|     23|            }
  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.39k|            state.has_anchor = true;
  446|  2.39k|            state.anchor_name = std::string(name);
  447|  2.39k|            state.anchor_start = &*it;
  448|  2.39k|         }
  449|       |
  450|   417k|         return false;
  451|   417k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   417k|      {
  301|   417k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 417k]
  |  Branch (301:27): [True: 395k, False: 22.0k]
  ------------------
  302|       |
  303|  22.0k|         ++it; // skip '*'
  304|  22.0k|         auto name = parse_anchor_name(it, end);
  305|  22.0k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 4, False: 22.0k]
  ------------------
  306|      4|            ctx.error = error_code::syntax_error;
  307|      4|            return true;
  308|      4|         }
  309|       |
  310|  22.0k|         auto anchor_it = ctx.anchors.find(name);
  311|  22.0k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 17, False: 22.0k]
  ------------------
  312|     17|            ctx.error = error_code::syntax_error; // undefined alias
  313|     17|            return true;
  314|     17|         }
  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|  22.0k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  22.0k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 819, False: 21.2k]
  ------------------
  322|    819|            return true;
  323|    819|         }
  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|  21.2k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 5, False: 21.1k]
  ------------------
  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|  21.1k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  21.1k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 21.1k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  21.1k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 21.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|  21.1k|         auto replay_it = span.begin;
  348|  21.1k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  21.1k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  21.1k|         ctx.indent_stack.clear();
  353|  21.1k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.95k, False: 19.2k]
  ------------------
  354|  1.95k|            ctx.push_indent(span.base_indent - 1);
  355|  1.95k|         }
  356|       |
  357|  21.1k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  21.1k|         using V = std::remove_cvref_t<T>;
  360|  21.1k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  21.1k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  21.1k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  21.1k|         return true;
  367|  21.1k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|  56.0k|      {
 2597|  56.0k|         using V = std::remove_cvref_t<T>;
 2598|  56.0k|         using value_type = typename V::value_type;
 2599|       |
 2600|  56.0k|         struct sequence_container_adapter
 2601|  56.0k|         {
 2602|  56.0k|            size_t index = 0;
 2603|       |
 2604|  56.0k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|  56.0k|            {
 2606|  56.0k|               if constexpr (!resizable<V>) {
 2607|  56.0k|                  return index >= container.size();
 2608|  56.0k|               }
 2609|  56.0k|               else {
 2610|  56.0k|                  (void)container;
 2611|  56.0k|                  return false;
 2612|  56.0k|               }
 2613|  56.0k|            }
 2614|       |
 2615|  56.0k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|  56.0k|            inline void append(V& container, value_type&& element) noexcept
 2618|  56.0k|            {
 2619|  56.0k|               if constexpr (emplace_backable<V>) {
 2620|  56.0k|                  container.emplace_back(std::move(element));
 2621|  56.0k|               }
 2622|  56.0k|               else if constexpr (emplaceable<V>) {
 2623|  56.0k|                  container.emplace(std::move(element));
 2624|  56.0k|               }
 2625|  56.0k|            }
 2626|  56.0k|         };
 2627|       |
 2628|  56.0k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 56.0k]
  |  Branch (2628:27): [True: 0, False: 56.0k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|  56.0k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|  56.0k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|  56.0k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|  56.0k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 4, False: 56.0k]
  ------------------
 2641|      4|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|  56.0k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 55.5k, False: 531]
  |  Branch (2644:27): [True: 7.61k, False: 47.9k]
  ------------------
 2645|  7.61k|            ++it;
 2646|  7.61k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  7.61k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 7, False: 7.61k]
  ------------------
 2648|      7|               return;
 2649|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|       |               if (ctx.current_indent() < 0) {
 2651|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|       |               }
 2653|       |            }
 2654|  7.61k|            return;
 2655|  7.61k|         }
 2656|       |
 2657|  48.4k|         bool just_saw_comma = false;
 2658|  48.4k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  48.4k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|  80.7k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 80.1k, False: 641]
  ------------------
 2663|  80.1k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|  80.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 80.1k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|  80.1k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 80.1k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|  80.1k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 5.66k, False: 74.4k]
  ------------------
 2673|  5.66k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 5.66k, False: 0]
  ------------------
 2674|  5.66k|                     ++it;
 2675|  5.66k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  5.66k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 4, False: 5.65k]
  ------------------
 2677|      4|                        return;
 2678|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|       |                        if (ctx.current_indent() < 0) {
 2680|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|       |                        }
 2682|       |                     }
 2683|  5.65k|                     return;
 2684|  5.66k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  5.66k|               }
 2688|       |
 2689|  74.4k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 183, False: 74.2k]
  |  Branch (2689:34): [True: 9, False: 74.2k]
  ------------------
 2690|    192|                  ctx.error = error_code::syntax_error;
 2691|    192|                  return;
 2692|    192|               }
 2693|  74.2k|               just_saw_comma = false;
 2694|       |
 2695|  74.2k|               value_type element{};
 2696|  74.2k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|  74.2k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 7.70k, False: 66.5k]
  ------------------
 2699|  7.70k|                  return;
 2700|       |
 2701|  66.5k|               bool saw_line_break_before_separator = false;
 2702|  66.5k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|  66.5k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 10, False: 66.5k]
  ------------------
 2704|     10|                  return;
 2705|       |
 2706|  66.5k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 65.1k, False: 1.39k]
  |  Branch (2706:33): [True: 11.3k, False: 53.7k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  11.3k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 26, False: 11.3k]
  ------------------
 2709|     26|                     ctx.error = error_code::syntax_error;
 2710|     26|                     return;
 2711|     26|                  }
 2712|  11.3k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  11.3k|                     glz::generic key_node = std::move(element);
 2714|  11.3k|                     ++it;
 2715|  11.3k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  11.3k|                     glz::generic mapped{};
 2718|  11.3k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  11.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 510, False: 10.8k]
  ------------------
 2720|    510|                        return;
 2721|       |
 2722|  10.8k|                     std::string key;
 2723|  10.8k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 2, False: 10.8k]
  ------------------
 2724|      2|                        return;
 2725|       |
 2726|  10.8k|                     glz::generic pair{};
 2727|  10.8k|                     pair[key] = std::move(mapped);
 2728|  10.8k|                     element = std::move(pair);
 2729|       |
 2730|  10.8k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  10.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 1, False: 10.8k]
  ------------------
 2732|      1|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  11.3k|               }
 2739|       |
 2740|  66.5k|               adapter.append(value, std::move(element));
 2741|       |
 2742|  66.5k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 1.46k, False: 65.0k]
  ------------------
 2743|  1.46k|                  ctx.error = error_code::unexpected_end;
 2744|  1.46k|                  return;
 2745|  1.46k|               }
 2746|       |
 2747|  65.0k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 31.6k, False: 33.4k]
  ------------------
 2748|  31.6k|                  ++it;
 2749|  31.6k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  31.6k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 25, False: 31.6k]
  ------------------
 2751|     25|                     return;
 2752|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|       |                     if (ctx.current_indent() < 0) {
 2754|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|       |                     }
 2756|       |                  }
 2757|  31.6k|                  return;
 2758|  31.6k|               }
 2759|  33.4k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 32.3k, False: 1.10k]
  ------------------
 2760|  32.3k|                  ++it;
 2761|  32.3k|                  just_saw_comma = true;
 2762|  32.3k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  32.3k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 5, False: 32.3k]
  ------------------
 2764|      5|                     return;
 2765|  32.3k|               }
 2766|  1.10k|               else {
 2767|  1.10k|                  ctx.error = error_code::syntax_error;
 2768|  1.10k|                  return;
 2769|  1.10k|               }
 2770|  65.0k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  48.4k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|   395k|      {
 2581|   395k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|   395k|            if constexpr (!check_append_arrays(Opts)) {
 2584|   395k|               value.clear();
 2585|   395k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|   395k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|  66.0k|            {
 2619|  66.0k|               if constexpr (emplace_backable<V>) {
 2620|  66.0k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|  66.0k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|   339k|      {
 3082|   339k|         using V = std::remove_cvref_t<T>;
 3083|   339k|         using value_type = typename V::value_type;
 3084|       |
 3085|   339k|         struct sequence_container_adapter
 3086|   339k|         {
 3087|   339k|            size_t index = 0;
 3088|       |
 3089|   339k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|   339k|            {
 3091|   339k|               if constexpr (!resizable<V>) {
 3092|   339k|                  return index >= container.size();
 3093|   339k|               }
 3094|   339k|               else {
 3095|   339k|                  (void)container;
 3096|   339k|                  return false;
 3097|   339k|               }
 3098|   339k|            }
 3099|       |
 3100|   339k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|   339k|            inline void append(V& container, value_type&& element) noexcept
 3103|   339k|            {
 3104|   339k|               if constexpr (emplace_backable<V>) {
 3105|   339k|                  container.emplace_back(std::move(element));
 3106|   339k|               }
 3107|   339k|               else if constexpr (emplaceable<V>) {
 3108|   339k|                  container.emplace(std::move(element));
 3109|   339k|               }
 3110|   339k|            }
 3111|   339k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|   339k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|   339k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|   339k|         bool first_item = true;
 3122|   339k|         bool has_pending_item_anchor = false;
 3123|   339k|         std::string pending_item_anchor_name{};
 3124|   339k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|   708k|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 557k, False: 151k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|   557k|            int32_t line_indent = 0;
 3137|   557k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|   557k|            auto line_start = it;
 3139|       |
 3140|   721k|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 713k, False: 7.70k]
  ------------------
 3141|   713k|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 10.2k, False: 703k]
  ------------------
 3142|  10.2k|                  skip_comment(it, end);
 3143|  10.2k|                  skip_newline(it, end);
 3144|  10.2k|                  line_start = it;
 3145|  10.2k|                  line_indent = 0;
 3146|  10.2k|               }
 3147|   703k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 26.8k, False: 676k]
  |  Branch (3147:40): [True: 83.0k, False: 593k]
  ------------------
 3148|   109k|                  skip_newline(it, end);
 3149|   109k|                  line_start = it;
 3150|   109k|                  line_indent = 0;
 3151|   109k|               }
 3152|   593k|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 87.5k, False: 505k]
  ------------------
 3153|  87.5k|                  line_start = it;
 3154|  87.5k|                  line_indent = 0;
 3155|   308k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 307k, False: 1.16k]
  |  Branch (3155:39): [True: 221k, False: 86.3k]
  ------------------
 3156|   221k|                     ++line_indent;
 3157|   221k|                     ++it;
 3158|   221k|                  }
 3159|       |
 3160|  87.5k|                  bool saw_tab = false;
 3161|  95.7k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 93.9k, False: 1.81k]
  |  Branch (3161:40): [True: 4.14k, False: 89.8k]
  |  Branch (3161:54): [True: 4.06k, False: 85.7k]
  ------------------
 3162|  8.20k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 6.34k, False: 1.86k]
  |  Branch (3162:43): [True: 1.86k, False: 0]
  ------------------
 3163|  8.20k|                     ++it;
 3164|  8.20k|                  }
 3165|       |
 3166|  87.5k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 1.81k, False: 85.7k]
  |  Branch (3166:36): [True: 2.77k, False: 82.9k]
  |  Branch (3166:51): [True: 28.2k, False: 54.6k]
  |  Branch (3166:66): [True: 2.66k, False: 52.0k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|  35.5k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 33.7k, False: 1.81k]
  |  Branch (3168:39): [True: 2.66k, False: 31.0k]
  ------------------
 3169|  2.66k|                        skip_comment(it, end);
 3170|  2.66k|                     }
 3171|  35.5k|                     line_indent = 0;
 3172|  35.5k|                     continue;
 3173|  35.5k|                  }
 3174|       |
 3175|  52.0k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 9, False: 52.0k]
  ------------------
 3176|      9|                     ctx.error = error_code::syntax_error;
 3177|      9|                     return;
 3178|      9|                  }
 3179|  52.0k|                  break; // Found content
 3180|  52.0k|               }
 3181|   505k|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 8.12k, False: 497k]
  ------------------
 3182|  8.12k|                  line_start = it;
 3183|  17.7k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 17.1k, False: 600]
  |  Branch (3183:40): [True: 826, False: 16.3k]
  |  Branch (3183:54): [True: 8.81k, False: 7.52k]
  ------------------
 3184|  8.12k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 600, False: 7.52k]
  |  Branch (3184:36): [True: 289, False: 7.23k]
  |  Branch (3184:51): [True: 3.31k, False: 3.92k]
  |  Branch (3184:66): [True: 3.91k, False: 9]
  ------------------
 3185|  8.11k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 7.51k, False: 600]
  |  Branch (3185:39): [True: 3.91k, False: 3.60k]
  ------------------
 3186|  3.91k|                        skip_comment(it, end);
 3187|  3.91k|                     }
 3188|  8.11k|                     line_indent = 0;
 3189|  8.11k|                     continue;
 3190|  8.11k|                  }
 3191|      9|                  ctx.error = error_code::syntax_error;
 3192|      9|                  return;
 3193|  8.12k|               }
 3194|   497k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|   497k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 339k, False: 158k]
  |  Branch (3198:37): [True: 338k, False: 439]
  ------------------
 3199|   338k|                     line_indent = sequence_indent;
 3200|   338k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|   338k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 338k, False: 0]
  |  Branch (3201:49): [True: 338k, False: 0]
  ------------------
 3202|   338k|                           auto probe = it;
 3203|   338k|                           int32_t leading_ws = 0;
 3204|   338k|                           bool saw_tab = false;
 3205|   643k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 643k, False: 0]
  |  Branch (3205:64): [True: 299k, False: 344k]
  |  Branch (3205:87): [True: 5.73k, False: 338k]
  ------------------
 3206|   304k|                              --probe;
 3207|   304k|                              ++leading_ws;
 3208|   304k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 2.63k, False: 302k]
  |  Branch (3208:52): [True: 3.50k, False: 298k]
  ------------------
 3209|   304k|                           }
 3210|   338k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 0, False: 338k]
  |  Branch (3210:61): [True: 5.30k, False: 333k]
  |  Branch (3210:85): [True: 61.5k, False: 271k]
  ------------------
 3211|  66.8k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 3, False: 66.8k]
  ------------------
 3212|      3|                                 ctx.error = error_code::syntax_error;
 3213|      3|                                 return;
 3214|      3|                              }
 3215|  66.8k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|  66.8k|                           }
 3217|   338k|                        }
 3218|   338k|                     }
 3219|   338k|                  }
 3220|   338k|                  break;
 3221|   497k|               }
 3222|   713k|            }
 3223|       |
 3224|   557k|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 7.70k, False: 549k]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|   549k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 2.09k, False: 547k]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|   547k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 18.2k, False: 529k]
  ------------------
 3231|  18.2k|               it = line_start;
 3232|  18.2k|               return;
 3233|  18.2k|            }
 3234|       |
 3235|   529k|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 4.20k, False: 524k]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  4.20k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 7, False: 4.19k]
  ------------------
 3240|      7|                  ctx.error = error_code::syntax_error;
 3241|      7|                  return;
 3242|      7|               }
 3243|       |
 3244|  4.19k|               ++it;
 3245|  4.19k|               auto pending_name = parse_anchor_name(it, end);
 3246|  4.19k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 7, False: 4.19k]
  ------------------
 3247|      7|                  ctx.error = error_code::syntax_error;
 3248|      7|                  return;
 3249|      7|               }
 3250|  4.19k|               skip_inline_ws(it, end);
 3251|  4.19k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 4.16k, False: 32]
  |  Branch (3251:33): [True: 2.15k, False: 2.00k]
  ------------------
 3252|  2.15k|                  skip_comment(it, end);
 3253|  2.15k|               }
 3254|       |
 3255|  4.19k|               has_pending_item_anchor = true;
 3256|  4.19k|               pending_item_anchor_name = std::string(pending_name);
 3257|  4.19k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  4.19k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 40, False: 4.15k]
  |  Branch (3259:34): [True: 2.58k, False: 1.56k]
  |  Branch (3259:49): [True: 31, False: 2.55k]
  ------------------
 3260|     71|                  ctx.error = error_code::syntax_error;
 3261|     71|                  return;
 3262|     71|               }
 3263|       |
 3264|  4.12k|               skip_newline(it, end);
 3265|  4.12k|               continue;
 3266|  4.19k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|   524k|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 150k, False: 374k]
  ------------------
 3270|   150k|               it = line_start;
 3271|   150k|               return;
 3272|   150k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|   374k|            dash_col = line_indent;
 3278|   374k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   374k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 374k, False: 3]
  ------------------
 3280|   374k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|   374k|               }
 3282|   374k|            }
 3283|       |
 3284|   374k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|   374k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 372k, False: 2.50k]
  |  Branch (3287:30): [True: 8.80k, False: 363k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  8.80k|               it = line_start;
 3290|  8.80k|               return;
 3291|  8.80k|            }
 3292|       |
 3293|   365k|            bool saw_tab_after_dash = false;
 3294|  2.31M|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 2.31M, False: 5.16k]
  |  Branch (3294:34): [True: 1.77M, False: 536k]
  |  Branch (3294:48): [True: 176k, False: 360k]
  ------------------
 3295|  1.95M|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 1.36M, False: 584k]
  |  Branch (3295:59): [True: 136k, False: 448k]
  ------------------
 3296|  1.95M|               ++it;
 3297|  1.95M|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|   365k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 136k, False: 229k]
  |  Branch (3299:39): [True: 134k, False: 1.79k]
  |  Branch (3299:52): [True: 14.9k, False: 119k]
  ------------------
 3300|  14.9k|               const auto after_dash = it + 1;
 3301|  14.9k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 2, False: 14.9k]
  |  Branch (3301:41): [True: 2, False: 14.9k]
  ------------------
 3302|      4|                  ctx.error = error_code::syntax_error;
 3303|      4|                  return;
 3304|      4|               }
 3305|  14.9k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|   365k|            auto parse_element = [&](auto& element) {
 3309|   365k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|   365k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   365k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|   365k|                     return;
 3319|   365k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   365k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   365k|                  ctx.sequence_item_value_context = true;
 3322|   365k|                  ctx.sequence_dash_indent = dash_col;
 3323|   365k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   365k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   365k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   365k|                  ctx.pop_indent();
 3327|   365k|               }
 3328|   365k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   365k|                  skip_ws_and_comment(it, end);
 3331|   365k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   365k|                  auto nested_start = it;
 3335|   365k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   365k|                  if (bool(ctx.error)) [[unlikely]]
 3337|   365k|                     return;
 3338|   365k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   365k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|   365k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|   365k|                     const int32_t element_indent =
 3350|   365k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|   365k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|   365k|                        return;
 3353|   365k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|   365k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|   365k|                     ctx.sequence_item_value_context = true;
 3356|   365k|                     ctx.sequence_dash_indent = dash_col;
 3357|   365k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|   365k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|   365k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|   365k|                     ctx.pop_indent();
 3361|   365k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   365k|               }
 3364|       |
 3365|   365k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|   365k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|   365k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|   365k|                                                                      pending_item_anchor_indent};
 3369|   365k|                  has_pending_item_anchor = false;
 3370|   365k|               }
 3371|   365k|            };
 3372|       |
 3373|   365k|            if constexpr (emplace_backable<V>) {
 3374|   365k|               auto& element = value.emplace_back();
 3375|   365k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|   365k|            first_item = false;
 3394|       |
 3395|   365k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 282, False: 365k]
  ------------------
 3396|    282|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|   365k|         }
 3401|   339k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|   365k|            auto parse_element = [&](auto& element) {
 3309|   365k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 360k, False: 5.15k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|   365k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 360k, False: 5.15k]
  |  Branch (3312:33): [True: 239k, False: 121k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   239k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 239k]
  ------------------
 3318|      0|                     return;
 3319|   239k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   239k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   239k|                  ctx.sequence_item_value_context = true;
 3322|   239k|                  ctx.sequence_dash_indent = dash_col;
 3323|   239k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   239k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   239k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   239k|                  ctx.pop_indent();
 3327|   239k|               }
 3328|   126k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   126k|                  skip_ws_and_comment(it, end);
 3331|   126k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   126k|                  auto nested_start = it;
 3335|   126k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   126k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 4, False: 126k]
  ------------------
 3337|      4|                     return;
 3338|   126k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   126k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 66.6k, False: 59.6k]
  ------------------
 3344|   126k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 49.6k, False: 76.7k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  49.6k|                     const int32_t element_indent =
 3350|  49.6k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 49.6k]
  ------------------
 3351|  49.6k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 49.6k]
  ------------------
 3352|      0|                        return;
 3353|  49.6k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  49.6k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  49.6k|                     ctx.sequence_item_value_context = true;
 3356|  49.6k|                     ctx.sequence_dash_indent = dash_col;
 3357|  49.6k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  49.6k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  49.6k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  49.6k|                     ctx.pop_indent();
 3361|  49.6k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   126k|               }
 3364|       |
 3365|   365k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 795, False: 364k]
  |  Branch (3365:47): [True: 754, False: 41]
  ------------------
 3366|    754|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 671, False: 83]
  ------------------
 3367|    754|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|    754|                                                                      pending_item_anchor_indent};
 3369|    754|                  has_pending_item_anchor = false;
 3370|    754|               }
 3371|   365k|            };
_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_:
 5423|   714k|   {
 5424|   714k|      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|   714k|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|   714k|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|   714k|            int depth = 0;
 5432|   714k|            while (pos != stop) {
 5433|   714k|               const char c = *pos;
 5434|   714k|               if (c == '"' || c == '\'') {
 5435|   714k|                  const char quote = c;
 5436|   714k|                  ++pos;
 5437|   714k|                  while (pos != stop && *pos != quote) {
 5438|   714k|                     if (*pos == '\\' && quote == '"') {
 5439|   714k|                        ++pos;
 5440|   714k|                        if (pos != stop) ++pos;
 5441|   714k|                     }
 5442|   714k|                     else {
 5443|   714k|                        ++pos;
 5444|   714k|                     }
 5445|   714k|                  }
 5446|   714k|                  if (pos != stop) ++pos;
 5447|   714k|                  continue;
 5448|   714k|               }
 5449|   714k|               if (c == '[' || c == '{') {
 5450|   714k|                  ++depth;
 5451|   714k|                  ++pos;
 5452|   714k|                  continue;
 5453|   714k|               }
 5454|   714k|               if (c == ']' || c == '}') {
 5455|   714k|                  if (depth == 0) return false;
 5456|   714k|                  --depth;
 5457|   714k|                  ++pos;
 5458|   714k|                  continue;
 5459|   714k|               }
 5460|   714k|               if (c == ',' && depth == 0) return false;
 5461|   714k|               if (c == ':' && depth == 0) {
 5462|   714k|                  auto next = pos + 1;
 5463|   714k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|   714k|               }
 5465|   714k|               ++pos;
 5466|   714k|            }
 5467|   714k|            return false;
 5468|   714k|         };
 5469|       |
 5470|   714k|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5470:14): [True: 194k, False: 519k]
  |  Branch (5470:49): [True: 12.0k, False: 507k]
  ------------------
 5471|   206k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5471:17): [True: 184k, False: 22.6k]
  ------------------
 5472|   184k|               return;
 5473|   184k|            }
 5474|  22.6k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5474:17): [True: 2.90k, False: 19.7k]
  ------------------
 5475|  2.90k|               return;
 5476|  2.90k|            }
 5477|  22.6k|         }
 5478|       |
 5479|   526k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|   526k|         return;
 5481|   714k|      }
 5482|       |
 5483|   714k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 0, False: 714k]
  ------------------
 5484|      0|         return;
 5485|      0|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|   714k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 0, False: 714k]
  ------------------
 5488|      0|         return;
 5489|      0|      }
 5490|   714k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|   714k|   }
_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_:
 5427|   714k|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|   714k|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|   714k|            int depth = 0;
 5432|  32.9M|            while (pos != stop) {
  ------------------
  |  Branch (5432:20): [True: 32.7M, False: 215k]
  ------------------
 5433|  32.7M|               const char c = *pos;
 5434|  32.7M|               if (c == '"' || c == '\'') {
  ------------------
  |  Branch (5434:20): [True: 120k, False: 32.6M]
  |  Branch (5434:32): [True: 112k, False: 32.5M]
  ------------------
 5435|   232k|                  const char quote = c;
 5436|   232k|                  ++pos;
 5437|  24.5M|                  while (pos != stop && *pos != quote) {
  ------------------
  |  Branch (5437:26): [True: 24.4M, False: 91.6k]
  |  Branch (5437:41): [True: 24.2M, False: 141k]
  ------------------
 5438|  24.2M|                     if (*pos == '\\' && quote == '"') {
  ------------------
  |  Branch (5438:26): [True: 85.9k, False: 24.2M]
  |  Branch (5438:42): [True: 59.3k, False: 26.5k]
  ------------------
 5439|  59.3k|                        ++pos;
 5440|  59.3k|                        if (pos != stop) ++pos;
  ------------------
  |  Branch (5440:29): [True: 54.4k, False: 4.88k]
  ------------------
 5441|  59.3k|                     }
 5442|  24.2M|                     else {
 5443|  24.2M|                        ++pos;
 5444|  24.2M|                     }
 5445|  24.2M|                  }
 5446|   232k|                  if (pos != stop) ++pos;
  ------------------
  |  Branch (5446:23): [True: 141k, False: 91.6k]
  ------------------
 5447|   232k|                  continue;
 5448|   232k|               }
 5449|  32.5M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5449:20): [True: 1.13M, False: 31.3M]
  |  Branch (5449:32): [True: 241k, False: 31.1M]
  ------------------
 5450|  1.37M|                  ++depth;
 5451|  1.37M|                  ++pos;
 5452|  1.37M|                  continue;
 5453|  1.37M|               }
 5454|  31.1M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5454:20): [True: 40.6k, False: 31.1M]
  |  Branch (5454:32): [True: 82.2k, False: 31.0M]
  ------------------
 5455|   122k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5455:23): [True: 43.6k, False: 79.2k]
  ------------------
 5456|  79.2k|                  --depth;
 5457|  79.2k|                  ++pos;
 5458|  79.2k|                  continue;
 5459|   122k|               }
 5460|  31.0M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5460:20): [True: 1.17M, False: 29.8M]
  |  Branch (5460:32): [True: 196k, False: 981k]
  ------------------
 5461|  30.8M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5461:20): [True: 595k, False: 30.2M]
  |  Branch (5461:32): [True: 258k, False: 337k]
  ------------------
 5462|   258k|                  auto next = pos + 1;
 5463|   258k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5463:26): [True: 7.56k, False: 251k]
  |  Branch (5463:41): [True: 106k, False: 144k]
  |  Branch (5463:57): [True: 27.8k, False: 116k]
  |  Branch (5463:74): [True: 18.3k, False: 98.4k]
  |  Branch (5463:91): [True: 34.6k, False: 63.7k]
  ------------------
 5464|   258k|               }
 5465|  30.5M|               ++pos;
 5466|  30.5M|            }
 5467|   215k|            return false;
 5468|   714k|         };
_ZN3glz26line_could_be_flow_mappingIPKcS2_EEbT_T0_:
 5293|  6.38M|   {
 5294|  6.38M|      const auto stop = yaml::implicit_key_scan_end(it, end);
 5295|  6.38M|      int flow_depth = 0;
 5296|  6.38M|      bool prev_was_whitespace = true;
 5297|  6.38M|      bool key_supports_adjacent_value = false;
 5298|       |
 5299|   140M|      while (it != stop) {
  ------------------
  |  Branch (5299:14): [True: 139M, False: 453k]
  ------------------
 5300|   139M|         const char c = *it;
 5301|   139M|         if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (5301:14): [True: 1.37M, False: 138M]
  |  Branch (5301:27): [True: 955k, False: 137M]
  ------------------
 5302|  2.33M|            return false;
 5303|  2.33M|         }
 5304|   137M|         if (flow_depth == 0 && (c == ',' || c == ']' || c == '}')) {
  ------------------
  |  Branch (5304:14): [True: 117M, False: 19.7M]
  |  Branch (5304:34): [True: 1.30M, False: 116M]
  |  Branch (5304:46): [True: 111k, False: 116M]
  |  Branch (5304:58): [True: 183k, False: 116M]
  ------------------
 5305|  1.59M|            return false;
 5306|  1.59M|         }
 5307|   135M|         if (c == '#' && flow_depth == 0 && prev_was_whitespace) {
  ------------------
  |  Branch (5307:14): [True: 1.08M, False: 134M]
  |  Branch (5307:26): [True: 741k, False: 347k]
  |  Branch (5307:45): [True: 19.8k, False: 721k]
  ------------------
 5308|  19.8k|            return false;
 5309|  19.8k|         }
 5310|   135M|         if ((c == '"' || c == '\'') && prev_was_whitespace) {
  ------------------
  |  Branch (5310:15): [True: 341k, False: 135M]
  |  Branch (5310:27): [True: 629k, False: 134M]
  |  Branch (5310:41): [True: 98.2k, False: 872k]
  ------------------
 5311|  98.2k|            const char quote = c;
 5312|  98.2k|            ++it;
 5313|  1.33M|            while (it != stop && *it != quote) {
  ------------------
  |  Branch (5313:20): [True: 1.33M, False: 2.54k]
  |  Branch (5313:34): [True: 1.31M, False: 23.4k]
  ------------------
 5314|  1.31M|               if (*it == '\\' && quote == '"') {
  ------------------
  |  Branch (5314:20): [True: 20.0k, False: 1.29M]
  |  Branch (5314:35): [True: 17.8k, False: 2.24k]
  ------------------
 5315|  17.8k|                  ++it;
 5316|  17.8k|                  if (it != stop) ++it;
  ------------------
  |  Branch (5316:23): [True: 17.4k, False: 422]
  ------------------
 5317|  17.8k|               }
 5318|  1.29M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (5318:25): [True: 54.4k, False: 1.23M]
  |  Branch (5318:40): [True: 17.8k, False: 1.22M]
  ------------------
 5319|  72.3k|                  return false;
 5320|  72.3k|               }
 5321|  1.22M|               else {
 5322|  1.22M|                  ++it;
 5323|  1.22M|               }
 5324|  1.31M|            }
 5325|  25.9k|            if (it != stop) ++it;
  ------------------
  |  Branch (5325:17): [True: 23.4k, False: 2.54k]
  ------------------
 5326|  25.9k|            key_supports_adjacent_value = true;
 5327|  25.9k|            prev_was_whitespace = false;
 5328|  25.9k|            continue;
 5329|  98.2k|         }
 5330|   135M|         if (c == '[' || c == '{') {
  ------------------
  |  Branch (5330:14): [True: 4.67M, False: 131M]
  |  Branch (5330:26): [True: 450k, False: 130M]
  ------------------
 5331|  5.12M|            ++flow_depth;
 5332|  5.12M|            key_supports_adjacent_value = false;
 5333|  5.12M|            prev_was_whitespace = false;
 5334|  5.12M|            ++it;
 5335|  5.12M|            continue;
 5336|  5.12M|         }
 5337|   130M|         if (c == ']' || c == '}') {
  ------------------
  |  Branch (5337:14): [True: 58.1k, False: 130M]
  |  Branch (5337:26): [True: 80.3k, False: 130M]
  ------------------
 5338|   138k|            if (flow_depth > 0) {
  ------------------
  |  Branch (5338:17): [True: 138k, False: 0]
  ------------------
 5339|   138k|               --flow_depth;
 5340|   138k|               if (flow_depth == 0) {
  ------------------
  |  Branch (5340:20): [True: 63.5k, False: 74.9k]
  ------------------
 5341|  63.5k|                  key_supports_adjacent_value = true;
 5342|  63.5k|               }
 5343|   138k|               prev_was_whitespace = false;
 5344|   138k|               ++it;
 5345|   138k|               continue;
 5346|   138k|            }
 5347|      0|            return false;
 5348|   138k|         }
 5349|   130M|         if (c == ':' && flow_depth == 0) {
  ------------------
  |  Branch (5349:14): [True: 2.17M, False: 128M]
  |  Branch (5349:26): [True: 1.91M, False: 260k]
  ------------------
 5350|  1.91M|            const auto next = it + 1;
 5351|  1.91M|            if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (5351:17): [True: 35.5k, False: 1.87M]
  |  Branch (5351:32): [True: 875k, False: 999k]
  |  Branch (5351:48): [True: 146k, False: 852k]
  |  Branch (5351:65): [True: 139k, False: 713k]
  |  Branch (5351:82): [True: 285k, False: 427k]
  ------------------
 5352|  1.48M|               return true;
 5353|  1.48M|            }
 5354|   427k|            if (key_supports_adjacent_value) {
  ------------------
  |  Branch (5354:17): [True: 25.2k, False: 402k]
  ------------------
 5355|  25.2k|               return true;
 5356|  25.2k|            }
 5357|   402k|            return false;
 5358|   427k|         }
 5359|       |
 5360|   128M|         key_supports_adjacent_value = false;
 5361|   128M|         prev_was_whitespace = (c == ' ' || c == '\t');
  ------------------
  |  Branch (5361:33): [True: 14.6M, False: 113M]
  |  Branch (5361:45): [True: 2.06M, False: 111M]
  ------------------
 5362|   128M|         ++it;
 5363|   128M|      }
 5364|       |
 5365|   453k|      return false;
 5366|  6.38M|   }
_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_:
 5848|  58.2k|            auto is_word_boundary = [&](const auto ptr) {
 5849|  58.2k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 3.56k, False: 54.7k]
  ------------------
 5850|  3.56k|                  return true;
 5851|  3.56k|               }
 5852|  54.7k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 41.1k, False: 13.5k]
  ------------------
 5853|  41.1k|                  auto next = ptr + 1;
 5854|  41.1k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 646, False: 40.4k]
  |  Branch (5854:43): [True: 1.04k, False: 39.4k]
  |  Branch (5854:59): [True: 13.4k, False: 26.0k]
  |  Branch (5854:76): [True: 2.36k, False: 23.6k]
  |  Branch (5854:93): [True: 12.4k, False: 11.1k]
  ------------------
 5855|  41.1k|               }
 5856|  13.5k|               return is_plain_scalar_boundary(*ptr);
 5857|  54.7k|            };
_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:
 5774|  13.5k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  13.5k|               switch (ch) {
 5776|    682|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 682, False: 12.9k]
  ------------------
 5777|  1.34k|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 660, False: 12.9k]
  ------------------
 5778|  6.38k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 5.04k, False: 8.53k]
  ------------------
 5779|  7.23k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 850, False: 12.7k]
  ------------------
 5780|  7.91k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 677, False: 12.9k]
  ------------------
 5781|  8.35k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 441, False: 13.1k]
  ------------------
 5782|  8.83k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 482, False: 13.1k]
  ------------------
 5783|  8.83k|                  return true;
 5784|  4.74k|               default:
  ------------------
  |  Branch (5784:16): [True: 4.74k, False: 8.83k]
  ------------------
 5785|  4.74k|                  return false;
 5786|  13.5k|               }
 5787|  13.5k|            };
_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_:
 5789|  42.3k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  42.3k|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  42.3k|                  return false;
 5792|  42.3k|               }
 5793|  42.3k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 0, False: 42.3k]
  ------------------
 5794|      0|                  return false;
 5795|      0|               }
 5796|  42.3k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 42.3k, False: 0]
  |  Branch (5796:40): [True: 0, False: 0]
  |  Branch (5796:61): [True: 0, False: 0]
  ------------------
 5797|      0|                  return false;
 5798|      0|               }
 5799|       |
 5800|  42.3k|               auto look = word_end;
 5801|  42.3k|               yaml::skip_newline(look, end);
 5802|  42.3k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 0, False: 42.3k]
  ------------------
 5803|      0|                  int32_t line_indent = 0;
 5804|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 0, False: 0]
  |  Branch (5804:41): [True: 0, False: 0]
  ------------------
 5805|      0|                     ++line_indent;
 5806|      0|                     ++look;
 5807|      0|                  }
 5808|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 0, False: 0]
  |  Branch (5808:38): [True: 0, False: 0]
  ------------------
 5809|      0|                     return false;
 5810|      0|                  }
 5811|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 0, False: 0]
  |  Branch (5811:38): [True: 0, False: 0]
  |  Branch (5811:55): [True: 0, False: 0]
  ------------------
 5812|      0|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 0, False: 0]
  ------------------
 5813|      0|                        yaml::skip_newline(look, end);
 5814|      0|                        continue;
 5815|      0|                     }
 5816|      0|                     return false;
 5817|      0|                  }
 5818|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 0, False: 0]
  ------------------
 5819|      0|                     yaml::skip_comment(look, end);
 5820|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 0, False: 0]
  |  Branch (5820:42): [True: 0, False: 0]
  |  Branch (5820:59): [True: 0, False: 0]
  ------------------
 5821|      0|                        yaml::skip_newline(look, end);
 5822|      0|                        continue;
 5823|      0|                     }
 5824|      0|                     return false;
 5825|      0|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|      0|                  {
 5831|      0|                     auto scan = look;
 5832|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 0, False: 0]
  |  Branch (5832:44): [True: 0, False: 0]
  |  Branch (5832:61): [True: 0, False: 0]
  ------------------
 5833|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 0, False: 0]
  ------------------
 5834|      0|                           auto after_colon = scan + 1;
 5835|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 0, False: 0]
  |  Branch (5835:54): [True: 0, False: 0]
  |  Branch (5835:77): [True: 0, False: 0]
  ------------------
 5836|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 0, False: 0]
  |  Branch (5836:56): [True: 0, False: 0]
  ------------------
 5837|      0|                              return false;
 5838|      0|                           }
 5839|      0|                        }
 5840|      0|                        ++scan;
 5841|      0|                     }
 5842|      0|                  }
 5843|       |
 5844|      0|                  return line_indent > ctx.current_indent();
 5845|      0|               }
 5846|  42.3k|               return false;
 5847|  42.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_4optsELj450ELb0ELb0ELb1ELb1ELb0ELb0ELb0ELb0ELj1EEERSH_RNS_4yaml12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5377|   321k|   {
 5378|   321k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   321k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   321k|         const bool could_be_mapping = [&] {
 5386|   321k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   321k|               return line_could_be_flow_mapping(it, end);
 5388|   321k|            }
 5389|   321k|            else {
 5390|   321k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   321k|            }
 5392|   321k|         }();
 5393|   321k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 124k, False: 196k]
  ------------------
 5394|   124k|            return false;
 5395|   124k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   196k|         auto temp_ctx = ctx.make_speculative();
 5398|   196k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   196k|                                                                                               end);
 5400|   196k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   196k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   196k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 191k, False: 5.47k]
  ------------------
 5403|   191k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   191k|            return true;
 5405|   191k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  5.47k|         ctx.error = temp_ctx.error;
 5410|  5.47k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  5.47k|         return false;
 5412|   196k|      }
 5413|   321k|   }
_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:
 5385|   321k|         const bool could_be_mapping = [&] {
 5386|   321k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   321k|               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|       |            else {
 5390|       |               return yaml::line_could_be_block_mapping(it, end);
 5391|       |            }
 5392|   321k|         }();
_ZN3glz4yaml15materialize_keyILb1ENS0_12yaml_contextEEEbRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERT0_:
   38|  3.26M|   {
   39|  3.26M|      if constexpr (empty_on_null) {
   40|  3.26M|         if (key_node.is_null()) {
  ------------------
  |  Branch (40:14): [True: 145k, False: 3.12M]
  ------------------
   41|   145k|            key.clear();
   42|   145k|            return true;
   43|   145k|         }
   44|  3.26M|      }
   45|  3.26M|      if (auto* s = key_node.template get_if<std::string>()) {
  ------------------
  |  Branch (45:17): [True: 730k, False: 2.53M]
  ------------------
   46|   730k|         key = *s;
   47|   730k|         return true;
   48|   730k|      }
   49|  2.53M|      key.clear();
   50|  2.53M|      (void)glz::write_json(key_node, key);
   51|  2.53M|      if constexpr (requires { ctx.charge_key_expansion(size_t{}); }) {
   52|  2.53M|         if (!ctx.charge_key_expansion(key.size())) [[unlikely]] {
  ------------------
  |  Branch (52:14): [True: 362, False: 2.53M]
  ------------------
   53|    362|            ctx.error = error_code::exceeded_max_expansion;
   54|    362|            ctx.custom_error_message = "complex key expansion";
   55|    362|            return false;
   56|    362|         }
   57|  2.53M|      }
   58|  2.53M|      return true;
   59|  3.26M|   }
_ZN3glz4yaml14parse_yaml_keyINS0_12yaml_contextEPKcS4_EEbRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_b:
 1524|  31.6M|      {
 1525|  31.6M|         key.clear();
 1526|  31.6M|         skip_inline_ws(it, end);
 1527|       |
 1528|  31.6M|         if (it == end) {
  ------------------
  |  Branch (1528:14): [True: 76, False: 31.6M]
  ------------------
 1529|     76|            ctx.error = error_code::unexpected_end;
 1530|     76|            return false;
 1531|     76|         }
 1532|       |
 1533|  31.6M|         auto validate_key_tag = [&](const yaml_tag tag) {
 1534|  31.6M|            if (tag == yaml_tag::unknown) {
 1535|  31.6M|               ctx.error = error_code::syntax_error;
 1536|  31.6M|               return false;
 1537|  31.6M|            }
 1538|  31.6M|            if (!tag_valid_for_string(tag)) {
 1539|  31.6M|               ctx.error = error_code::syntax_error;
 1540|  31.6M|               return false;
 1541|  31.6M|            }
 1542|  31.6M|            return true;
 1543|  31.6M|         };
 1544|       |
 1545|       |         // Tags on keys (e.g. "!!str : value")
 1546|  31.6M|         auto key_tag = parse_yaml_tag(it, end, ctx);
 1547|  31.6M|         if (!validate_key_tag(key_tag)) {
  ------------------
  |  Branch (1547:14): [True: 90, False: 31.6M]
  ------------------
 1548|     90|            return false;
 1549|     90|         }
 1550|  31.6M|         skip_inline_ws(it, end);
 1551|  31.6M|         if (it == end) {
  ------------------
  |  Branch (1551:14): [True: 92, False: 31.6M]
  ------------------
 1552|     92|            ctx.error = error_code::unexpected_end;
 1553|     92|            return false;
 1554|     92|         }
 1555|       |
 1556|       |         // Handle alias as key (*name resolves to anchor value)
 1557|  31.6M|         if (*it == '*') {
  ------------------
  |  Branch (1557:14): [True: 1.19M, False: 30.4M]
  ------------------
 1558|  1.19M|            ++it;
 1559|  1.19M|            auto name = parse_anchor_name(it, end);
 1560|  1.19M|            if (name.empty()) {
  ------------------
  |  Branch (1560:17): [True: 250, False: 1.19M]
  ------------------
 1561|    250|               ctx.error = error_code::syntax_error;
 1562|    250|               return false;
 1563|    250|            }
 1564|  1.19M|            auto anchor_it = ctx.anchors.find(name);
 1565|  1.19M|            if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (1565:17): [True: 9.78k, False: 1.18M]
  ------------------
 1566|  9.78k|               ctx.error = error_code::syntax_error; // undefined alias
 1567|  9.78k|               return false;
 1568|  9.78k|            }
 1569|  1.18M|            auto& span = anchor_it->second;
 1570|  1.18M|            if (span.begin == span.end) {
  ------------------
  |  Branch (1570:17): [True: 8.27k, False: 1.17M]
  ------------------
 1571|  8.27k|               key.clear(); // empty anchor
 1572|  8.27k|            }
 1573|  1.17M|            else if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (1573:22): [True: 6, False: 1.17M]
  ------------------
 1574|       |               // A key alias replays its anchor the same way a value alias does, and a complex
 1575|       |               // key hands the span to the full reader, so it is charged the same way.
 1576|      6|               ctx.error = error_code::exceeded_max_expansion;
 1577|      6|               ctx.custom_error_message = "alias expansion";
 1578|      6|               return false;
 1579|      6|            }
 1580|  1.17M|            else {
 1581|       |               // Replay the anchor span to extract the key string
 1582|  1.17M|               auto replay_it = span.begin;
 1583|  1.17M|               auto replay_end = span.end;
 1584|  1.17M|               if (*replay_it == '"') {
  ------------------
  |  Branch (1584:20): [True: 802, False: 1.17M]
  ------------------
 1585|    802|                  parse_double_quoted_string(key, ctx, replay_it, replay_end);
 1586|    802|               }
 1587|  1.17M|               else if (*replay_it == '\'') {
  ------------------
  |  Branch (1587:25): [True: 296, False: 1.17M]
  ------------------
 1588|    296|                  parse_single_quoted_string(key, ctx, replay_it, replay_end);
 1589|    296|               }
 1590|  1.17M|               else if (*replay_it == '[' || *replay_it == '{') {
  ------------------
  |  Branch (1590:25): [True: 7.94k, False: 1.16M]
  |  Branch (1590:46): [True: 353k, False: 811k]
  ------------------
 1591|       |                  // Canonicalize complex alias keys (flow seq/map) to a stable string form.
 1592|   361k|                  glz::generic key_node{};
 1593|   361k|                  auto temp_ctx = ctx.make_speculative();
 1594|   361k|                  from<YAML, glz::generic>::template op<flow_context_on<opts{.error_on_unknown_keys = false}>()>(
 1595|   361k|                     key_node, temp_ctx, replay_it, replay_end);
 1596|   361k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 1597|   361k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 1598|   361k|                  if (bool(temp_ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1598:23): [True: 66.2k, False: 295k]
  ------------------
 1599|  66.2k|                     ctx.error = temp_ctx.error;
 1600|  66.2k|                     ctx.custom_error_message = temp_ctx.custom_error_message;
 1601|  66.2k|                     return false;
 1602|  66.2k|                  }
 1603|   295k|                  ctx.anchors = std::move(temp_ctx.anchors);
 1604|       |
 1605|   295k|                  if (!yaml::materialize_key<false>(key, key_node, ctx)) [[unlikely]] {
  ------------------
  |  Branch (1605:23): [True: 56, False: 295k]
  ------------------
 1606|     56|                     return false;
 1607|     56|                  }
 1608|   295k|               }
 1609|   811k|               else {
 1610|   811k|                  bool parse_structured_alias_key = false;
 1611|   811k|                  if (*replay_it == '-' &&
  ------------------
  |  Branch (1611:23): [True: 318k, False: 493k]
  ------------------
 1612|   318k|                      ((replay_it + 1) == replay_end ||
  ------------------
  |  Branch (1612:24): [True: 7.18k, False: 310k]
  ------------------
 1613|   310k|                       yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(replay_it + 1))])) {
  ------------------
  |  Branch (1613:24): [True: 258k, False: 52.7k]
  ------------------
 1614|   265k|                     parse_structured_alias_key = true;
 1615|   265k|                  }
 1616|   546k|                  else {
 1617|   546k|                     auto scan = replay_it;
 1618|  21.8M|                     while (scan != replay_end) {
  ------------------
  |  Branch (1618:29): [True: 21.8M, False: 46.9k]
  ------------------
 1619|  21.8M|                        if (*scan == ':') {
  ------------------
  |  Branch (1619:29): [True: 335k, False: 21.4M]
  ------------------
 1620|   335k|                           const auto after_colon = scan + 1;
 1621|   335k|                           if (after_colon == replay_end ||
  ------------------
  |  Branch (1621:32): [True: 10.0k, False: 324k]
  ------------------
 1622|   324k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) {
  ------------------
  |  Branch (1622:32): [True: 163k, False: 161k]
  ------------------
 1623|   173k|                              parse_structured_alias_key = true;
 1624|   173k|                              break;
 1625|   173k|                           }
 1626|   335k|                        }
 1627|  21.6M|                        if (*scan == '\n' || *scan == '\r') {
  ------------------
  |  Branch (1627:29): [True: 198k, False: 21.4M]
  |  Branch (1627:46): [True: 127k, False: 21.3M]
  ------------------
 1628|   325k|                           break;
 1629|   325k|                        }
 1630|  21.3M|                        ++scan;
 1631|  21.3M|                     }
 1632|   546k|                  }
 1633|   811k|                  if (!parse_structured_alias_key) {
  ------------------
  |  Branch (1633:23): [True: 372k, False: 439k]
  ------------------
 1634|  19.5M|                     for (auto p = replay_it; p != replay_end; ++p) {
  ------------------
  |  Branch (1634:47): [True: 19.5M, False: 46.9k]
  ------------------
 1635|  19.5M|                        if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1635:29): [True: 198k, False: 19.3M]
  |  Branch (1635:43): [True: 127k, False: 19.1M]
  ------------------
 1636|   325k|                           parse_structured_alias_key = true;
 1637|   325k|                           break;
 1638|   325k|                        }
 1639|  19.5M|                     }
 1640|   372k|                  }
 1641|       |
 1642|   811k|                  if (parse_structured_alias_key) {
  ------------------
  |  Branch (1642:23): [True: 764k, False: 46.9k]
  ------------------
 1643|   764k|                     glz::generic key_node{};
 1644|   764k|                     auto temp_ctx = ctx.make_speculative();
 1645|   764k|                     from<YAML, glz::generic>::template op<opts{.error_on_unknown_keys = false}>(key_node, temp_ctx,
 1646|   764k|                                                                                                 replay_it, replay_end);
 1647|   764k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 1648|   764k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 1649|   764k|                     if (bool(temp_ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (1649:26): [True: 102k, False: 662k]
  ------------------
 1650|   102k|                        ctx.error = temp_ctx.error;
 1651|   102k|                        ctx.custom_error_message = temp_ctx.custom_error_message;
 1652|   102k|                        return false;
 1653|   102k|                     }
 1654|   662k|                     ctx.anchors = std::move(temp_ctx.anchors);
 1655|       |
 1656|   662k|                     if (!yaml::materialize_key<false>(key, key_node, ctx)) [[unlikely]] {
  ------------------
  |  Branch (1656:26): [True: 26, False: 662k]
  ------------------
 1657|     26|                        return false;
 1658|     26|                     }
 1659|   662k|                  }
 1660|  46.9k|                  else {
 1661|  46.9k|                     parse_plain_scalar(key, ctx, replay_it, replay_end, false);
 1662|  46.9k|                  }
 1663|   811k|               }
 1664|  1.17M|            }
 1665|  1.01M|            return !bool(ctx.error);
 1666|  1.18M|         }
 1667|       |
 1668|       |         // Handle anchor on key (&name before key text)
 1669|  30.4M|         bool has_key_anchor = false;
 1670|  30.4M|         std::string key_anchor_name;
 1671|  30.4M|         if (*it == '&') {
  ------------------
  |  Branch (1671:14): [True: 3.92M, False: 26.5M]
  ------------------
 1672|  3.92M|            ++it;
 1673|  3.92M|            auto name = parse_anchor_name(it, end);
 1674|  3.92M|            if (name.empty()) {
  ------------------
  |  Branch (1674:17): [True: 354, False: 3.92M]
  ------------------
 1675|    354|               ctx.error = error_code::syntax_error;
 1676|    354|               return false;
 1677|    354|            }
 1678|  3.92M|            skip_inline_ws(it, end);
 1679|  3.92M|            if (it == end) {
  ------------------
  |  Branch (1679:17): [True: 478, False: 3.92M]
  ------------------
 1680|    478|               ctx.error = error_code::unexpected_end;
 1681|    478|               return false;
 1682|    478|            }
 1683|       |            // Anchor on alias is invalid per YAML spec
 1684|  3.92M|            if (*it == '*') {
  ------------------
  |  Branch (1684:17): [True: 34, False: 3.92M]
  ------------------
 1685|     34|               ctx.error = error_code::syntax_error;
 1686|     34|               return false;
 1687|     34|            }
 1688|  3.92M|            has_key_anchor = true;
 1689|  3.92M|            key_anchor_name = std::string(name);
 1690|  3.92M|         }
 1691|       |
 1692|       |         // Allow node-property order "&anchor !!str key: value" for mapping keys.
 1693|  30.4M|         if (*it == '!') {
  ------------------
  |  Branch (1693:14): [True: 9.25k, False: 30.4M]
  ------------------
 1694|  9.25k|            if (key_tag != yaml_tag::none) {
  ------------------
  |  Branch (1694:17): [True: 10, False: 9.24k]
  ------------------
 1695|       |               // Duplicate tag properties on the same key node are malformed.
 1696|     10|               ctx.error = error_code::syntax_error;
 1697|     10|               return false;
 1698|     10|            }
 1699|  9.24k|            key_tag = parse_yaml_tag(it, end, ctx);
 1700|  9.24k|            if (!validate_key_tag(key_tag)) {
  ------------------
  |  Branch (1700:17): [True: 46, False: 9.20k]
  ------------------
 1701|     46|               return false;
 1702|     46|            }
 1703|  9.20k|            skip_inline_ws(it, end);
 1704|  9.20k|            if (it == end) {
  ------------------
  |  Branch (1704:17): [True: 34, False: 9.16k]
  ------------------
 1705|     34|               ctx.error = error_code::unexpected_end;
 1706|     34|               return false;
 1707|     34|            }
 1708|  9.20k|         }
 1709|       |
 1710|  30.4M|         const char* key_start = &*it;
 1711|  30.4M|         bool quoted_key_spans_lines = false;
 1712|       |
 1713|  30.4M|         if (*it == '"') {
  ------------------
  |  Branch (1713:14): [True: 26.3k, False: 30.4M]
  ------------------
 1714|  26.3k|            auto quoted_start = it;
 1715|  26.3k|            parse_double_quoted_string(key, ctx, it, end);
 1716|  26.3k|            if (!bool(ctx.error)) {
  ------------------
  |  Branch (1716:17): [True: 26.0k, False: 282]
  ------------------
 1717|   991k|               for (auto p = quoted_start; p != it; ++p) {
  ------------------
  |  Branch (1717:44): [True: 976k, False: 15.6k]
  ------------------
 1718|   976k|                  if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1718:23): [True: 7.89k, False: 968k]
  |  Branch (1718:37): [True: 2.50k, False: 965k]
  ------------------
 1719|  10.3k|                     quoted_key_spans_lines = true;
 1720|  10.3k|                     break;
 1721|  10.3k|                  }
 1722|   976k|               }
 1723|  26.0k|            }
 1724|  26.3k|         }
 1725|  30.4M|         else if (*it == '\'') {
  ------------------
  |  Branch (1725:19): [True: 104k, False: 30.3M]
  ------------------
 1726|   104k|            auto quoted_start = it;
 1727|   104k|            parse_single_quoted_string(key, ctx, it, end);
 1728|   104k|            if (!bool(ctx.error)) {
  ------------------
  |  Branch (1728:17): [True: 104k, False: 380]
  ------------------
 1729|   545k|               for (auto p = quoted_start; p != it; ++p) {
  ------------------
  |  Branch (1729:44): [True: 540k, False: 5.17k]
  ------------------
 1730|   540k|                  if (*p == '\n' || *p == '\r') {
  ------------------
  |  Branch (1730:23): [True: 97.6k, False: 442k]
  |  Branch (1730:37): [True: 1.73k, False: 440k]
  ------------------
 1731|  99.3k|                     quoted_key_spans_lines = true;
 1732|  99.3k|                     break;
 1733|  99.3k|                  }
 1734|   540k|               }
 1735|   104k|            }
 1736|   104k|         }
 1737|  30.3M|         else {
 1738|       |            // Plain key - read until colon
 1739|   745M|            while (it != end) {
  ------------------
  |  Branch (1739:20): [True: 745M, False: 10.8k]
  ------------------
 1740|   745M|               const char c = *it;
 1741|   745M|               if (c == ':') {
  ------------------
  |  Branch (1741:20): [True: 19.1M, False: 726M]
  ------------------
 1742|       |                  // Check if this ends the key
 1743|  19.1M|                  if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' ||
  ------------------
  |  Branch (1743:23): [True: 55.7k, False: 19.0M]
  |  Branch (1743:42): [True: 3.96M, False: 15.1M]
  |  Branch (1743:62): [True: 2.91M, False: 12.2M]
  |  Branch (1743:83): [True: 945k, False: 11.2M]
  ------------------
 1744|  12.2M|                      *(it + 1) == '\r') {
  ------------------
  |  Branch (1744:23): [True: 4.38M, False: 6.87M]
  ------------------
 1745|  12.2M|                     break;
 1746|  12.2M|                  }
 1747|  6.87M|                  if (in_flow && (*(it + 1) == ',' || *(it + 1) == ']' || *(it + 1) == '}')) {
  ------------------
  |  Branch (1747:23): [True: 5.78M, False: 1.08M]
  |  Branch (1747:35): [True: 52.5k, False: 5.73M]
  |  Branch (1747:55): [True: 44, False: 5.73M]
  |  Branch (1747:75): [True: 58.0k, False: 5.67M]
  ------------------
 1748|   110k|                     break;
 1749|   110k|                  }
 1750|  6.87M|               }
 1751|   732M|               if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1751:20): [True: 17.5M, False: 715M]
  |  Branch (1751:33): [True: 8.24M, False: 706M]
  ------------------
 1752|  25.8M|                  if (!in_flow) break;
  ------------------
  |  Branch (1752:23): [True: 2.30k, False: 25.8M]
  ------------------
 1753|       |
 1754|  25.8M|                  auto continuation = it;
 1755|  25.8M|                  skip_newline(continuation, end);
 1756|  25.8M|                  int32_t continuation_indent = 0;
 1757|  43.5M|                  while (continuation != end && (*continuation == ' ' || *continuation == '\t')) {
  ------------------
  |  Branch (1757:26): [True: 43.5M, False: 228]
  |  Branch (1757:50): [True: 14.7M, False: 28.8M]
  |  Branch (1757:74): [True: 3.00M, False: 25.8M]
  ------------------
 1758|  17.7M|                     if (*continuation == ' ') ++continuation_indent;
  ------------------
  |  Branch (1758:26): [True: 14.7M, False: 3.00M]
  ------------------
 1759|  17.7M|                     ++continuation;
 1760|  17.7M|                  }
 1761|       |
 1762|  25.8M|                  if (continuation == end) {
  ------------------
  |  Branch (1762:23): [True: 228, False: 25.8M]
  ------------------
 1763|    228|                     break;
 1764|    228|                  }
 1765|       |
 1766|  25.8M|                  if (*continuation == '#') {
  ------------------
  |  Branch (1766:23): [True: 580k, False: 25.2M]
  ------------------
 1767|   580k|                     it = continuation;
 1768|   580k|                     skip_comment(it, end);
 1769|   580k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (1769:26): [True: 580k, False: 58]
  |  Branch (1769:40): [True: 510k, False: 69.8k]
  |  Branch (1769:55): [True: 69.8k, False: 0]
  ------------------
 1770|   580k|                        skip_newline(it, end);
 1771|   580k|                        continue;
 1772|   580k|                     }
 1773|     58|                     break;
 1774|   580k|                  }
 1775|       |
 1776|       |                  // A continuation line starting with flow terminators or ':' does
 1777|       |                  // not belong to the key content.
 1778|  25.2M|                  if (*continuation == ',' || *continuation == ']' || *continuation == '}' || *continuation == ':') {
  ------------------
  |  Branch (1778:23): [True: 440k, False: 24.8M]
  |  Branch (1778:47): [True: 14, False: 24.8M]
  |  Branch (1778:71): [True: 54.8k, False: 24.7M]
  |  Branch (1778:95): [True: 887k, False: 23.8M]
  ------------------
 1779|  1.38M|                     break;
 1780|  1.38M|                  }
 1781|       |
 1782|  23.8M|                  if (ctx.explicit_mapping_key_context) {
  ------------------
  |  Branch (1782:23): [True: 25.1k, False: 23.8M]
  ------------------
 1783|  25.1k|                     if (*continuation == '?' || *continuation == ':') {
  ------------------
  |  Branch (1783:26): [True: 2.15k, False: 22.9k]
  |  Branch (1783:50): [True: 0, False: 22.9k]
  ------------------
 1784|  2.15k|                        auto after = continuation + 1;
 1785|  2.15k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1785:29): [True: 6, False: 2.15k]
  |  Branch (1785:45): [True: 18, False: 2.13k]
  |  Branch (1785:62): [True: 6, False: 2.12k]
  |  Branch (1785:80): [True: 10, False: 2.11k]
  |  Branch (1785:98): [True: 6, False: 2.11k]
  ------------------
 1786|     46|                           break;
 1787|     46|                        }
 1788|  2.15k|                     }
 1789|       |
 1790|  25.1k|                     if (*continuation == '&' || *continuation == '*' || *continuation == '!') {
  ------------------
  |  Branch (1790:26): [True: 8, False: 25.0k]
  |  Branch (1790:50): [True: 16, False: 25.0k]
  |  Branch (1790:74): [True: 6, False: 25.0k]
  ------------------
 1791|     30|                        break;
 1792|     30|                     }
 1793|       |
 1794|  25.0k|                     if (*continuation == '-') {
  ------------------
  |  Branch (1794:26): [True: 1.03k, False: 24.0k]
  ------------------
 1795|  1.03k|                        auto after = continuation + 1;
 1796|  1.03k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1796:29): [True: 6, False: 1.02k]
  |  Branch (1796:45): [True: 6, False: 1.02k]
  |  Branch (1796:62): [True: 6, False: 1.01k]
  |  Branch (1796:80): [True: 10, False: 1.00k]
  |  Branch (1796:98): [True: 6, False: 998]
  ------------------
 1797|     34|                           break;
 1798|     34|                        }
 1799|  1.03k|                     }
 1800|       |
 1801|  25.0k|                     if (ctx.current_indent() >= 0 && continuation_indent <= ctx.current_indent()) {
  ------------------
  |  Branch (1801:26): [True: 1.36k, False: 23.6k]
  |  Branch (1801:55): [True: 1.28k, False: 78]
  ------------------
 1802|  1.28k|                        break;
 1803|  1.28k|                     }
 1804|       |
 1805|       |                     // A continuation line that contains an implicit mapping-key
 1806|       |                     // indicator (": " / ":\n") starts a new entry, not key text.
 1807|  23.7k|                     {
 1808|  23.7k|                        auto scan = continuation;
 1809|   175k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (1809:32): [True: 174k, False: 630]
  |  Branch (1809:47): [True: 160k, False: 13.7k]
  |  Branch (1809:64): [True: 151k, False: 9.31k]
  ------------------
 1810|   151k|                           if (*scan == ':') {
  ------------------
  |  Branch (1810:32): [True: 3.35k, False: 148k]
  ------------------
 1811|  3.35k|                              auto after_colon = scan + 1;
 1812|  3.35k|                              const bool tight_key_colon =
 1813|  3.35k|                                 (scan == continuation) || (*(scan - 1) != ' ' && *(scan - 1) != '\t');
  ------------------
  |  Branch (1813:34): [True: 0, False: 3.35k]
  |  Branch (1813:61): [True: 2.76k, False: 590]
  |  Branch (1813:83): [True: 2.70k, False: 66]
  ------------------
 1814|  3.35k|                              if (tight_key_colon &&
  ------------------
  |  Branch (1814:35): [True: 2.70k, False: 656]
  ------------------
 1815|  2.70k|                                  (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (1815:36): [True: 18, False: 2.68k]
  |  Branch (1815:58): [True: 14, False: 2.66k]
  |  Branch (1815:81): [True: 6, False: 2.66k]
  ------------------
 1816|  2.66k|                                   *after_colon == '\n' || *after_colon == '\r')) {
  ------------------
  |  Branch (1816:36): [True: 14, False: 2.64k]
  |  Branch (1816:60): [True: 10, False: 2.63k]
  ------------------
 1817|     62|                                 break;
 1818|     62|                              }
 1819|  3.35k|                           }
 1820|   151k|                           ++scan;
 1821|   151k|                        }
 1822|  23.7k|                        if (scan != end && *scan == ':') {
  ------------------
  |  Branch (1822:29): [True: 23.1k, False: 630]
  |  Branch (1822:44): [True: 62, False: 23.0k]
  ------------------
 1823|     62|                           break;
 1824|     62|                        }
 1825|  23.7k|                     }
 1826|  23.7k|                  }
 1827|       |
 1828|  23.8M|                  if (!key.empty() && key.back() != ' ') {
  ------------------
  |  Branch (1828:23): [True: 23.4M, False: 387k]
  |  Branch (1828:39): [True: 12.3M, False: 11.0M]
  ------------------
 1829|  12.3M|                     key.push_back(' ');
 1830|  12.3M|                  }
 1831|  23.8M|                  it = continuation;
 1832|  23.8M|                  continue;
 1833|  23.8M|               }
 1834|   706M|               if (in_flow && (c == ',' || c == ']' || c == '}')) break;
  ------------------
  |  Branch (1834:20): [True: 612M, False: 94.6M]
  |  Branch (1834:32): [True: 15.9M, False: 596M]
  |  Branch (1834:44): [True: 300, False: 596M]
  |  Branch (1834:56): [True: 492k, False: 595M]
  ------------------
 1835|   690M|               if (c == '#') {
  ------------------
  |  Branch (1835:20): [True: 12.2M, False: 678M]
  ------------------
 1836|  12.2M|                  if (key.empty() || key.back() == ' ' || key.back() == '\t') break;
  ------------------
  |  Branch (1836:23): [True: 17.0k, False: 12.2M]
  |  Branch (1836:38): [True: 45.0k, False: 12.2M]
  |  Branch (1836:59): [True: 1.32k, False: 12.2M]
  ------------------
 1837|  12.2M|               }
 1838|       |
 1839|   690M|               key.push_back(c);
 1840|   690M|               ++it;
 1841|   690M|            }
 1842|       |
 1843|       |            // Trim trailing whitespace from key
 1844|  35.5M|            while (!key.empty() && (key.back() == ' ' || key.back() == '\t')) {
  ------------------
  |  Branch (1844:20): [True: 29.9M, False: 5.58M]
  |  Branch (1844:37): [True: 4.60M, False: 25.3M]
  |  Branch (1844:58): [True: 578k, False: 24.7M]
  ------------------
 1845|  5.17M|               key.pop_back();
 1846|  5.17M|            }
 1847|       |
 1848|       |            // Empty keys are valid YAML (":" in block or flow mappings).
 1849|  30.3M|         }
 1850|       |
 1851|  30.4M|         if (bool(ctx.error)) return false;
  ------------------
  |  Branch (1851:14): [True: 662, False: 30.4M]
  ------------------
 1852|       |
 1853|       |         // Implicit mapping keys must be single-line in both block and flow styles.
 1854|  30.4M|         if (quoted_key_spans_lines && !in_flow) {
  ------------------
  |  Branch (1854:14): [True: 109k, False: 30.3M]
  |  Branch (1854:40): [True: 82, False: 109k]
  ------------------
 1855|     82|            ctx.error = error_code::syntax_error;
 1856|     82|            return false;
 1857|     82|         }
 1858|       |
 1859|       |         // Store anchor on key if present
 1860|  30.4M|         if (has_key_anchor) {
  ------------------
  |  Branch (1860:14): [True: 3.91M, False: 26.5M]
  ------------------
 1861|  3.91M|            ctx.anchors[std::move(key_anchor_name)] = {key_start, &*it, ctx.current_indent()};
 1862|  3.91M|         }
 1863|       |
 1864|  30.4M|         return true;
 1865|  30.4M|      }
_ZZN3glz4yaml14parse_yaml_keyINS0_12yaml_contextEPKcS4_EEbRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_bENKUlNS0_8yaml_tagEE_clESI_:
 1533|  31.6M|         auto validate_key_tag = [&](const yaml_tag tag) {
 1534|  31.6M|            if (tag == yaml_tag::unknown) {
  ------------------
  |  Branch (1534:17): [True: 74, False: 31.6M]
  ------------------
 1535|     74|               ctx.error = error_code::syntax_error;
 1536|     74|               return false;
 1537|     74|            }
 1538|  31.6M|            if (!tag_valid_for_string(tag)) {
  ------------------
  |  Branch (1538:17): [True: 62, False: 31.6M]
  ------------------
 1539|     62|               ctx.error = error_code::syntax_error;
 1540|     62|               return false;
 1541|     62|            }
 1542|  31.6M|            return true;
 1543|  31.6M|         };
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  7.97M|      {
  275|  7.97M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  7.97M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  7.97M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  7.97M|      }
_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_:
 5635|  11.6M|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|  11.6M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|  11.6M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|  11.6M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|  11.6M|                       "the internally tagged shape, so it is rejected here instead.");
 5642|  11.6M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 11.6M]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|  11.6M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|  11.6M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 2.07k, False: 11.6M]
  ------------------
 5650|  2.07k|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|  11.6M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 9.16M, False: 2.51M]
  ------------------
 5655|  9.16M|            yaml::skip_ws_newlines_comments(it, end);
 5656|  9.16M|         }
 5657|  2.51M|         else {
 5658|  2.51M|            yaml::skip_inline_ws(it, end);
 5659|  2.51M|         }
 5660|       |
 5661|  11.6M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 102, False: 11.6M]
  ------------------
 5662|    102|            ctx.error = error_code::unexpected_end;
 5663|    102|            return;
 5664|    102|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|  11.6M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|  11.6M|            using V = std::remove_cvref_t<T>;
 5772|  11.6M|            using counts = yaml_variant_type_count<V>;
 5773|  11.6M|            const char c = *it;
 5774|  11.6M|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  11.6M|               switch (ch) {
 5776|  11.6M|               case ' ':
 5777|  11.6M|               case '\t':
 5778|  11.6M|               case '\n':
 5779|  11.6M|               case '\r':
 5780|  11.6M|               case ',':
 5781|  11.6M|               case ']':
 5782|  11.6M|               case '}':
 5783|  11.6M|                  return true;
 5784|  11.6M|               default:
 5785|  11.6M|                  return false;
 5786|  11.6M|               }
 5787|  11.6M|            };
 5788|       |
 5789|  11.6M|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  11.6M|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  11.6M|                  return false;
 5792|  11.6M|               }
 5793|  11.6M|               if (ctx.current_indent() < 0) {
 5794|  11.6M|                  return false;
 5795|  11.6M|               }
 5796|  11.6M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|  11.6M|                  return false;
 5798|  11.6M|               }
 5799|       |
 5800|  11.6M|               auto look = word_end;
 5801|  11.6M|               yaml::skip_newline(look, end);
 5802|  11.6M|               while (look != end) {
 5803|  11.6M|                  int32_t line_indent = 0;
 5804|  11.6M|                  while (look != end && *look == ' ') {
 5805|  11.6M|                     ++line_indent;
 5806|  11.6M|                     ++look;
 5807|  11.6M|                  }
 5808|  11.6M|                  if (look != end && *look == '\t') {
 5809|  11.6M|                     return false;
 5810|  11.6M|                  }
 5811|  11.6M|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|  11.6M|                     if (look != end) {
 5813|  11.6M|                        yaml::skip_newline(look, end);
 5814|  11.6M|                        continue;
 5815|  11.6M|                     }
 5816|  11.6M|                     return false;
 5817|  11.6M|                  }
 5818|  11.6M|                  if (*look == '#') {
 5819|  11.6M|                     yaml::skip_comment(look, end);
 5820|  11.6M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|  11.6M|                        yaml::skip_newline(look, end);
 5822|  11.6M|                        continue;
 5823|  11.6M|                     }
 5824|  11.6M|                     return false;
 5825|  11.6M|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  11.6M|                  {
 5831|  11.6M|                     auto scan = look;
 5832|  11.6M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|  11.6M|                        if (*scan == ':') {
 5834|  11.6M|                           auto after_colon = scan + 1;
 5835|  11.6M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|  11.6M|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|  11.6M|                              return false;
 5838|  11.6M|                           }
 5839|  11.6M|                        }
 5840|  11.6M|                        ++scan;
 5841|  11.6M|                     }
 5842|  11.6M|                  }
 5843|       |
 5844|  11.6M|                  return line_indent > ctx.current_indent();
 5845|  11.6M|               }
 5846|  11.6M|               return false;
 5847|  11.6M|            };
 5848|  11.6M|            auto is_word_boundary = [&](const auto ptr) {
 5849|  11.6M|               if (ptr == end) {
 5850|  11.6M|                  return true;
 5851|  11.6M|               }
 5852|  11.6M|               if (*ptr == ':') {
 5853|  11.6M|                  auto next = ptr + 1;
 5854|  11.6M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|  11.6M|               }
 5856|  11.6M|               return is_plain_scalar_boundary(*ptr);
 5857|  11.6M|            };
 5858|       |
 5859|  11.6M|            switch (c) {
 5860|  2.13M|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 2.13M, False: 9.53M]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|  2.13M|               ++it;
 5863|  2.13M|               auto aname = yaml::parse_anchor_name(it, end);
 5864|  2.13M|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 42, False: 2.13M]
  ------------------
 5865|     42|                  ctx.error = error_code::syntax_error;
 5866|     42|                  return;
 5867|     42|               }
 5868|  2.13M|               yaml::skip_inline_ws(it, end);
 5869|  2.13M|               bool anchor_on_same_line = true;
 5870|  2.13M|               bool value_is_indentless_sequence = false;
 5871|  2.13M|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 8.07k, False: 2.13M]
  |  Branch (5871:33): [True: 91.1k, False: 2.03M]
  |  Branch (5871:48): [True: 65.1k, False: 1.97M]
  |  Branch (5871:63): [True: 60.5k, False: 1.91M]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|   224k|                  bool value_on_next_line = false;
 5875|   224k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 216k, False: 8.07k]
  ------------------
 5876|   216k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|   216k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 60.5k, False: 156k]
  ------------------
 5879|  3.10M|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 3.10M, False: 0]
  |  Branch (5879:47): [True: 3.08M, False: 24.8k]
  |  Branch (5879:64): [True: 3.04M, False: 35.7k]
  ------------------
 5880|  60.5k|                     }
 5881|       |                     // Skip newline
 5882|   216k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 216k, False: 0]
  |  Branch (5882:42): [True: 116k, False: 100k]
  |  Branch (5882:59): [True: 100k, False: 0]
  ------------------
 5883|   216k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|   279k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 274k, False: 5.68k]
  |  Branch (5885:48): [True: 29.9k, False: 244k]
  |  Branch (5885:65): [True: 32.9k, False: 211k]
  ------------------
 5886|  62.8k|                           yaml::skip_newline(peek, end);
 5887|  62.8k|                        }
 5888|       |                        // Measure indent of next content line
 5889|   216k|                        int32_t next_indent = 0;
 5890|   423k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 415k, False: 7.63k]
  |  Branch (5890:47): [True: 206k, False: 209k]
  ------------------
 5891|   206k|                           ++next_indent;
 5892|   206k|                           ++peek;
 5893|   206k|                        }
 5894|   216k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 209k, False: 7.63k]
  |  Branch (5894:44): [True: 203k, False: 5.79k]
  |  Branch (5894:61): [True: 198k, False: 5.16k]
  ------------------
 5895|   198k|                           const bool indentless_sequence =
 5896|   198k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 196k, False: 1.57k]
  |  Branch (5896:69): [True: 37.8k, False: 158k]
  ------------------
 5897|  37.8k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 326, False: 37.5k]
  ------------------
 5898|  37.5k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 35.3k, False: 2.15k]
  ------------------
 5899|  35.7k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 9.07k, False: 26.6k]
  ------------------
 5900|  26.6k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 8.87k, False: 17.7k]
  |  Branch (5900:61): [True: 8.68k, False: 194]
  ------------------
 5901|   198k|                           value_is_indentless_sequence = indentless_sequence;
 5902|   198k|                           const bool same_indent_property_node =
 5903|   198k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 18.4k, False: 179k]
  ------------------
 5904|  18.4k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 1.49k, False: 16.9k]
  |  Branch (5904:48): [True: 534, False: 16.3k]
  |  Branch (5904:64): [True: 10, False: 16.3k]
  |  Branch (5904:80): [True: 1.05k, False: 15.3k]
  |  Branch (5904:96): [True: 1.78k, False: 13.5k]
  ------------------
 5905|  13.5k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 544, False: 12.9k]
  |  Branch (5905:48): [True: 6, False: 12.9k]
  |  Branch (5905:65): [True: 206, False: 12.7k]
  |  Branch (5905:81): [True: 4, False: 12.7k]
  ------------------
 5906|   198k|                           value_on_next_line =
 5907|   198k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 165k, False: 32.9k]
  |  Branch (5907:71): [True: 17.7k, False: 15.2k]
  |  Branch (5907:94): [True: 5.63k, False: 9.61k]
  ------------------
 5908|   198k|                        }
 5909|   216k|                     }
 5910|   216k|                  }
 5911|   224k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 36.2k, False: 188k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  36.2k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  36.2k|                     return;
 5915|  36.2k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|   188k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 59.2k, False: 129k]
  ------------------
 5918|  3.05M|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 3.05M, False: 0]
  |  Branch (5918:42): [True: 3.02M, False: 23.9k]
  |  Branch (5918:57): [True: 2.99M, False: 35.3k]
  ------------------
 5919|  59.2k|                  }
 5920|   188k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 188k, False: 0]
  ------------------
 5921|   240k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 240k, False: 0]
  |  Branch (5921:40): [True: 25.9k, False: 214k]
  |  Branch (5921:55): [True: 25.7k, False: 188k]
  ------------------
 5922|  51.7k|                     yaml::skip_newline(it, end);
 5923|  51.7k|                  }
 5924|   188k|                  yaml::skip_inline_ws(it, end);
 5925|   188k|                  anchor_on_same_line = false;
 5926|   188k|               }
 5927|       |
 5928|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|       |                  if (anchor_on_same_line && *it == '-' &&
 5930|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|       |                     ctx.error = error_code::syntax_error;
 5933|       |                     return;
 5934|       |                  }
 5935|       |               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|  2.10M|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 2.10M, False: 6]
  |  Branch (5939:33): [True: 80, False: 2.10M]
  |  Branch (5939:47): [True: 26, False: 54]
  ------------------
 5940|     26|                  ctx.error = error_code::syntax_error;
 5941|     26|                  return;
 5942|     26|               }
 5943|       |
 5944|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 5946|       |                     auto probe = it + 1;
 5947|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|       |                     if (nested_anchor_name.empty()) {
 5949|       |                        ctx.error = error_code::syntax_error;
 5950|       |                        return;
 5951|       |                     }
 5952|       |                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 5957|       |                        ctx.error = error_code::syntax_error;
 5958|       |                        return;
 5959|       |                     }
 5960|       |                  }
 5961|       |               }
 5962|       |
 5963|  2.10M|               const char* anchor_start = &*it;
 5964|  2.10M|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 5971|       |                     auto key_start = it;
 5972|       |                     if (*key_start == '!') {
 5973|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 5975|       |                           ctx.error = error_code::syntax_error;
 5976|       |                           return;
 5977|       |                        }
 5978|       |                        yaml::skip_inline_ws(key_start, end);
 5979|       |                        if (key_start == end) {
 5980|       |                           ctx.error = error_code::unexpected_end;
 5981|       |                           return;
 5982|       |                        }
 5983|       |                        if (*key_start == '\n' || *key_start == '\r') {
 5984|       |                           ctx.error = error_code::syntax_error;
 5985|       |                           return;
 5986|       |                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 5993|       |                           ctx.error = error_code::syntax_error;
 5994|       |                           return;
 5995|       |                        }
 5996|       |                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|       |                     auto key_scan = key_start;
 6000|       |                     auto key_end = key_start;
 6001|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6002|       |                        // Quoted key: skip to closing quote
 6003|       |                        const char quote = *key_scan;
 6004|       |                        ++key_scan;
 6005|       |                        while (key_scan != end && *key_scan != quote) {
 6006|       |                           if (*key_scan == '\\' && quote == '"') {
 6007|       |                              ++key_scan;
 6008|       |                              if (key_scan != end) ++key_scan;
 6009|       |                           }
 6010|       |                           else {
 6011|       |                              ++key_scan;
 6012|       |                           }
 6013|       |                        }
 6014|       |                        if (key_scan == end) {
 6015|       |                           ctx.error = error_code::syntax_error;
 6016|       |                           return;
 6017|       |                        }
 6018|       |                        ++key_scan; // past closing quote
 6019|       |                        key_end = key_scan;
 6020|       |                        yaml::skip_inline_ws(key_scan, end);
 6021|       |                     }
 6022|       |                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|       |                        while (key_scan != end) {
 6025|       |                           if (*key_scan == ':') {
 6026|       |                              auto next = key_scan + 1;
 6027|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6028|       |                                 break;
 6029|       |                              }
 6030|       |                           }
 6031|       |                           ++key_scan;
 6032|       |                        }
 6033|       |                        key_end = key_scan;
 6034|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6035|       |                           --key_end;
 6036|       |                        }
 6037|       |                     }
 6038|       |                     if (key_scan == end || *key_scan != ':') {
 6039|       |                        ctx.error = error_code::syntax_error;
 6040|       |                        return;
 6041|       |                     }
 6042|       |                     // Store anchor with just the key text span
 6043|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|       |                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|       |                     if constexpr (counts::n_object > 0) {
 6047|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|       |                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|       |                     return;
 6054|       |                  }
 6055|       |               }
 6056|       |
 6057|  2.10M|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|  2.10M|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|  2.10M|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|  2.10M|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|  2.10M|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 2.09M, False: 5.26k]
  ------------------
 6062|  2.09M|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|  2.09M|               }
 6064|  2.10M|               return;
 6065|  2.10M|            }
 6066|  1.59M|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 1.59M, False: 10.0M]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6070|       |                     if constexpr (counts::n_object > 0) {
 6071|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|       |                                                                                                        end);
 6073|       |                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|       |                  }
 6080|       |               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|  1.59M|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|  1.59M|               return;
 6085|  2.10M|            }
 6086|   745k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 745k, False: 10.9M]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|   745k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|   745k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 34, False: 745k]
  ------------------
 6090|     34|                  ctx.error = error_code::syntax_error;
 6091|     34|                  return;
 6092|     34|               }
 6093|   745k|               yaml::skip_inline_ws(it, end);
 6094|   745k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 744k, False: 1.34k]
  |  Branch (6094:33): [True: 19.5k, False: 724k]
  ------------------
 6095|  19.5k|                  yaml::skip_comment(it, end);
 6096|  19.5k|               }
 6097|   745k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 743k, False: 2.40k]
  |  Branch (6097:34): [True: 126k, False: 616k]
  |  Branch (6097:49): [True: 96.9k, False: 519k]
  ------------------
 6098|   223k|                  auto content = it;
 6099|   223k|                  yaml::skip_newline(content, end);
 6100|   223k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|   223k|                  bool consume_following_content = false;
 6103|   223k|                  auto content_token = content;
 6104|   223k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 220k, False: 3.41k]
  ------------------
 6105|   220k|                     auto indent_probe = content;
 6106|   220k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|   220k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 8, False: 220k]
  ------------------
 6108|      8|                        return;
 6109|   220k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|   220k|                     bool tagged_indentless_sequence = false;
 6114|   220k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 55.6k, False: 164k]
  |  Branch (6114:56): [True: 55.6k, False: 0]
  |  Branch (6114:79): [True: 47.8k, False: 7.75k]
  ------------------
 6115|  47.8k|                        const auto after_dash = indent_probe + 1;
 6116|  47.8k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 602, False: 47.2k]
  ------------------
 6117|  47.2k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 6.07k, False: 41.2k]
  ------------------
 6118|  6.68k|                           tagged_indentless_sequence =
 6119|  6.68k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 652, False: 6.02k]
  ------------------
 6120|  6.02k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 582, False: 5.44k]
  |  Branch (6120:60): [True: 386, False: 196]
  ------------------
 6121|  6.68k|                        }
 6122|  47.8k|                     }
 6123|       |
 6124|   220k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 123k, False: 96.3k]
  ------------------
 6125|  96.3k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 47.6k, False: 48.7k]
  |  Branch (6125:93): [True: 1.03k, False: 47.6k]
  ------------------
 6126|   220k|                  }
 6127|       |
 6128|   223k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 172k, False: 51.0k]
  ------------------
 6129|   172k|                     it = content_token;
 6130|   172k|                  }
 6131|  51.0k|                  else {
 6132|  51.0k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 972, False: 50.1k]
  ------------------
 6133|    972|                        if constexpr (counts::n_str > 0) {
 6134|    972|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|    972|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|    972|                           value = StrType{};
 6137|    972|                           return;
 6138|    972|                        }
 6139|    972|                     }
 6140|  51.0k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 424, False: 50.6k]
  ------------------
 6141|    424|                        if constexpr (counts::n_null > 0) {
 6142|    424|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|    424|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|    424|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 424]
  ------------------
 6145|    424|                           return;
 6146|    424|                        }
 6147|    424|                     }
 6148|  51.0k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 49.3k, False: 1.76k]
  ------------------
 6149|  49.3k|                        if constexpr (counts::n_null > 0) {
 6150|  49.3k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  49.3k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  49.3k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 49.3k]
  ------------------
 6153|  49.3k|                           return;
 6154|  49.3k|                        }
 6155|  49.3k|                     }
 6156|  51.0k|                  }
 6157|   223k|               }
 6158|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|       |                  if (it != end && *it == ',') {
 6162|       |                     ctx.error = error_code::syntax_error;
 6163|       |                     return;
 6164|       |                  }
 6165|       |                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|       |                     const bool starts_block_sequence_entry =
 6168|       |                        (it != end && *it == '-') &&
 6169|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6170|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|       |                        return;
 6175|       |                     }
 6176|       |                  }
 6177|       |               }
 6178|   745k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 2.40k, False: 743k]
  ------------------
 6179|  2.40k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 322, False: 2.08k]
  ------------------
 6180|    322|                     if constexpr (counts::n_str > 0) {
 6181|    322|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    322|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    322|                        value = StrType{};
 6184|    322|                        return;
 6185|    322|                     }
 6186|    322|                  }
 6187|  2.40k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 2.07k, False: 328]
  ------------------
 6188|  2.07k|                     if constexpr (counts::n_null > 0) {
 6189|  2.07k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|  2.07k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|  2.07k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 2.07k]
  ------------------
 6192|  2.07k|                        return;
 6193|  2.07k|                     }
 6194|  2.07k|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  2.40k|                  return;
 6197|  2.40k|               }
 6198|   743k|               switch (tag) {
 6199|  4.48k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 4.48k, False: 738k]
  ------------------
 6200|  4.48k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|  4.48k|                  return;
 6202|  16.3k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 16.3k, False: 726k]
  ------------------
 6203|  16.4k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 122, False: 742k]
  ------------------
 6204|  16.4k|                  if constexpr (counts::n_num > 0) {
 6205|  16.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  16.4k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  76.3k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 59.8k, False: 683k]
  ------------------
 6213|  76.3k|                  if constexpr (counts::n_bool > 0) {
 6214|  76.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  76.3k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  81.0k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 4.71k, False: 738k]
  ------------------
 6222|  81.0k|                  if constexpr (counts::n_null > 0) {
 6223|  81.0k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  81.0k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  81.0k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 81.0k]
  ------------------
 6226|  81.0k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  81.0k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|   117k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 36.1k, False: 706k]
  ------------------
 6234|   117k|                  if constexpr (counts::n_object > 0) {
 6235|   117k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|   117k|                                                                                                     end);
 6237|   117k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|   345k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 228k, False: 514k]
  ------------------
 6244|   345k|                  if constexpr (counts::n_array > 0) {
 6245|   345k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|       |                        if (it != end && *it == '-') {
 6248|       |                           ctx.allow_indentless_sequence = true;
 6249|       |                        }
 6250|       |                     }
 6251|   345k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|   345k|                                                                                                    end);
 6253|   345k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|   345k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|   687k|               default: {
  ------------------
  |  Branch (6260:16): [True: 342k, False: 401k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|   687k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 342k, False: 345k]
  |  Branch (6263:36): [True: 29.9k, False: 312k]
  ------------------
 6264|  29.9k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  29.9k|                     return;
 6266|  29.9k|                  }
 6267|       |
 6268|   658k|                  if constexpr (counts::n_array > 0) {
 6269|   658k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 312k, False: 345k]
  |  Branch (6269:39): [True: 658, False: 311k]
  ------------------
 6270|    658|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|    658|                                                                                                       end);
 6272|    658|                        return;
 6273|    658|                     }
 6274|   658k|                  }
 6275|   658k|                  if constexpr (counts::n_object > 0) {
 6276|   658k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 311k, False: 346k]
  |  Branch (6276:39): [True: 62.0k, False: 249k]
  ------------------
 6277|  62.0k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|  62.0k|                                                                                                        end);
 6279|  62.0k|                        return;
 6280|  62.0k|                     }
 6281|   658k|                  }
 6282|       |
 6283|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|       |                     if constexpr (counts::n_array > 0) {
 6285|       |                        const bool starts_block_sequence_entry =
 6286|       |                           (it != end && *it == '-') &&
 6287|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6288|       |                        if (starts_block_sequence_entry) {
 6289|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|       |                                                                                                          it, end);
 6291|       |                           return;
 6292|       |                        }
 6293|       |                     }
 6294|       |                     if constexpr (counts::n_object > 0) {
 6295|       |                        const bool starts_explicit_mapping_indicator =
 6296|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6297|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6298|       |                        if (starts_explicit_mapping_indicator) {
 6299|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|       |                                                                                                           it, end);
 6301|       |                           return;
 6302|       |                        }
 6303|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6304|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|       |                                                                                                           it, end);
 6306|       |                           return;
 6307|       |                        }
 6308|       |                     }
 6309|       |                  }
 6310|       |
 6311|   658k|                  if constexpr (counts::n_str > 0) {
 6312|   658k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|   658k|                     return;
 6314|   658k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|   658k|                  return;
 6319|   687k|               }
 6320|   743k|               }
 6321|      0|               return;
 6322|   743k|            }
 6323|  2.13M|            case '{':
  ------------------
  |  Branch (6323:13): [True: 2.13M, False: 9.54M]
  ------------------
 6324|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6327|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|       |                                                                                                     end);
 6329|       |                     return;
 6330|       |                  }
 6331|       |               }
 6332|       |               // Flow mapping - object type
 6333|  2.13M|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|  2.13M|               return;
 6335|   171k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 171k, False: 11.5M]
  ------------------
 6336|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6339|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|       |                                                                                                     end);
 6341|       |                     return;
 6342|       |                  }
 6343|       |               }
 6344|       |               // Flow sequence - array type
 6345|   171k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|   171k|               return;
 6347|   501k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 501k, False: 11.1M]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   501k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 452k, False: 48.5k]
  |  Branch (6349:39): [True: 6, False: 452k]
  ------------------
 6350|      6|                  ctx.error = error_code::syntax_error;
 6351|      6|                  return;
 6352|      6|               }
 6353|   501k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 452k, False: 48.5k]
  |  Branch (6353:40): [True: 146k, False: 306k]
  |  Branch (6353:56): [True: 154k, False: 151k]
  |  Branch (6353:73): [True: 92.6k, False: 59.0k]
  ------------------
 6354|   393k|                  if constexpr (counts::n_object > 0) {
 6355|   393k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   393k|                                                                                                     end);
 6357|   393k|                     return;
 6358|   393k|                  }
 6359|   393k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   501k|               return;
 6362|     14|            case '%':
  ------------------
  |  Branch (6362:13): [True: 14, False: 11.6M]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|     14|               ctx.error = error_code::syntax_error;
 6365|     14|               return;
 6366|  11.9k|            case '"':
  ------------------
  |  Branch (6366:13): [True: 11.9k, False: 11.6M]
  ------------------
 6367|  52.5k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 40.5k, False: 11.6M]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  52.5k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  52.5k|               return;
 6372|   105k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 105k, False: 11.5M]
  ------------------
 6373|   116k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 11.5k, False: 11.6M]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|   116k|               if constexpr (counts::n_bool > 0) {
 6376|   116k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 114k, False: 2.63k]
  |  Branch (6376:44): [True: 97.3k, False: 16.9k]
  |  Branch (6376:60): [True: 87.8k, False: 9.56k]
  |  Branch (6376:76): [True: 67.4k, False: 20.3k]
  ------------------
 6377|  67.5k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 6.33k, False: 40.5k]
  |  Branch (6377:60): [True: 682, False: 5.65k]
  |  Branch (6377:76): [True: 124, False: 558]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  67.5k|                     const auto after_true = it + 4;
 6380|  67.5k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  67.5k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 15.2k, False: 52.3k]
  ------------------
 6383|  15.2k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 0, False: 15.2k]
  ------------------
 6384|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|      0|                           return;
 6386|      0|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  15.2k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 14.5k, False: 656]
  |  Branch (6389:47): [True: 7.10k, False: 7.48k]
  ------------------
 6390|  7.10k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 734, False: 6.36k]
  |  Branch (6390:47): [True: 316, False: 6.05k]
  |  Branch (6390:63): [True: 4.07k, False: 1.97k]
  |  Branch (6390:80): [True: 612, False: 1.36k]
  |  Branch (6390:97): [True: 1.36k, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  7.10k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  7.10k|                           return;
 6394|  7.10k|                        }
 6395|  8.14k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  8.14k|                                                                                                      end);
 6397|  8.14k|                        return;
 6398|  15.2k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  67.5k|                  }
 6401|   116k|               }
 6402|   101k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|   116k|               return;
 6404|   300k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 300k, False: 11.3M]
  ------------------
 6405|   368k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 68.3k, False: 11.6M]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|   368k|               if constexpr (counts::n_bool > 0) {
 6408|   368k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 365k, False: 2.58k]
  |  Branch (6408:44): [True: 179k, False: 186k]
  |  Branch (6408:60): [True: 163k, False: 15.4k]
  |  Branch (6408:76): [True: 160k, False: 3.44k]
  |  Branch (6408:92): [True: 135k, False: 24.8k]
  ------------------
 6409|   230k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 62.1k, False: 168k]
  |  Branch (6409:60): [True: 56.0k, False: 6.10k]
  |  Branch (6409:76): [True: 52.0k, False: 3.99k]
  |  Branch (6409:92): [True: 34.1k, False: 17.9k]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|   169k|                     const auto after_false = it + 5;
 6412|   169k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|   169k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 142k, False: 27.2k]
  ------------------
 6415|   142k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 0, False: 142k]
  ------------------
 6416|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|      0|                           return;
 6418|      0|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|   142k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 141k, False: 546]
  |  Branch (6421:47): [True: 127k, False: 14.1k]
  ------------------
 6422|   127k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 158, False: 127k]
  |  Branch (6422:47): [True: 1.63k, False: 125k]
  |  Branch (6422:63): [True: 506, False: 125k]
  |  Branch (6422:80): [True: 25.9k, False: 99.3k]
  |  Branch (6422:97): [True: 99.3k, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|   127k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|   127k|                           return;
 6426|   127k|                        }
 6427|  14.7k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  14.7k|                                                                                                      end);
 6429|  14.7k|                        return;
 6430|   142k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|   169k|                  }
 6433|   368k|               }
 6434|   226k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|   368k|               return;
 6436|  81.0k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 81.0k, False: 11.5M]
  ------------------
 6437|   108k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 26.9k, False: 11.6M]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|   108k|               if constexpr (counts::n_null > 0) {
 6440|   108k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 106k, False: 1.97k]
  |  Branch (6440:44): [True: 43.9k, False: 62.1k]
  |  Branch (6440:60): [True: 37.6k, False: 6.37k]
  |  Branch (6440:76): [True: 30.6k, False: 6.92k]
  ------------------
 6441|  75.4k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 1.93k, False: 73.5k]
  |  Branch (6441:60): [True: 1.38k, False: 548]
  |  Branch (6441:76): [True: 1.05k, False: 330]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  31.7k|                     const auto after_null = it + 4;
 6444|  31.7k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  31.7k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 21.7k, False: 9.94k]
  ------------------
 6447|  21.7k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 0, False: 21.7k]
  ------------------
 6448|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|      0|                           return;
 6450|      0|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  21.7k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 21.4k, False: 380]
  |  Branch (6453:47): [True: 2.94k, False: 18.4k]
  ------------------
 6454|  2.94k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 6, False: 2.93k]
  |  Branch (6454:47): [True: 562, False: 2.37k]
  |  Branch (6454:63): [True: 574, False: 1.80k]
  |  Branch (6454:80): [True: 438, False: 1.36k]
  |  Branch (6454:97): [True: 1.36k, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  2.94k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  2.94k|                           return;
 6458|  2.94k|                        }
 6459|  18.8k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  18.8k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  18.8k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 18.8k]
  ------------------
 6462|  18.8k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  18.8k|                        return;
 6464|  21.7k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  31.7k|                  }
 6467|   108k|               }
 6468|  86.2k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|   108k|               return;
 6470|  5.53k|            case '~':
  ------------------
  |  Branch (6470:13): [True: 5.53k, False: 11.6M]
  ------------------
 6471|       |               // Null indicator
 6472|  5.53k|               if constexpr (counts::n_null > 0) {
 6473|  5.53k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|  5.53k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|  5.53k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 5.53k]
  ------------------
 6476|  5.53k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|  5.53k|                  return;
 6478|  5.53k|               }
 6479|      0|               break; // Fall through to try other types
 6480|  1.51M|            case '-':
  ------------------
  |  Branch (6480:13): [True: 1.51M, False: 10.1M]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|  1.51M|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 6.93k, False: 1.50M]
  |  Branch (6482:41): [True: 1.16M, False: 344k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|  1.17M|                  if constexpr (counts::n_array > 0) {
 6485|  1.17M|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|  1.17M|                                                                                                    end);
 6487|  1.17M|                     return;
 6488|  1.17M|                  }
 6489|  1.17M|               }
 6490|  1.51M|               if constexpr (counts::n_num > 0) {
 6491|  1.51M|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 344k, False: 1.17M]
  |  Branch (6491:43): [True: 32.7k, False: 311k]
  |  Branch (6491:94): [True: 200k, False: 110k]
  ------------------
 6492|   233k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|   233k|                     return;
 6494|   233k|                  }
 6495|  1.51M|               }
 6496|  1.28M|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|  1.51M|               return;
 6498|   142k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 142k, False: 11.5M]
  ------------------
 6499|   196k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 53.8k, False: 11.6M]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|   196k|               if constexpr (counts::n_num > 0) {
 6503|   196k|                  auto start_it = it;
 6504|   196k|                  auto temp_ctx = ctx.make_speculative();
 6505|   196k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|   196k|                                                                                               end);
 6507|   196k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|   196k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|   196k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 11.5k, False: 185k]
  ------------------
 6510|  11.5k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  11.5k|                     return; // Successfully parsed as number
 6512|  11.5k|                  }
 6513|   185k|                  it = start_it; // Restore and fall through to string
 6514|   185k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|   196k|               return;
 6517|  2.02M|            default:
  ------------------
  |  Branch (6517:13): [True: 2.02M, False: 9.65M]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|  2.02M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 1.19M, False: 824k]
  |  Branch (6519:32): [True: 561k, False: 635k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|   561k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 24.3k, False: 536k]
  ------------------
 6522|  24.3k|                     return;
 6523|  24.3k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|   536k|                  if constexpr (counts::n_num > 0) {
 6526|   536k|                     auto start_it = it;
 6527|   536k|                     auto temp_ctx = ctx.make_speculative();
 6528|   536k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|   536k|                                                                                                  end);
 6530|   536k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|   536k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|   536k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 281k, False: 255k]
  ------------------
 6533|   281k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|   281k|                        return; // Successfully parsed as number
 6535|   281k|                     }
 6536|   255k|                     it = start_it; // Restore and fall through to string
 6537|   255k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|   536k|                  return;
 6541|   561k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|  1.46M|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|  1.46M|               return;
 6545|  11.6M|            }
 6546|  11.6M|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|  11.6M|         error_code expansion_error{};
 6556|  11.6M|         std::string_view expansion_message{};
 6557|       |
 6558|  11.6M|         auto try_parse = [&]<size_t I>() -> bool {
 6559|  11.6M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|  11.6M|            auto start = it;
 6561|       |
 6562|  11.6M|            V v{};
 6563|  11.6M|            auto temp_ctx = ctx.make_speculative();
 6564|  11.6M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|  11.6M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|  11.6M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|  11.6M|            if (!bool(temp_ctx.error)) {
 6569|  11.6M|               value = std::move(v);
 6570|  11.6M|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|  11.6M|               return true;
 6572|  11.6M|            }
 6573|       |
 6574|  11.6M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|  11.6M|               expansion_error = temp_ctx.error;
 6576|  11.6M|               expansion_message = temp_ctx.custom_error_message;
 6577|  11.6M|            }
 6578|  11.6M|            it = start;
 6579|  11.6M|            return false;
 6580|  11.6M|         };
 6581|       |
 6582|  11.6M|         bool parsed = false;
 6583|  11.6M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|  11.6M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|  11.6M|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|  11.6M|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 11.6M]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|  11.6M|      }
_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|  1.62M|      {
  301|  1.62M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.62M]
  |  Branch (301:27): [True: 0, False: 1.62M]
  ------------------
  302|       |
  303|  1.62M|         ++it; // skip '*'
  304|  1.62M|         auto name = parse_anchor_name(it, end);
  305|  1.62M|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 24, False: 1.62M]
  ------------------
  306|     24|            ctx.error = error_code::syntax_error;
  307|     24|            return true;
  308|     24|         }
  309|       |
  310|  1.62M|         auto anchor_it = ctx.anchors.find(name);
  311|  1.62M|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 54, False: 1.62M]
  ------------------
  312|     54|            ctx.error = error_code::syntax_error; // undefined alias
  313|     54|            return true;
  314|     54|         }
  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.62M|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.62M|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 20.2k, False: 1.60M]
  ------------------
  322|  20.2k|            return true;
  323|  20.2k|         }
  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.60M|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 400, False: 1.60M]
  ------------------
  329|    400|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    400|            return true;
  331|    400|         }
  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.60M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.60M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 16, False: 1.60M]
  ------------------
  339|     16|            return true;
  340|       |
  341|  1.60M|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 12, False: 1.60M]
  ------------------
  342|     12|            ctx.error = error_code::exceeded_max_expansion;
  343|     12|            ctx.custom_error_message = "alias expansion";
  344|     12|            return true;
  345|     12|         }
  346|       |
  347|  1.60M|         auto replay_it = span.begin;
  348|  1.60M|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.60M|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.60M|         ctx.indent_stack.clear();
  353|  1.60M|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 28.2k, False: 1.57M]
  ------------------
  354|  28.2k|            ctx.push_indent(span.base_indent - 1);
  355|  28.2k|         }
  356|       |
  357|  1.60M|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.60M|         using V = std::remove_cvref_t<T>;
  360|  1.60M|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.60M|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.60M|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.60M|         return true;
  367|  1.60M|      }
_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_:
 5205|  2.34M|      {
 5206|  2.34M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  2.34M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  2.34M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  2.34M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  2.34M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 2.34M, False: 0]
  ------------------
 5216|  2.34M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  2.34M|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1892|  2.49M|      {
 1893|  2.49M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 432, False: 2.48M]
  ------------------
 1894|    432|            return;
 1895|       |
 1896|  2.48M|         yaml::node_preamble_state preamble{};
 1897|  2.48M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 155k, False: 2.33M]
  ------------------
 1898|  2.48M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|   155k|            return;
 1900|       |
 1901|  2.33M|         std::string str;
 1902|  2.33M|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|  2.33M|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 2.33M, False: 0]
  ------------------
 1905|  11.2k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 11.2k, False: 2.32M]
  ------------------
 1906|  11.2k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|  11.2k|            break;
 1908|  44.1k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 44.1k, False: 2.28M]
  ------------------
 1909|  44.1k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  44.1k|            break;
 1911|    480|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 480, False: 2.33M]
  ------------------
 1912|  4.63k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 4.15k, False: 2.32M]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  4.63k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  4.63k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 1.01k, False: 3.61k]
  ------------------
 1918|  4.63k|            break;
 1919|  2.27M|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 2.27M, False: 60.0k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|       |               if (ctx.current_indent() >= 0) {
 1924|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|       |               }
 1926|       |               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|       |               }
 1930|       |            }
 1931|  2.27M|            else {
 1932|  2.27M|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|  2.27M|            }
 1934|  2.27M|            break;
 1935|  2.33M|         }
 1936|       |
 1937|  2.33M|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 2.33M, False: 158]
  ------------------
 1938|  2.33M|            value = std::move(str);
 1939|  2.33M|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|  2.33M|         }
 1941|  2.33M|      }
_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|  2.48M|      {
  466|  2.48M|         skip_inline_ws(it, end);
  467|       |
  468|  2.48M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 2.48M]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|  2.48M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  2.48M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 2.48M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  2.48M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 2.48M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  2.48M|         skip_inline_ws(it, end);
  486|       |
  487|  2.48M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 2.48M]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  2.48M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 155k, False: 2.33M]
  ------------------
  495|   155k|            return true;
  496|   155k|         }
  497|       |
  498|  2.33M|         return false;
  499|  2.48M|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1898|  2.48M|                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|  2.48M|      {
  409|  2.48M|         state.has_anchor = false;
  410|  2.48M|         state.anchor_name.clear();
  411|  2.48M|         state.anchor_start = nullptr;
  412|  2.48M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  2.48M|         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.48M|            else {
  421|  2.48M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 155k, False: 2.33M]
  ------------------
  422|  2.48M|            }
  423|  2.48M|         }
  424|       |
  425|  2.48M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 2.33M, False: 155k]
  |  Branch (425:27): [True: 38.1k, False: 2.29M]
  ------------------
  426|  38.1k|            ++it;
  427|  38.1k|            auto name = parse_anchor_name(it, end);
  428|  38.1k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 18, False: 38.1k]
  ------------------
  429|     18|               ctx.error = error_code::syntax_error;
  430|     18|               return true;
  431|     18|            }
  432|  38.1k|            skip_inline_ws(it, end);
  433|  38.1k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 18, False: 38.1k]
  ------------------
  434|     18|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     18|                  ctx.error = error_code::unexpected_end;
  436|     18|               }
  437|     18|               return true;
  438|     18|            }
  439|  38.1k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  38.1k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 6, False: 38.1k]
  ------------------
  441|      6|                  ctx.error = error_code::syntax_error;
  442|      6|                  return true;
  443|      6|               }
  444|  38.1k|            }
  445|  38.1k|            state.has_anchor = true;
  446|  38.1k|            state.anchor_name = std::string(name);
  447|  38.1k|            state.anchor_start = &*it;
  448|  38.1k|         }
  449|       |
  450|  2.48M|         return false;
  451|  2.48M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|  2.48M|      {
  301|  2.48M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 2.48M]
  |  Branch (301:27): [True: 2.33M, False: 155k]
  ------------------
  302|       |
  303|   155k|         ++it; // skip '*'
  304|   155k|         auto name = parse_anchor_name(it, end);
  305|   155k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 20, False: 155k]
  ------------------
  306|     20|            ctx.error = error_code::syntax_error;
  307|     20|            return true;
  308|     20|         }
  309|       |
  310|   155k|         auto anchor_it = ctx.anchors.find(name);
  311|   155k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 42, False: 155k]
  ------------------
  312|     42|            ctx.error = error_code::syntax_error; // undefined alias
  313|     42|            return true;
  314|     42|         }
  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|   155k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   155k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 8.98k, False: 146k]
  ------------------
  322|  8.98k|            return true;
  323|  8.98k|         }
  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|   146k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 10, False: 146k]
  ------------------
  329|     10|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     10|            return true;
  331|     10|         }
  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|   146k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   146k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 26, False: 146k]
  ------------------
  339|     26|            return true;
  340|       |
  341|   146k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 2, False: 146k]
  ------------------
  342|      2|            ctx.error = error_code::exceeded_max_expansion;
  343|      2|            ctx.custom_error_message = "alias expansion";
  344|      2|            return true;
  345|      2|         }
  346|       |
  347|   146k|         auto replay_it = span.begin;
  348|   146k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   146k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   146k|         ctx.indent_stack.clear();
  353|   146k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 3.47k, False: 143k]
  ------------------
  354|  3.47k|            ctx.push_indent(span.base_indent - 1);
  355|  3.47k|         }
  356|       |
  357|   146k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   146k|         using V = std::remove_cvref_t<T>;
  360|   146k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   146k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   146k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   146k|         return true;
  367|   146k|      }
_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_:
 5205|   983k|      {
 5206|   983k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   983k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   983k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   983k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   983k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 983k, False: 0]
  ------------------
 5216|   983k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   983k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2047|   989k|      {
 2048|   989k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 989k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|   989k|         yaml::node_preamble_state preamble{};
 2052|   989k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 9.06k, False: 980k]
  ------------------
 2053|   989k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   989k|                   return yaml::tag_valid_for_float(tag);
 2055|   989k|                }
 2056|   989k|                else {
 2057|   989k|                   return yaml::tag_valid_for_int(tag);
 2058|   989k|                }
 2059|   989k|             }))
 2060|  9.06k|            return;
 2061|       |
 2062|   980k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|   980k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|   980k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|   980k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 54.6k, False: 925k]
  ------------------
 2070|  54.6k|               ++it;
 2071|  54.6k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 46.0k, False: 8.62k]
  |  Branch (2071:38): [True: 886, False: 45.1k]
  |  Branch (2071:74): [True: 866, False: 44.2k]
  ------------------
 2072|  44.2k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 308, False: 43.9k]
  ------------------
 2073|  2.06k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  2.06k|                  it += 3;
 2075|  2.06k|                  finalize();
 2076|  2.06k|                  return;
 2077|  2.06k|               }
 2078|  52.5k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 43.9k, False: 8.62k]
  |  Branch (2078:38): [True: 488, False: 43.4k]
  |  Branch (2078:74): [True: 1.52k, False: 41.9k]
  ------------------
 2079|  41.9k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 2.42k, False: 39.5k]
  ------------------
 2080|  4.44k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  4.44k|                  it += 3;
 2082|  4.44k|                  finalize();
 2083|  4.44k|                  return;
 2084|  4.44k|               }
 2085|  48.1k|               it = start;
 2086|  48.1k|            }
 2087|       |
 2088|   973k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 235k, False: 738k]
  |  Branch (2088:31): [True: 142k, False: 595k]
  ------------------
 2089|   378k|               const char sign = *it;
 2090|   378k|               ++it;
 2091|   378k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 377k, False: 198]
  |  Branch (2091:33): [True: 221k, False: 156k]
  ------------------
 2092|   221k|                  ++it;
 2093|   221k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 207k, False: 14.0k]
  |  Branch (2093:41): [True: 199k, False: 8.07k]
  |  Branch (2093:77): [True: 3.11k, False: 4.96k]
  ------------------
 2094|   203k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 462, False: 4.49k]
  ------------------
 2095|   203k|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 201k, False: 1.48k]
  ------------------
 2096|   201k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|   201k|                     }
 2098|  1.48k|                     else {
 2099|  1.48k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|  1.48k|                     }
 2101|   203k|                     it += 3;
 2102|   203k|                     finalize();
 2103|   203k|                     return;
 2104|   203k|                  }
 2105|   221k|               }
 2106|   174k|               it = start;
 2107|   174k|            }
 2108|   973k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|   770k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  19.2M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 18.9M, False: 235k]
  ------------------
 2115|  18.9M|            const char c = *it;
 2116|  18.9M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 358k, False: 18.6M]
  |  Branch (2116:29): [True: 218k, False: 18.3M]
  |  Branch (2116:42): [True: 12.7k, False: 18.3M]
  |  Branch (2116:55): [True: 22.0k, False: 18.3M]
  |  Branch (2116:68): [True: 63.2k, False: 18.2M]
  |  Branch (2116:80): [True: 2.55k, False: 18.2M]
  |  Branch (2116:92): [True: 14.0k, False: 18.2M]
  |  Branch (2116:104): [True: 40.1k, False: 18.2M]
  ------------------
 2117|   731k|               break;
 2118|   731k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  18.2M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 45.0k, False: 18.1M]
  ------------------
 2121|  45.0k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 560, False: 44.4k]
  |  Branch (2121:39): [True: 998, False: 43.4k]
  |  Branch (2121:59): [True: 616, False: 42.8k]
  |  Branch (2121:80): [True: 9.58k, False: 33.2k]
  |  Branch (2121:101): [True: 1.25k, False: 32.0k]
  ------------------
 2122|  13.0k|                  break;
 2123|  13.0k|               }
 2124|  45.0k|            }
 2125|  18.2M|            ++it;
 2126|  18.2M|         }
 2127|       |
 2128|   980k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|   980k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 204, False: 980k]
  ------------------
 2131|    204|            ctx.error = error_code::parse_number_failure;
 2132|    204|            return;
 2133|    204|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|   980k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|   980k|            bool negative = false;
 2186|   980k|            std::string_view digits = num_str;
 2187|       |
 2188|   980k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 770k, False: 209k]
  |  Branch (2188:37): [True: 141k, False: 629k]
  |  Branch (2188:62): [True: 33.4k, False: 595k]
  ------------------
 2189|   174k|               negative = (digits.front() == '-');
 2190|   174k|               digits.remove_prefix(1);
 2191|   174k|            }
 2192|       |
 2193|   980k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 392k, False: 587k]
  |  Branch (2193:38): [True: 241k, False: 150k]
  ------------------
 2194|   241k|               int base = 10;
 2195|   241k|               size_t offset = 0;
 2196|       |
 2197|   241k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 8.42k, False: 233k]
  |  Branch (2197:40): [True: 250, False: 233k]
  ------------------
 2198|  8.67k|                  base = 16;
 2199|  8.67k|                  offset = 2;
 2200|  8.67k|               }
 2201|   233k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 1.23k, False: 231k]
  |  Branch (2201:45): [True: 4.18k, False: 227k]
  ------------------
 2202|  5.41k|                  base = 8;
 2203|  5.41k|                  offset = 2;
 2204|  5.41k|               }
 2205|   227k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 17.8k, False: 209k]
  |  Branch (2205:45): [True: 2.65k, False: 207k]
  ------------------
 2206|  20.5k|                  base = 2;
 2207|  20.5k|                  offset = 2;
 2208|  20.5k|               }
 2209|       |
 2210|   241k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 34.6k, False: 207k]
  ------------------
 2211|  34.6k|                  auto raw_digits = digits.substr(offset);
 2212|  34.6k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  34.6k|                  std::string clean_storage;
 2215|  34.6k|                  std::string_view clean_view;
 2216|  34.6k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 4.29k, False: 30.3k]
  ------------------
 2217|  4.29k|                     clean_storage.reserve(raw_digits.size());
 2218|   750k|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 750k, False: 4.29k]
  ------------------
 2219|   750k|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 745k, False: 5.24k]
  ------------------
 2220|   745k|                           clean_storage.push_back(c);
 2221|   745k|                        }
 2222|   750k|                     }
 2223|  4.29k|                     clean_view = clean_storage;
 2224|  4.29k|                  }
 2225|  30.3k|                  else {
 2226|  30.3k|                     clean_view = raw_digits;
 2227|  30.3k|                  }
 2228|       |
 2229|  34.6k|                  uint64_t parsed_int{};
 2230|  34.6k|                  auto [ptr, ec] =
 2231|  34.6k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  34.6k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 8.36k, False: 26.2k]
  |  Branch (2232:44): [True: 4.97k, False: 21.2k]
  ------------------
 2233|  13.3k|                     ctx.error = error_code::parse_number_failure;
 2234|  13.3k|                     finalize();
 2235|  13.3k|                     return;
 2236|  13.3k|                  }
 2237|       |
 2238|  21.2k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  21.2k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 19.1k, False: 2.15k]
  ------------------
 2240|  21.2k|                  finalize();
 2241|  21.2k|                  return;
 2242|  34.6k|               }
 2243|   241k|            }
 2244|   980k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|   945k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|   980k|         std::string clean_storage;
 2250|   980k|         std::string_view clean_view;
 2251|       |
 2252|   980k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 5.42k, False: 974k]
  ------------------
 2253|  5.42k|            clean_storage.reserve(num_str.size());
 2254|   244k|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 244k, False: 5.42k]
  ------------------
 2255|   244k|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 209k, False: 34.2k]
  ------------------
 2256|   209k|                  clean_storage.push_back(c);
 2257|   209k|               }
 2258|   244k|            }
 2259|  5.42k|            clean_view = clean_storage;
 2260|  5.42k|         }
 2261|   974k|         else {
 2262|   974k|            clean_view = num_str;
 2263|   974k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|   980k|         auto parse_view = clean_view;
 2268|   980k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 735k, False: 244k]
  |  Branch (2268:37): [True: 141k, False: 594k]
  ------------------
 2269|   141k|            parse_view.remove_prefix(1);
 2270|   141k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 21.9k, False: 119k]
  ------------------
 2271|  21.9k|               ctx.error = error_code::parse_number_failure;
 2272|  21.9k|               return;
 2273|  21.9k|            }
 2274|   141k|         }
 2275|       |
 2276|   958k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|   958k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|   958k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 388k, False: 569k]
  |  Branch (2279:45): [True: 261k, False: 308k]
  ------------------
 2280|   405k|               ctx.error = error_code::parse_number_failure;
 2281|   405k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|   958k|         finalize();
 2292|   958k|      }
_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|   989k|      {
  466|   989k|         skip_inline_ws(it, end);
  467|       |
  468|   989k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 40, False: 989k]
  ------------------
  469|     40|            if constexpr (!AllowEmptyInput) {
  470|     40|               ctx.error = error_code::unexpected_end;
  471|     40|            }
  472|     40|            return true;
  473|     40|         }
  474|       |
  475|   989k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   989k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 26, False: 989k]
  ------------------
  477|     26|            ctx.error = error_code::syntax_error;
  478|     26|            return true;
  479|     26|         }
  480|   989k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 10, False: 989k]
  ------------------
  481|     10|            ctx.error = error_code::syntax_error;
  482|     10|            return true;
  483|     10|         }
  484|       |
  485|   989k|         skip_inline_ws(it, end);
  486|       |
  487|   989k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 989k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   989k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 8.97k, False: 980k]
  ------------------
  495|  8.97k|            return true;
  496|  8.97k|         }
  497|       |
  498|   980k|         return false;
  499|   989k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2052|   989k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|   989k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   989k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|   989k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   989k|      {
  409|   989k|         state.has_anchor = false;
  410|   989k|         state.anchor_name.clear();
  411|   989k|         state.anchor_start = nullptr;
  412|   989k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   989k|         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|   989k|            else {
  421|   989k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 8.95k, False: 980k]
  ------------------
  422|   989k|            }
  423|   989k|         }
  424|       |
  425|   989k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 980k, False: 8.95k]
  |  Branch (425:27): [True: 7.85k, False: 972k]
  ------------------
  426|  7.85k|            ++it;
  427|  7.85k|            auto name = parse_anchor_name(it, end);
  428|  7.85k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 7.84k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  7.84k|            skip_inline_ws(it, end);
  433|  7.84k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 8, False: 7.83k]
  ------------------
  434|      8|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|      8|                  ctx.error = error_code::unexpected_end;
  436|      8|               }
  437|      8|               return true;
  438|      8|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  7.83k|            state.has_anchor = true;
  446|  7.83k|            state.anchor_name = std::string(name);
  447|  7.83k|            state.anchor_start = &*it;
  448|  7.83k|         }
  449|       |
  450|   989k|         return false;
  451|   989k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   989k|      {
  301|   989k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 989k]
  |  Branch (301:27): [True: 980k, False: 8.95k]
  ------------------
  302|       |
  303|  8.95k|         ++it; // skip '*'
  304|  8.95k|         auto name = parse_anchor_name(it, end);
  305|  8.95k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 20, False: 8.93k]
  ------------------
  306|     20|            ctx.error = error_code::syntax_error;
  307|     20|            return true;
  308|     20|         }
  309|       |
  310|  8.93k|         auto anchor_it = ctx.anchors.find(name);
  311|  8.93k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 84, False: 8.85k]
  ------------------
  312|     84|            ctx.error = error_code::syntax_error; // undefined alias
  313|     84|            return true;
  314|     84|         }
  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.85k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  8.85k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 3.02k, False: 5.83k]
  ------------------
  322|  3.02k|            return true;
  323|  3.02k|         }
  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.83k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 6, False: 5.82k]
  ------------------
  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|  5.82k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  5.82k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 5.82k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  5.82k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 5.82k]
  ------------------
  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.82k|         auto replay_it = span.begin;
  348|  5.82k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  5.82k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  5.82k|         ctx.indent_stack.clear();
  353|  5.82k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 590, False: 5.23k]
  ------------------
  354|    590|            ctx.push_indent(span.base_indent - 1);
  355|    590|         }
  356|       |
  357|  5.82k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  5.82k|         using V = std::remove_cvref_t<T>;
  360|  5.82k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  5.82k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  5.82k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  5.82k|         return true;
  367|  5.82k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|   958k|         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_:
 5205|  82.6k|      {
 5206|  82.6k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  82.6k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  82.6k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  82.6k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  82.6k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 82.6k, False: 0]
  ------------------
 5216|  82.6k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  82.6k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2012|   125k|      {
 2013|   125k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 125k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|   125k|         yaml::node_preamble_state preamble{};
 2017|   125k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 50.1k, False: 75.0k]
  ------------------
 2018|   125k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|  50.1k|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  75.0k|         std::string str;
 2023|  75.0k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  75.0k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 2.98k, False: 72.0k]
  |  Branch (2025:31): [True: 5.02k, False: 67.0k]
  |  Branch (2025:48): [True: 122, False: 66.9k]
  |  Branch (2025:65): [True: 578, False: 66.3k]
  |  Branch (2025:81): [True: 3.04k, False: 63.3k]
  |  Branch (2025:97): [True: 910, False: 62.4k]
  ------------------
 2026|  62.4k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 702, False: 61.7k]
  |  Branch (2026:29): [True: 366, False: 61.3k]
  |  Branch (2026:44): [True: 554, False: 60.7k]
  ------------------
 2027|  14.2k|            value = true;
 2028|  14.2k|         }
 2029|  60.7k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 44.6k, False: 16.0k]
  |  Branch (2029:37): [True: 242, False: 15.8k]
  |  Branch (2029:55): [True: 10.2k, False: 5.62k]
  |  Branch (2029:73): [True: 832, False: 4.79k]
  |  Branch (2029:88): [True: 1.36k, False: 3.43k]
  |  Branch (2029:103): [True: 502, False: 2.92k]
  ------------------
 2030|  60.5k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 496, False: 2.43k]
  |  Branch (2030:35): [True: 586, False: 1.84k]
  |  Branch (2030:51): [True: 1.66k, False: 186]
  ------------------
 2031|  60.5k|            value = false;
 2032|  60.5k|         }
 2033|    186|         else {
 2034|    186|            ctx.error = error_code::expected_true_or_false;
 2035|    186|         }
 2036|       |
 2037|  75.0k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  75.0k|      }
_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|   125k|      {
  466|   125k|         skip_inline_ws(it, end);
  467|       |
  468|   125k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 125k]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|   125k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   125k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 125k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   125k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 125k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   125k|         skip_inline_ws(it, end);
  486|       |
  487|   125k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 125k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   125k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 50.1k, False: 75.0k]
  ------------------
  495|  50.1k|            return true;
  496|  50.1k|         }
  497|       |
  498|  75.0k|         return false;
  499|   125k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2018|   125k|                                             [](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|   125k|      {
  409|   125k|         state.has_anchor = false;
  410|   125k|         state.anchor_name.clear();
  411|   125k|         state.anchor_start = nullptr;
  412|   125k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   125k|         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|   125k|            else {
  421|   125k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 50.0k, False: 75.0k]
  ------------------
  422|   125k|            }
  423|   125k|         }
  424|       |
  425|   125k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 75.0k, False: 50.0k]
  |  Branch (425:27): [True: 40.2k, False: 34.8k]
  ------------------
  426|  40.2k|            ++it;
  427|  40.2k|            auto name = parse_anchor_name(it, end);
  428|  40.2k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 6, False: 40.2k]
  ------------------
  429|      6|               ctx.error = error_code::syntax_error;
  430|      6|               return true;
  431|      6|            }
  432|  40.2k|            skip_inline_ws(it, end);
  433|  40.2k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 16, False: 40.1k]
  ------------------
  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|  40.1k|            state.has_anchor = true;
  446|  40.1k|            state.anchor_name = std::string(name);
  447|  40.1k|            state.anchor_start = &*it;
  448|  40.1k|         }
  449|       |
  450|   125k|         return false;
  451|   125k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   125k|      {
  301|   125k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 125k]
  |  Branch (301:27): [True: 75.0k, False: 50.0k]
  ------------------
  302|       |
  303|  50.0k|         ++it; // skip '*'
  304|  50.0k|         auto name = parse_anchor_name(it, end);
  305|  50.0k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 8, False: 50.0k]
  ------------------
  306|      8|            ctx.error = error_code::syntax_error;
  307|      8|            return true;
  308|      8|         }
  309|       |
  310|  50.0k|         auto anchor_it = ctx.anchors.find(name);
  311|  50.0k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 52, False: 50.0k]
  ------------------
  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|  50.0k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  50.0k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 7.49k, False: 42.5k]
  ------------------
  322|  7.49k|            return true;
  323|  7.49k|         }
  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|  42.5k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 0, False: 42.5k]
  ------------------
  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|  42.5k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  42.5k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 42.5k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  42.5k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 42.5k]
  ------------------
  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|  42.5k|         auto replay_it = span.begin;
  348|  42.5k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  42.5k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  42.5k|         ctx.indent_stack.clear();
  353|  42.5k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.70k, False: 39.8k]
  ------------------
  354|  2.70k|            ctx.push_indent(span.base_indent - 1);
  355|  2.70k|         }
  356|       |
  357|  42.5k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  42.5k|         using V = std::remove_cvref_t<T>;
  360|  42.5k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  42.5k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  42.5k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  42.5k|         return true;
  367|  42.5k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2398|  29.1k|      {
 2399|  29.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 29.1k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  29.1k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  29.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 6, False: 29.0k]
  ------------------
 2405|      6|            ctx.error = error_code::unexpected_end;
 2406|      6|            return;
 2407|      6|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  29.0k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 5.53k, False: 23.5k]
  ------------------
 2411|  5.53k|            ++it;
 2412|  5.53k|            return;
 2413|  5.53k|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  23.5k|         auto start = it;
 2417|  99.2k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 98.8k, False: 398]
  |  Branch (2417:30): [True: 75.7k, False: 23.1k]
  ------------------
 2418|  75.7k|            ++it;
 2419|  75.7k|         }
 2420|       |
 2421|  23.5k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  23.5k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 58, False: 23.5k]
  ------------------
 2423|     58|            ctx.error = error_code::syntax_error;
 2424|     58|         }
 2425|  23.5k|      }
_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_:
 5205|  3.28M|      {
 5206|  3.28M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  3.28M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  3.28M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  3.28M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  3.28M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 3.28M, False: 0]
  ------------------
 5216|  3.28M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  3.28M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4515|  3.30M|      {
 4516|  3.30M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 3.30M]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|  3.30M|         yaml::node_preamble_state preamble{};
 4520|  3.30M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 20.5k, False: 3.28M]
  ------------------
 4521|  3.30M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  20.5k|            return;
 4523|       |
 4524|  3.28M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|  3.28M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|  3.28M|         std::remove_cvref_t<T> preexisting_entries;
 4538|  3.28M|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 3.28M]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|  3.28M|         struct merge_restore_guard
 4543|  3.28M|         {
 4544|  3.28M|            std::remove_cvref_t<T>& target;
 4545|  3.28M|            std::remove_cvref_t<T>& saved;
 4546|  3.28M|            ~merge_restore_guard()
 4547|  3.28M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  3.28M|               for (auto& entry : saved) {
 4551|  3.28M|                  target.emplace(entry.first, std::move(entry.second));
 4552|  3.28M|               }
 4553|  3.28M|            }
 4554|  3.28M|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|  3.28M|         const bool treat_as_block_mapping =
 4557|  3.28M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [Folded, False: 3.28M]
  |  Branch (4557:48): [True: 0, False: 0]
  |  Branch (4557:62): [True: 0, False: 0]
  ------------------
 4558|       |
 4559|  3.28M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 2.21M, False: 1.07M]
  |  Branch (4559:28): [True: 0, Folded]
  ------------------
 4560|       |            // Flow mapping
 4561|  2.21M|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|  2.21M|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|  2.21M|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 2.21M, False: 2.59k]
  |  Branch (4565:30): [True: 42.5k, False: 2.16M]
  ------------------
 4566|  42.5k|               ++it;
 4567|  42.5k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  42.5k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 12, False: 42.4k]
  ------------------
 4569|     12|                  return;
 4570|  42.4k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  42.4k|               return;
 4572|  42.5k|            }
 4573|       |
 4574|  14.6M|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 14.6M, False: 8.33k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|  14.6M|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|  14.6M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 14.6M, False: 0]
  |  Branch (4578:33): [True: 200k, False: 14.4M]
  ------------------
 4579|   200k|                  ++it;
 4580|   200k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|   200k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 6, False: 200k]
  ------------------
 4582|      6|                     return;
 4583|   200k|                  break;
 4584|   200k|               }
 4585|       |
 4586|  14.4M|               bool explicit_flow_key = false;
 4587|  14.4M|               auto explicit_probe = it;
 4588|  14.4M|               yaml::skip_inline_ws(explicit_probe, end);
 4589|  14.4M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 14.4M, False: 0]
  |  Branch (4589:45): [True: 362k, False: 14.0M]
  ------------------
 4590|   362k|                  const auto after_q = explicit_probe + 1;
 4591|   362k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 6, False: 362k]
  |  Branch (4591:41): [True: 176k, False: 186k]
  ------------------
 4592|   191k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 14.7k, False: 171k]
  |  Branch (4592:42): [True: 728, False: 170k]
  ------------------
 4593|   191k|                     explicit_flow_key = true;
 4594|   191k|                     it = explicit_probe + 1;
 4595|   191k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|   191k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 6, False: 191k]
  ------------------
 4597|      6|                        return;
 4598|   191k|                  }
 4599|   362k|               }
 4600|       |               // Parse key
 4601|  14.4M|               key_t key{};
 4602|  14.4M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|  14.4M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 191k, False: 14.2M]
  |  Branch (4603:44): [True: 191k, False: 6]
  |  Branch (4603:58): [True: 5.51k, False: 186k]
  |  Branch (4603:72): [True: 15.9k, False: 170k]
  |  Branch (4603:86): [True: 2.89k, False: 167k]
  ------------------
 4604|  24.4k|                     key.clear();
 4605|  24.4k|                  }
 4606|  14.3M|                  else {
 4607|  14.3M|                     auto key_probe = it;
 4608|  14.3M|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|  14.3M|                     bool parse_complex_flow_key = false;
 4613|  14.3M|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 14.3M, False: 6]
  ------------------
 4614|  14.3M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 17.1k, False: 14.3M]
  |  Branch (4614:50): [True: 49.7k, False: 14.3M]
  ------------------
 4615|  66.9k|                           parse_complex_flow_key = true;
 4616|  66.9k|                        }
 4617|  14.3M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 2.21M, False: 12.1M]
  ------------------
 4618|  2.21M|                           ++key_probe;
 4619|  2.21M|                           yaml::parse_anchor_name(key_probe, end);
 4620|  2.21M|                           yaml::skip_inline_ws(key_probe, end);
 4621|  2.21M|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 2.21M, False: 30]
  |  Branch (4621:53): [True: 4.32k, False: 2.20M]
  |  Branch (4621:74): [True: 504k, False: 1.70M]
  ------------------
 4622|   509k|                              parse_complex_flow_key = true;
 4623|   509k|                           }
 4624|  2.21M|                        }
 4625|  14.3M|                     }
 4626|       |
 4627|  14.3M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 576k, False: 13.8M]
  ------------------
 4628|   576k|                        glz::generic key_node{};
 4629|   576k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|   576k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 3.99k, False: 572k]
  ------------------
 4631|  3.99k|                           return;
 4632|   572k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 22, False: 572k]
  ------------------
 4633|     22|                           return;
 4634|   572k|                     }
 4635|  13.8M|                     else {
 4636|  13.8M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 69.4k, False: 13.7M]
  ------------------
 4637|  69.4k|                           return;
 4638|  69.4k|                        }
 4639|  13.8M|                     }
 4640|  14.3M|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|  14.3M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|  14.4M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 16, False: 14.4M]
  ------------------
 4656|     16|                  return;
 4657|       |
 4658|  14.4M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|  14.4M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|  14.4M|                     val = {};
 4661|  14.4M|                     return true;
 4662|  14.4M|                  }
 4663|  14.4M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  14.4M|                     val = glz::generic{};
 4665|  14.4M|                     return true;
 4666|  14.4M|                  }
 4667|  14.4M|                  else {
 4668|  14.4M|                     static constexpr std::string_view null_value{"null"};
 4669|  14.4M|                     auto null_it = null_value.data();
 4670|  14.4M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|  14.4M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|  14.4M|                     return !bool(ctx.error);
 4673|  14.4M|                  }
 4674|  14.4M|               };
 4675|       |
 4676|  14.4M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 14.3M, False: 73.5k]
  |  Branch (4676:34): [True: 9.16M, False: 5.18M]
  |  Branch (4676:48): [True: 443k, False: 4.74M]
  ------------------
 4677|  9.60M|                  val_t val{};
 4678|  9.60M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 9.60M]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|  9.60M|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|  9.60M|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 443k, False: 9.16M]
  ------------------
 4684|   443k|                     ++it;
 4685|   443k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|   443k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 16, False: 443k]
  ------------------
 4687|     16|                        return;
 4688|   443k|                     break;
 4689|   443k|                  }
 4690|       |
 4691|  9.16M|                  ++it; // skip comma
 4692|  9.16M|                  yaml::skip_ws_and_newlines(it, end);
 4693|  9.16M|                  continue;
 4694|  9.60M|               }
 4695|       |
 4696|  4.81M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 73.5k, False: 4.74M]
  |  Branch (4696:33): [True: 70, False: 4.74M]
  ------------------
 4697|    144|                  ctx.error = error_code::syntax_error;
 4698|    144|                  return;
 4699|    144|               }
 4700|  4.81M|               ++it;
 4701|       |
 4702|  4.81M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  4.81M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 6, False: 4.81M]
  ------------------
 4704|      6|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  4.81M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 4.74M, False: 73.4k]
  |  Branch (4707:34): [True: 673k, False: 4.06M]
  |  Branch (4707:48): [True: 47.0k, False: 4.02M]
  ------------------
 4708|   720k|                  val_t val{};
 4709|   720k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 720k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|   720k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|   720k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 47.0k, False: 673k]
  ------------------
 4715|  47.0k|                     ++it;
 4716|  47.0k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  47.0k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 6, False: 47.0k]
  ------------------
 4718|      6|                        return;
 4719|  47.0k|                     break;
 4720|  47.0k|                  }
 4721|       |
 4722|   673k|                  ++it; // skip comma
 4723|   673k|                  yaml::skip_ws_and_newlines(it, end);
 4724|   673k|                  continue;
 4725|   720k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  4.09M|               val_t val{};
 4729|  4.09M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  4.09M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 2.67k, False: 4.09M]
  ------------------
 4731|  2.67k|                  return;
 4732|       |
 4733|  4.09M|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  4.09M|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  4.09M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 4.01M, False: 73.5k]
  |  Branch (4737:33): [True: 1.37M, False: 2.64M]
  ------------------
 4738|  1.37M|                  ++it;
 4739|  1.37M|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|  1.37M|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 6, False: 1.37M]
  ------------------
 4741|      6|                     return;
 4742|  1.37M|                  break;
 4743|  1.37M|               }
 4744|  2.71M|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 2.64M, False: 73.5k]
  |  Branch (4744:38): [True: 2.45M, False: 191k]
  ------------------
 4745|  2.45M|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|  2.45M|                  yaml::skip_ws_and_newlines(it, end);
 4748|  2.45M|               }
 4749|   265k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 191k, False: 73.5k]
  |  Branch (4749:39): [True: 135k, False: 56.4k]
  |  Branch (4749:54): [True: 56.4k, False: 28]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|   191k|                  yaml::skip_ws_and_newlines(it, end);
 4753|   191k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 191k, False: 14]
  |  Branch (4753:36): [True: 21.8k, False: 169k]
  ------------------
 4754|  21.8k|                     ++it;
 4755|  21.8k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|  21.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 6, False: 21.8k]
  ------------------
 4757|      6|                        return;
 4758|  21.8k|                     break;
 4759|  21.8k|                  }
 4760|   169k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 169k, False: 14]
  |  Branch (4760:36): [True: 169k, False: 14]
  ------------------
 4761|   169k|                     ++it;
 4762|   169k|                     yaml::skip_ws_and_newlines(it, end);
 4763|   169k|                     continue;
 4764|   169k|                  }
 4765|     28|                  ctx.error = error_code::syntax_error;
 4766|     28|                  return;
 4767|   169k|               }
 4768|  73.5k|               else {
 4769|  73.5k|                  ctx.error = error_code::syntax_error;
 4770|  73.5k|                  return;
 4771|  73.5k|               }
 4772|  4.09M|            }
 4773|  2.17M|         }
 4774|  1.07M|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|  1.07M|            yaml::parse_block_mapping_loop<Opts>(
 4777|  1.07M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|  1.07M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|  1.07M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|  1.07M|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|  1.07M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|  1.07M|                           if (ctx.stream_begin) {
 4788|  1.07M|                              auto is_line_content_start = [&](auto pos) {
 4789|  1.07M|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|  1.07M|                              };
 4791|       |
 4792|  1.07M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|  1.07M|                                 const char* line = ctx.line_begin_of(pos);
 4794|  1.07M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|  1.07M|                                 return line != end && *line == ':';
 4796|  1.07M|                              };
 4797|       |
 4798|  1.07M|                              if (!is_line_content_start(it) &&
 4799|  1.07M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|  1.07M|                                  !line_has_explicit_value_indicator(it)) {
 4801|  1.07M|                                 ctx.error = error_code::syntax_error;
 4802|  1.07M|                                 return false;
 4803|  1.07M|                              }
 4804|  1.07M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|  1.07M|                           }
 4806|  1.07M|                        }
 4807|       |
 4808|  1.07M|                        if (*it == '-' &&
 4809|  1.07M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|  1.07M|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|  1.07M|                           ctx.error = error_code::syntax_error;
 4813|  1.07M|                           return false;
 4814|  1.07M|                        }
 4815|       |
 4816|  1.07M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|  1.07M|                           return false;
 4818|  1.07M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|  1.07M|                        ctx.pop_indent();
 4820|  1.07M|                     }
 4821|  1.07M|                     else {
 4822|  1.07M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|  1.07M|                        if (nested_indent >= 0) {
 4824|  1.07M|                           yaml::skip_to_content(it, end);
 4825|  1.07M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|  1.07M|                              ctx.error = error_code::syntax_error;
 4827|  1.07M|                              return false;
 4828|  1.07M|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  1.07M|                           const int32_t value_indent =
 4832|  1.07M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|  1.07M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|  1.07M|                              return false;
 4835|  1.07M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  1.07M|                           ctx.pop_indent();
 4837|  1.07M|                        }
 4838|  1.07M|                     }
 4839|  1.07M|                     return !bool(ctx.error);
 4840|  1.07M|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|  1.07M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|  1.07M|                     ctx.error = error_code::syntax_error;
 4847|  1.07M|                     return false;
 4848|  1.07M|                  }
 4849|  1.07M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|  1.07M|                     ++it; // skip '?'
 4851|  1.07M|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|  1.07M|                     const int32_t explicit_value_indicator_indent =
 4854|  1.07M|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|  1.07M|                     key_t key{};
 4857|  1.07M|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|  1.07M|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|  1.07M|                           return yaml::materialize_key(key, key_node, ctx);
 4860|  1.07M|                        };
 4861|       |
 4862|  1.07M|                        auto key_it = it;
 4863|  1.07M|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|  1.07M|                        auto content = key_it;
 4866|  1.07M|                        yaml::skip_to_content(content, end);
 4867|  1.07M|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|  1.07M|                        if (content != end && *content == '&') {
 4873|  1.07M|                           auto anchor_probe = content + 1;
 4874|  1.07M|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|  1.07M|                           if (!anchor_name.empty()) {
 4876|  1.07M|                              auto after_anchor = anchor_probe;
 4877|  1.07M|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|  1.07M|                              auto value_indicator = after_anchor;
 4880|  1.07M|                              if (value_indicator != end && *value_indicator == ':') {
 4881|  1.07M|                                 key.clear();
 4882|  1.07M|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  1.07M|                                 it = value_indicator;
 4884|  1.07M|                                 handled_anchor_only_empty_key = true;
 4885|  1.07M|                              }
 4886|  1.07M|                              else {
 4887|  1.07M|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|  1.07M|                                    yaml::skip_comment(value_indicator, end);
 4889|  1.07M|                                 }
 4890|  1.07M|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|  1.07M|                                    yaml::skip_newline(value_indicator, end);
 4892|  1.07M|                                    auto value_line = value_indicator;
 4893|  1.07M|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  1.07M|                                    if (bool(ctx.error)) [[unlikely]]
 4895|  1.07M|                                       return false;
 4896|  1.07M|                                    if (value_line != end && *value_line == ':' &&
 4897|  1.07M|                                        value_indent == explicit_value_indicator_indent) {
 4898|  1.07M|                                       key.clear();
 4899|  1.07M|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  1.07M|                                       it = value_line;
 4901|  1.07M|                                       handled_anchor_only_empty_key = true;
 4902|  1.07M|                                    }
 4903|  1.07M|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|  1.07M|                                       ctx.error = error_code::syntax_error;
 4908|  1.07M|                                       return false;
 4909|  1.07M|                                    }
 4910|  1.07M|                                 }
 4911|  1.07M|                              }
 4912|  1.07M|                           }
 4913|  1.07M|                        }
 4914|       |
 4915|  1.07M|                        const bool key_content_spans_lines = [&] {
 4916|  1.07M|                           auto scan = key_it;
 4917|  1.07M|                           while (scan != content && scan != end) {
 4918|  1.07M|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|  1.07M|                              ++scan;
 4920|  1.07M|                           }
 4921|  1.07M|                           return false;
 4922|  1.07M|                        }();
 4923|       |
 4924|  1.07M|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  1.07M|                        }
 4927|  1.07M|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|  1.07M|                           key.clear();
 4929|  1.07M|                           it = content;
 4930|  1.07M|                        }
 4931|  1.07M|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|  1.07M|                           auto key_node_it = content;
 4937|  1.07M|                           auto key_node_end = end;
 4938|  1.07M|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|  1.07M|                              auto scan = content;
 4943|  1.07M|                              while (scan != end) {
 4944|  1.07M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|  1.07M|                                    ++scan;
 4946|  1.07M|                                 }
 4947|  1.07M|                                 if (scan == end) {
 4948|  1.07M|                                    break;
 4949|  1.07M|                                 }
 4950|       |
 4951|  1.07M|                                 yaml::skip_newline(scan, end);
 4952|  1.07M|                                 auto line_start = scan;
 4953|       |
 4954|  1.07M|                                 int32_t indicator_indent = 0;
 4955|  1.07M|                                 while (scan != end && *scan == ' ') {
 4956|  1.07M|                                    ++indicator_indent;
 4957|  1.07M|                                    ++scan;
 4958|  1.07M|                                 }
 4959|       |
 4960|  1.07M|                                 if (scan != end && *scan == ':') {
 4961|  1.07M|                                    const auto after_colon = scan + 1;
 4962|  1.07M|                                    if ((after_colon == end ||
 4963|  1.07M|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|  1.07M|                                        indicator_indent <= line_indent) {
 4965|  1.07M|                                       key_node_end = line_start;
 4966|  1.07M|                                       break;
 4967|  1.07M|                                    }
 4968|  1.07M|                                 }
 4969|  1.07M|                              }
 4970|  1.07M|                           }
 4971|       |
 4972|  1.07M|                           glz::generic key_node{};
 4973|  1.07M|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|  1.07M|                           ctx.explicit_mapping_key_context = true;
 4975|  1.07M|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|  1.07M|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|  1.07M|                           if (bool(ctx.error)) [[unlikely]]
 4978|  1.07M|                              return false;
 4979|  1.07M|                           it = key_node_it;
 4980|  1.07M|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|  1.07M|                              return false;
 4982|  1.07M|                        }
 4983|  1.07M|                     }
 4984|  1.07M|                     else {
 4985|  1.07M|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|  1.07M|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|  1.07M|                           if (bool(ctx.error)) [[unlikely]]
 4988|  1.07M|                              return false;
 4989|  1.07M|                        }
 4990|  1.07M|                     }
 4991|       |
 4992|  1.07M|                     yaml::skip_inline_ws(it, end);
 4993|  1.07M|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|  1.07M|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|  1.07M|                        auto probe = it;
 4998|  1.07M|                        bool found_value_indicator = false;
 4999|       |
 5000|  1.07M|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|  1.07M|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|  1.07M|                           auto value_line = probe;
 5004|  1.07M|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|  1.07M|                           if (bool(ctx.error)) [[unlikely]]
 5006|  1.07M|                              return false;
 5007|       |
 5008|  1.07M|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|  1.07M|                              probe = value_line;
 5010|  1.07M|                              continue; // blank line
 5011|  1.07M|                           }
 5012|  1.07M|                           if (*value_line == '#') {
 5013|  1.07M|                              yaml::skip_comment(value_line, end);
 5014|  1.07M|                              probe = value_line;
 5015|  1.07M|                              continue; // comment-only line
 5016|  1.07M|                           }
 5017|  1.07M|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|  1.07M|                              it = value_line;
 5019|  1.07M|                              found_value_indicator = true;
 5020|  1.07M|                           }
 5021|  1.07M|                           break;
 5022|  1.07M|                        }
 5023|       |
 5024|  1.07M|                        if (found_value_indicator) {
 5025|  1.07M|                           yaml::skip_inline_ws(it, end);
 5026|  1.07M|                        }
 5027|  1.07M|                     }
 5028|       |
 5029|  1.07M|                     val_t val{};
 5030|  1.07M|                     if (it != end && *it == ':') {
 5031|  1.07M|                        ++it;
 5032|  1.07M|                        if (it != end && *it == '\t') {
 5033|  1.07M|                           ctx.error = error_code::syntax_error;
 5034|  1.07M|                           return false;
 5035|  1.07M|                        }
 5036|  1.07M|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|  1.07M|                           auto probe = it;
 5038|  1.07M|                           yaml::skip_newline(probe, end);
 5039|  1.07M|                           while (probe != end && *probe == ' ') ++probe;
 5040|  1.07M|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|  1.07M|                              ctx.error = error_code::syntax_error;
 5042|  1.07M|                              return false;
 5043|  1.07M|                           }
 5044|  1.07M|                        }
 5045|  1.07M|                        yaml::skip_inline_ws(it, end);
 5046|  1.07M|                        if (!parse_map_value(val)) [[unlikely]]
 5047|  1.07M|                           return false;
 5048|  1.07M|                     }
 5049|       |
 5050|  1.07M|                     value.emplace(std::move(key), std::move(val));
 5051|  1.07M|                     return true;
 5052|  1.07M|                  }
 5053|       |
 5054|  1.07M|                  key_t key{};
 5055|  1.07M|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|  1.07M|                     auto key_probe = it;
 5057|  1.07M|                     yaml::skip_inline_ws(key_probe, end);
 5058|  1.07M|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|  1.07M|                     if (complex_flow_key) {
 5060|  1.07M|                        glz::generic key_node{};
 5061|  1.07M|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  1.07M|                        if (bool(ctx.error)) [[unlikely]]
 5063|  1.07M|                           return false;
 5064|  1.07M|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|  1.07M|                           return false;
 5066|  1.07M|                     }
 5067|  1.07M|                     else {
 5068|  1.07M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|  1.07M|                           return false;
 5070|  1.07M|                        }
 5071|  1.07M|                     }
 5072|  1.07M|                  }
 5073|  1.07M|                  else {
 5074|  1.07M|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|  1.07M|                     if (bool(ctx.error)) [[unlikely]]
 5076|  1.07M|                        return false;
 5077|  1.07M|                  }
 5078|       |
 5079|  1.07M|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|  1.07M|                  if (it == end || *it != ':') {
 5082|  1.07M|                     ctx.error = error_code::syntax_error;
 5083|  1.07M|                     return false;
 5084|  1.07M|                  }
 5085|  1.07M|                  ++it;
 5086|  1.07M|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|  1.07M|                  val_t val{};
 5089|  1.07M|                  if (!parse_map_value(val)) [[unlikely]]
 5090|  1.07M|                     return false;
 5091|       |
 5092|  1.07M|                  value.emplace(std::move(key), std::move(val));
 5093|  1.07M|                  return true;
 5094|  1.07M|               });
 5095|  1.07M|         }
 5096|       |
 5097|  3.16M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|  3.16M|      }
_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|  3.30M|      {
  466|  3.30M|         skip_inline_ws(it, end);
  467|       |
  468|  3.30M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 3.30M]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|  3.30M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  3.30M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 3.30M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  3.30M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 3.30M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  3.30M|         skip_inline_ws(it, end);
  486|       |
  487|  3.30M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 3.30M]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  3.30M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 20.5k, False: 3.28M]
  ------------------
  495|  20.5k|            return true;
  496|  20.5k|         }
  497|       |
  498|  3.28M|         return false;
  499|  3.30M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4521|  3.30M|                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|  3.30M|      {
  409|  3.30M|         state.has_anchor = false;
  410|  3.30M|         state.anchor_name.clear();
  411|  3.30M|         state.anchor_start = nullptr;
  412|  3.30M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  3.30M|         if constexpr (Policy.allow_alias) {
  415|  3.30M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  3.30M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 3.30M, False: 2.01k]
  ------------------
  417|  3.30M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 20.5k, False: 3.28M]
  ------------------
  418|  3.30M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  3.30M|         }
  424|       |
  425|  3.30M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 3.28M, False: 20.5k]
  |  Branch (425:27): [True: 15.1k, False: 3.26M]
  ------------------
  426|  15.1k|            ++it;
  427|  15.1k|            auto name = parse_anchor_name(it, end);
  428|  15.1k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 10, False: 15.1k]
  ------------------
  429|     10|               ctx.error = error_code::syntax_error;
  430|     10|               return true;
  431|     10|            }
  432|  15.1k|            skip_inline_ws(it, end);
  433|  15.1k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 14, False: 15.1k]
  ------------------
  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|  15.1k|            state.has_anchor = true;
  446|  15.1k|            state.anchor_name = std::string(name);
  447|  15.1k|            state.anchor_start = &*it;
  448|  15.1k|         }
  449|       |
  450|  3.30M|         return false;
  451|  3.30M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  3.30M|      {
  301|  3.30M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 3.30M]
  |  Branch (301:27): [True: 3.28M, False: 20.5k]
  ------------------
  302|       |
  303|  20.5k|         ++it; // skip '*'
  304|  20.5k|         auto name = parse_anchor_name(it, end);
  305|  20.5k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 14, False: 20.5k]
  ------------------
  306|     14|            ctx.error = error_code::syntax_error;
  307|     14|            return true;
  308|     14|         }
  309|       |
  310|  20.5k|         auto anchor_it = ctx.anchors.find(name);
  311|  20.5k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 50, False: 20.4k]
  ------------------
  312|     50|            ctx.error = error_code::syntax_error; // undefined alias
  313|     50|            return true;
  314|     50|         }
  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|  20.4k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  20.4k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 4.00k, False: 16.4k]
  ------------------
  322|  4.00k|            return true;
  323|  4.00k|         }
  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.4k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 40, False: 16.4k]
  ------------------
  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|  16.4k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  16.4k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 6, False: 16.4k]
  ------------------
  339|      6|            return true;
  340|       |
  341|  16.4k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 16.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|  16.4k|         auto replay_it = span.begin;
  348|  16.4k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  16.4k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  16.4k|         ctx.indent_stack.clear();
  353|  16.4k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.21k, False: 15.2k]
  ------------------
  354|  1.21k|            ctx.push_indent(span.base_indent - 1);
  355|  1.21k|         }
  356|       |
  357|  16.4k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  16.4k|         using V = std::remove_cvref_t<T>;
  360|  16.4k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  16.4k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  16.4k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  16.4k|         return true;
  367|  16.4k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|  10.3M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|  10.3M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  10.3M|                     val = glz::generic{};
 4665|  10.3M|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|  10.3M|               };
_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_:
 3633|  1.07M|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|  1.07M|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 1.07M]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|  1.07M|         const int32_t parent_indent = ctx.current_indent();
 3644|  1.07M|         const bool discover_indent = (mapping_indent < 0);
 3645|  1.07M|         bool first_key = !discover_indent;
 3646|  1.07M|         bool discovered_first_key_mid_line = false;
 3647|  1.07M|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|  2.41M|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 1.43M, False: 979k]
  ------------------
 3650|  1.43M|            auto line_start = it;
 3651|  1.43M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 1.43M]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|  1.65M|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 1.63M, False: 21.8k]
  ------------------
 3655|  1.63M|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 46.2k, False: 1.59M]
  ------------------
 3656|  46.2k|                  skip_comment(it, end);
 3657|  46.2k|                  skip_newline(it, end);
 3658|  46.2k|                  first_key = false;
 3659|  46.2k|                  line_indent = 0;
 3660|  46.2k|               }
 3661|  1.59M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 42.2k, False: 1.54M]
  |  Branch (3661:40): [True: 89.9k, False: 1.45M]
  ------------------
 3662|   132k|                  skip_newline(it, end);
 3663|   132k|                  first_key = false;
 3664|   132k|                  line_indent = 0;
 3665|   132k|               }
 3666|  1.45M|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 151k, False: 1.30M]
  ------------------
 3667|   151k|                  line_start = it;
 3668|   151k|                  line_indent = 0;
 3669|   369k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 365k, False: 3.65k]
  |  Branch (3669:39): [True: 217k, False: 148k]
  ------------------
 3670|   217k|                     ++line_indent;
 3671|   217k|                     ++it;
 3672|   217k|                  }
 3673|       |
 3674|   151k|                  bool saw_tab = false;
 3675|   156k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 152k, False: 3.85k]
  |  Branch (3675:40): [True: 636, False: 152k]
  |  Branch (3675:54): [True: 4.33k, False: 147k]
  ------------------
 3676|  4.97k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 3.47k, False: 1.49k]
  |  Branch (3676:43): [True: 1.49k, False: 0]
  ------------------
 3677|  4.97k|                     ++it;
 3678|  4.97k|                  }
 3679|       |
 3680|   151k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 3.85k, False: 147k]
  |  Branch (3680:36): [True: 11.3k, False: 136k]
  |  Branch (3680:51): [True: 8.28k, False: 128k]
  |  Branch (3680:66): [True: 8.15k, False: 120k]
  ------------------
 3681|  31.6k|                     first_key = false;
 3682|  31.6k|                     line_indent = 0;
 3683|  31.6k|                     continue; // Blank or comment line
 3684|  31.6k|                  }
 3685|       |
 3686|   120k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 10, False: 120k]
  ------------------
 3687|     10|                     ctx.error = error_code::syntax_error;
 3688|     10|                     return;
 3689|     10|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|   120k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 116k, False: 4.11k]
  |  Branch (3692:46): [True: 656, False: 115k]
  ------------------
 3693|    656|                     it = line_start;
 3694|    656|                     return;
 3695|    656|                  }
 3696|       |
 3697|   119k|                  first_key = false;
 3698|   119k|                  break; // Found content
 3699|   120k|               }
 3700|  1.30M|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 8.60k, False: 1.29M]
  ------------------
 3701|  8.60k|                  line_start = it;
 3702|  21.0k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 20.0k, False: 1.00k]
  |  Branch (3702:40): [True: 1.10k, False: 18.9k]
  |  Branch (3702:54): [True: 11.3k, False: 7.60k]
  ------------------
 3703|  8.60k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 1.00k, False: 7.60k]
  |  Branch (3703:36): [True: 1.04k, False: 6.55k]
  |  Branch (3703:51): [True: 3.43k, False: 3.12k]
  |  Branch (3703:66): [True: 3.10k, False: 22]
  ------------------
 3704|  8.58k|                     first_key = false;
 3705|  8.58k|                     line_indent = 0;
 3706|  8.58k|                     continue; // Blank or comment-only line with tab indentation
 3707|  8.58k|                  }
 3708|     22|                  ctx.error = error_code::syntax_error;
 3709|     22|                  return;
 3710|  8.60k|               }
 3711|  1.29M|               else {
 3712|  1.29M|                  line_start = it;
 3713|  1.29M|                  break; // Content at column 0
 3714|  1.29M|               }
 3715|  1.63M|            }
 3716|       |
 3717|  1.43M|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 21.8k, False: 1.41M]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|  1.41M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 772, False: 1.41M]
  |  Branch (3721:45): [True: 1.90k, False: 1.41M]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|  1.41M|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 1.41M, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|  1.41M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 1.41M, False: 0]
  |  Branch (3728:39): [True: 343k, False: 1.07M]
  |  Branch (3728:62): [True: 67.3k, False: 275k]
  |  Branch (3728:84): [True: 47.0k, False: 20.3k]
  ------------------
 3729|  47.0k|                  it = line_start;
 3730|  47.0k|                  return;
 3731|  47.0k|               }
 3732|  1.36M|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 296k, False: 1.07M]
  |  Branch (3732:43): [True: 80, False: 296k]
  ------------------
 3733|     80|                  it = line_start;
 3734|     80|                  return;
 3735|     80|               }
 3736|  1.36M|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|  1.36M|            bool established_mapping_indent_this_line = false;
 3740|  1.36M|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 1.07M, False: 296k]
  ------------------
 3741|  1.07M|               mapping_indent = line_indent;
 3742|  1.07M|               established_mapping_indent_this_line = true;
 3743|  1.07M|               discovered_first_key_visual_indent = line_indent;
 3744|  1.07M|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|  1.07M|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 1.07M, False: 0]
  |  Branch (3745:43): [True: 1.07M, False: 0]
  ------------------
 3746|  1.07M|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|  1.07M|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 58, False: 1.07M]
  ------------------
 3748|     58|                        ctx.error = error_code::syntax_error;
 3749|     58|                        return;
 3750|     58|                     }
 3751|       |
 3752|  1.07M|                     discovered_first_key_mid_line = prefix.has_content;
 3753|  1.07M|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 1.06M, False: 4.11k]
  |  Branch (3753:49): [True: 795k, False: 271k]
  ------------------
 3754|   795k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   795k|                     }
 3756|  1.07M|                  }
 3757|  1.07M|               }
 3758|  1.07M|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|  1.36M|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 1.36M, False: 58]
  |  Branch (3762:36): [True: 1.36M, False: 0]
  |  Branch (3762:59): [True: 296k, False: 1.07M]
  ------------------
 3763|   296k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 56.2k, False: 239k]
  ------------------
 3764|  56.2k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 56.0k, False: 242]
  |  Branch (3764:43): [True: 30.3k, False: 25.7k]
  ------------------
 3765|  30.3k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 6, False: 30.3k]
  ------------------
 3766|      6|                     ctx.error = error_code::syntax_error;
 3767|      6|                     return;
 3768|      6|                  }
 3769|  30.3k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 3.11k, False: 27.2k]
  ------------------
 3770|  3.11k|                     it = line_start;
 3771|  3.11k|                     return;
 3772|  3.11k|                  }
 3773|  30.3k|               }
 3774|  25.9k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 892, False: 25.0k]
  ------------------
 3775|    892|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 6, False: 886]
  |  Branch (3775:47): [True: 0, False: 886]
  ------------------
 3776|    886|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 886, False: 0]
  |  Branch (3776:49): [True: 886, False: 0]
  |  Branch (3776:72): [True: 6, False: 880]
  ------------------
 3777|     12|                  ctx.error = error_code::syntax_error;
 3778|     12|                  return;
 3779|     12|               }
 3780|  56.2k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|  1.36M|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 1.36M]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|  1.36M|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 1.36M]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|  1.36M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 58, False: 1.36M]
  |  Branch (3798:32): [True: 0, False: 1.36M]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|  1.36M|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 211k, False: 1.15M]
  |  Branch (3807:53): [True: 29.4k, False: 182k]
  |  Branch (3807:94): [True: 4.83k, False: 24.6k]
  ------------------
 3808|  4.83k|               const auto after_colon = it + 1;
 3809|  4.83k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 4.33k, False: 504]
  ------------------
 3810|  4.83k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 94, False: 4.74k]
  |  Branch (3810:43): [True: 3.54k, False: 1.19k]
  ------------------
 3811|  3.64k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 114, False: 3.52k]
  ------------------
 3812|    114|                  it = line_start;
 3813|    114|                  return;
 3814|    114|               }
 3815|  4.83k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|  1.36M|            int32_t effective_line_indent = line_indent;
 3819|  1.36M|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 1.36M, False: 58]
  |  Branch (3819:36): [True: 1.07M, False: 292k]
  ------------------
 3820|  1.07M|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 795k, False: 275k]
  ------------------
 3821|   795k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 679k, False: 116k]
  |  Branch (3821:52): [True: 478k, False: 201k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   317k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   317k|            }
 3834|       |
 3835|  1.36M|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 16.6k, False: 1.34M]
  ------------------
 3836|  16.6k|               return;
 3837|  16.6k|            }
 3838|  1.34M|            first_key = false;
 3839|       |
 3840|  1.34M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 1.34M]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|  1.34M|            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|  1.34M|               auto flow_end = it;
 3847|  1.34M|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|  1.34M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3848:20): [True: 6, False: 1.34M]
  ------------------
 3849|      6|                  return;
 3850|  1.34M|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3850:20): [True: 1.12M, False: 219k]
  |  Branch (3850:40): [True: 623k, False: 504k]
  |  Branch (3850:60): [True: 16.6k, False: 487k]
  |  Branch (3850:80): [True: 140k, False: 346k]
  ------------------
 3851|   781k|                  it = flow_end;
 3852|   781k|                  return;
 3853|   781k|               }
 3854|  1.34M|            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|  1.34M|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 435k, False: 911k]
  ------------------
 3860|   435k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 145k, False: 289k]
  |  Branch (3860:34): [True: 5.10k, False: 284k]
  ------------------
 3861|   151k|                  auto peek = it;
 3862|   151k|                  skip_inline_ws(peek, end);
 3863|   151k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 101k, False: 49.6k]
  |  Branch (3863:38): [True: 97.6k, False: 3.73k]
  |  Branch (3863:55): [True: 92.8k, False: 4.80k]
  |  Branch (3863:72): [True: 91.2k, False: 1.61k]
  ------------------
 3864|  91.2k|                     continue; // At leading indent of new line
 3865|  91.2k|                  }
 3866|   151k|               }
 3867|   344k|               skip_inline_ws(it, end);
 3868|   344k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 294k, False: 49.6k]
  |  Branch (3868:33): [True: 10.3k, False: 284k]
  ------------------
 3869|  10.3k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  10.3k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 10.3k, False: 0]
  ------------------
 3871|  10.3k|                        const char prev = *(it - 1);
 3872|  10.3k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 4.47k, False: 5.91k]
  |  Branch (3872:44): [True: 3.22k, False: 1.25k]
  |  Branch (3872:60): [True: 614, False: 2.60k]
  |  Branch (3872:76): [True: 6, False: 608]
  ------------------
 3873|      6|                           ctx.error = error_code::syntax_error;
 3874|      6|                           return;
 3875|      6|                        }
 3876|  10.3k|                     }
 3877|  10.3k|                  }
 3878|  10.3k|               }
 3879|  10.3k|               skip_comment(it, end);
 3880|   344k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 294k, False: 49.6k]
  |  Branch (3880:34): [True: 76.1k, False: 218k]
  |  Branch (3880:49): [True: 99.9k, False: 118k]
  ------------------
 3881|   176k|                  skip_newline(it, end);
 3882|   176k|               }
 3883|   168k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 118k, False: 49.6k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|   118k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|   118k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 88, False: 118k]
  ------------------
 3890|     88|                        ctx.error = error_code::syntax_error;
 3891|     88|                        return;
 3892|     88|                     }
 3893|   118k|                  }
 3894|   118k|               }
 3895|   344k|            }
 3896|  1.34M|         }
 3897|  1.07M|      }
_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:
 4777|  1.36M|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|  1.36M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|  1.36M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|  1.36M|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|  1.36M|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|  1.36M|                           if (ctx.stream_begin) {
 4788|  1.36M|                              auto is_line_content_start = [&](auto pos) {
 4789|  1.36M|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|  1.36M|                              };
 4791|       |
 4792|  1.36M|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|  1.36M|                                 const char* line = ctx.line_begin_of(pos);
 4794|  1.36M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|  1.36M|                                 return line != end && *line == ':';
 4796|  1.36M|                              };
 4797|       |
 4798|  1.36M|                              if (!is_line_content_start(it) &&
 4799|  1.36M|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|  1.36M|                                  !line_has_explicit_value_indicator(it)) {
 4801|  1.36M|                                 ctx.error = error_code::syntax_error;
 4802|  1.36M|                                 return false;
 4803|  1.36M|                              }
 4804|  1.36M|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|  1.36M|                           }
 4806|  1.36M|                        }
 4807|       |
 4808|  1.36M|                        if (*it == '-' &&
 4809|  1.36M|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|  1.36M|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|  1.36M|                           ctx.error = error_code::syntax_error;
 4813|  1.36M|                           return false;
 4814|  1.36M|                        }
 4815|       |
 4816|  1.36M|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|  1.36M|                           return false;
 4818|  1.36M|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|  1.36M|                        ctx.pop_indent();
 4820|  1.36M|                     }
 4821|  1.36M|                     else {
 4822|  1.36M|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|  1.36M|                        if (nested_indent >= 0) {
 4824|  1.36M|                           yaml::skip_to_content(it, end);
 4825|  1.36M|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|  1.36M|                              ctx.error = error_code::syntax_error;
 4827|  1.36M|                              return false;
 4828|  1.36M|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  1.36M|                           const int32_t value_indent =
 4832|  1.36M|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|  1.36M|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|  1.36M|                              return false;
 4835|  1.36M|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  1.36M|                           ctx.pop_indent();
 4837|  1.36M|                        }
 4838|  1.36M|                     }
 4839|  1.36M|                     return !bool(ctx.error);
 4840|  1.36M|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|  1.36M|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 505k, False: 858k]
  |  Branch (4845:37): [True: 505k, False: 118]
  |  Branch (4845:58): [True: 6, False: 505k]
  ------------------
 4846|      6|                     ctx.error = error_code::syntax_error;
 4847|      6|                     return false;
 4848|      6|                  }
 4849|  1.36M|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 505k, False: 858k]
  |  Branch (4849:38): [True: 118, False: 505k]
  |  Branch (4849:57): [True: 219k, False: 285k]
  |  Branch (4849:77): [True: 162k, False: 123k]
  |  Branch (4849:98): [True: 111k, False: 11.4k]
  ------------------
 4850|   494k|                     ++it; // skip '?'
 4851|   494k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   494k|                     const int32_t explicit_value_indicator_indent =
 4854|   494k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 365k, False: 128k]
  ------------------
 4855|       |
 4856|   494k|                     key_t key{};
 4857|   494k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   494k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   494k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   494k|                        };
 4861|       |
 4862|   494k|                        auto key_it = it;
 4863|   494k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   494k|                        auto content = key_it;
 4866|   494k|                        yaml::skip_to_content(content, end);
 4867|   494k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   494k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 481k, False: 12.7k]
  |  Branch (4872:47): [True: 176k, False: 305k]
  ------------------
 4873|   176k|                           auto anchor_probe = content + 1;
 4874|   176k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   176k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 176k, False: 14]
  ------------------
 4876|   176k|                              auto after_anchor = anchor_probe;
 4877|   176k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   176k|                              auto value_indicator = after_anchor;
 4880|   176k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 173k, False: 2.28k]
  |  Branch (4880:61): [True: 5.30k, False: 168k]
  ------------------
 4881|  5.30k|                                 key.clear();
 4882|  5.30k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  5.30k|                                 it = value_indicator;
 4884|  5.30k|                                 handled_anchor_only_empty_key = true;
 4885|  5.30k|                              }
 4886|   170k|                              else {
 4887|   170k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 168k, False: 2.28k]
  |  Branch (4887:64): [True: 4.26k, False: 164k]
  ------------------
 4888|  4.26k|                                    yaml::skip_comment(value_indicator, end);
 4889|  4.26k|                                 }
 4890|   170k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 168k, False: 2.28k]
  |  Branch (4890:65): [True: 58.3k, False: 110k]
  |  Branch (4890:93): [True: 38.4k, False: 71.6k]
  ------------------
 4891|  96.8k|                                    yaml::skip_newline(value_indicator, end);
 4892|  96.8k|                                    auto value_line = value_indicator;
 4893|  96.8k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  96.8k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 6, False: 96.8k]
  ------------------
 4895|      6|                                       return false;
 4896|  96.8k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 93.8k, False: 3.00k]
  |  Branch (4896:62): [True: 14.1k, False: 79.6k]
  ------------------
 4897|  14.1k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 14.1k, False: 6]
  ------------------
 4898|  14.1k|                                       key.clear();
 4899|  14.1k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  14.1k|                                       it = value_line;
 4901|  14.1k|                                       handled_anchor_only_empty_key = true;
 4902|  14.1k|                                    }
 4903|  82.6k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 79.6k, False: 3.00k]
  |  Branch (4903:67): [True: 6, False: 79.6k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|      6|                                       ctx.error = error_code::syntax_error;
 4908|      6|                                       return false;
 4909|      6|                                    }
 4910|  96.8k|                                 }
 4911|   170k|                              }
 4912|   176k|                           }
 4913|   176k|                        }
 4914|       |
 4915|   494k|                        const bool key_content_spans_lines = [&] {
 4916|   494k|                           auto scan = key_it;
 4917|   494k|                           while (scan != content && scan != end) {
 4918|   494k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   494k|                              ++scan;
 4920|   494k|                           }
 4921|   494k|                           return false;
 4922|   494k|                        }();
 4923|       |
 4924|   494k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 19.4k, False: 474k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  19.4k|                        }
 4927|   474k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 12.7k, False: 462k]
  |  Branch (4927:53): [True: 12.4k, False: 449k]
  |  Branch (4927:72): [True: 5.59k, False: 6.81k]
  ------------------
 4928|  18.3k|                           key.clear();
 4929|  18.3k|                           it = content;
 4930|  18.3k|                        }
 4931|   456k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   456k|                           auto key_node_it = content;
 4937|   456k|                           auto key_node_end = end;
 4938|   456k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   456k|                              auto scan = content;
 4943|  5.62M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 5.56M, False: 61.3k]
  ------------------
 4944|   101M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 101M, False: 271k]
  |  Branch (4944:56): [True: 98.5M, False: 2.69M]
  |  Branch (4944:73): [True: 95.9M, False: 2.59M]
  ------------------
 4945|  95.9M|                                    ++scan;
 4946|  95.9M|                                 }
 4947|  5.56M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 271k, False: 5.28M]
  ------------------
 4948|   271k|                                    break;
 4949|   271k|                                 }
 4950|       |
 4951|  5.28M|                                 yaml::skip_newline(scan, end);
 4952|  5.28M|                                 auto line_start = scan;
 4953|       |
 4954|  5.28M|                                 int32_t indicator_indent = 0;
 4955|  6.90M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 6.83M, False: 61.3k]
  |  Branch (4955:56): [True: 1.61M, False: 5.22M]
  ------------------
 4956|  1.61M|                                    ++indicator_indent;
 4957|  1.61M|                                    ++scan;
 4958|  1.61M|                                 }
 4959|       |
 4960|  5.28M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 5.22M, False: 61.3k]
  |  Branch (4960:53): [True: 265k, False: 4.96M]
  ------------------
 4961|   265k|                                    const auto after_colon = scan + 1;
 4962|   265k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 246, False: 264k]
  ------------------
 4963|   264k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 151k, False: 113k]
  ------------------
 4964|   151k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 123k, False: 27.8k]
  ------------------
 4965|   123k|                                       key_node_end = line_start;
 4966|   123k|                                       break;
 4967|   123k|                                    }
 4968|   265k|                                 }
 4969|  5.28M|                              }
 4970|   456k|                           }
 4971|       |
 4972|   456k|                           glz::generic key_node{};
 4973|   456k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   456k|                           ctx.explicit_mapping_key_context = true;
 4975|   456k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   456k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   456k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 3.11k, False: 453k]
  ------------------
 4978|  3.11k|                              return false;
 4979|   453k|                           it = key_node_it;
 4980|   453k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 8, False: 453k]
  ------------------
 4981|      8|                              return false;
 4982|   453k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   491k|                     yaml::skip_inline_ws(it, end);
 4993|   494k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   494k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 430k, False: 64.0k]
  |  Branch (4996:40): [True: 40.5k, False: 389k]
  |  Branch (4996:55): [True: 85.1k, False: 304k]
  ------------------
 4997|   125k|                        auto probe = it;
 4998|   125k|                        bool found_value_indicator = false;
 4999|       |
 5000|   303k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 286k, False: 17.1k]
  |  Branch (5000:49): [True: 81.8k, False: 204k]
  |  Branch (5000:67): [True: 204k, False: 0]
  ------------------
 5001|   286k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   286k|                           auto value_line = probe;
 5004|   286k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   286k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 18, False: 286k]
  ------------------
 5006|     18|                              return false;
 5007|       |
 5008|   286k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 11.3k, False: 274k]
  |  Branch (5008:53): [True: 35.5k, False: 239k]
  |  Branch (5008:76): [True: 103k, False: 135k]
  ------------------
 5009|   150k|                              probe = value_line;
 5010|   150k|                              continue; // blank line
 5011|   150k|                           }
 5012|   135k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 27.0k, False: 108k]
  ------------------
 5013|  27.0k|                              yaml::skip_comment(value_line, end);
 5014|  27.0k|                              probe = value_line;
 5015|  27.0k|                              continue; // comment-only line
 5016|  27.0k|                           }
 5017|   108k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 39.8k, False: 68.6k]
  |  Branch (5017:54): [True: 36.2k, False: 3.54k]
  ------------------
 5018|  36.2k|                              it = value_line;
 5019|  36.2k|                              found_value_indicator = true;
 5020|  36.2k|                           }
 5021|   108k|                           break;
 5022|   135k|                        }
 5023|       |
 5024|   125k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 36.2k, False: 89.3k]
  ------------------
 5025|  36.2k|                           yaml::skip_inline_ws(it, end);
 5026|  36.2k|                        }
 5027|   125k|                     }
 5028|       |
 5029|   494k|                     val_t val{};
 5030|   494k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 430k, False: 64.0k]
  |  Branch (5030:39): [True: 147k, False: 282k]
  ------------------
 5031|   147k|                        ++it;
 5032|   147k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 146k, False: 690]
  |  Branch (5032:42): [True: 6, False: 146k]
  ------------------
 5033|      6|                           ctx.error = error_code::syntax_error;
 5034|      6|                           return false;
 5035|      6|                        }
 5036|   147k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 146k, False: 690]
  |  Branch (5036:43): [True: 9.86k, False: 137k]
  |  Branch (5036:58): [True: 26.0k, False: 111k]
  ------------------
 5037|  35.9k|                           auto probe = it;
 5038|  35.9k|                           yaml::skip_newline(probe, end);
 5039|   116k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 110k, False: 5.81k]
  |  Branch (5039:51): [True: 80.5k, False: 30.0k]
  ------------------
 5040|  35.9k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 30.0k, False: 5.81k]
  |  Branch (5040:48): [True: 716, False: 29.3k]
  |  Branch (5040:65): [True: 712, False: 4]
  |  Branch (5040:89): [True: 0, False: 712]
  ------------------
 5041|      0|                              ctx.error = error_code::syntax_error;
 5042|      0|                              return false;
 5043|      0|                           }
 5044|  35.9k|                        }
 5045|   147k|                        yaml::skip_inline_ws(it, end);
 5046|   147k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 442, False: 147k]
  ------------------
 5047|    442|                           return false;
 5048|   147k|                     }
 5049|       |
 5050|   493k|                     value.emplace(std::move(key), std::move(val));
 5051|   493k|                     return true;
 5052|   494k|                  }
 5053|       |
 5054|   869k|                  key_t key{};
 5055|   869k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   869k|                     auto key_probe = it;
 5057|   869k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   869k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 869k, False: 0]
  |  Branch (5058:74): [True: 492, False: 869k]
  |  Branch (5058:95): [True: 1.74k, False: 867k]
  ------------------
 5059|   869k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 2.24k, False: 867k]
  ------------------
 5060|  2.24k|                        glz::generic key_node{};
 5061|  2.24k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  2.24k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 760, False: 1.48k]
  ------------------
 5063|    760|                           return false;
 5064|  1.48k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 0, False: 1.48k]
  ------------------
 5065|      0|                           return false;
 5066|  1.48k|                     }
 5067|   867k|                     else {
 5068|   867k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 10.1k, False: 857k]
  ------------------
 5069|  10.1k|                           return false;
 5070|  10.1k|                        }
 5071|   867k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   858k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   869k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 11.0k, False: 858k]
  |  Branch (5081:36): [True: 94, False: 858k]
  ------------------
 5082|    228|                     ctx.error = error_code::syntax_error;
 5083|    228|                     return false;
 5084|    228|                  }
 5085|   869k|                  ++it;
 5086|   869k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   869k|                  val_t val{};
 5089|   869k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 1.95k, False: 867k]
  ------------------
 5090|  1.95k|                     return false;
 5091|       |
 5092|   867k|                  value.emplace(std::move(key), std::move(val));
 5093|   867k|                  return true;
 5094|   869k|               });
_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:
 4915|   494k|                        const bool key_content_spans_lines = [&] {
 4916|   494k|                           auto scan = key_it;
 4917|   525k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 328k, False: 196k]
  |  Branch (4917:54): [True: 328k, False: 0]
  ------------------
 4918|   328k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 164k, False: 164k]
  |  Branch (4918:52): [True: 133k, False: 30.8k]
  ------------------
 4919|  30.8k|                              ++scan;
 4920|  30.8k|                           }
 4921|   196k|                           return false;
 4922|   494k|                        }();
_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_:
 4858|   453k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   453k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   453k|                        };
_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_:
 4778|  1.00M|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|  1.00M|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 985k, False: 21.0k]
  |  Branch (4779:39): [True: 604k, False: 380k]
  ------------------
 4780|   604k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   604k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   604k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 604k, False: 0]
  ------------------
 4788|   604k|                              auto is_line_content_start = [&](auto pos) {
 4789|   604k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   604k|                              };
 4791|       |
 4792|   604k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   604k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   604k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   604k|                                 return line != end && *line == ':';
 4796|   604k|                              };
 4797|       |
 4798|   604k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 604k, False: 0]
  ------------------
 4799|   604k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 110k, False: 493k]
  ------------------
 4800|   110k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 18, False: 110k]
  ------------------
 4801|     18|                                 ctx.error = error_code::syntax_error;
 4802|     18|                                 return false;
 4803|     18|                              }
 4804|   604k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   604k|                           }
 4806|   604k|                        }
 4807|       |
 4808|   604k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 13.8k, False: 590k]
  ------------------
 4809|  13.8k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 8, False: 13.8k]
  |  Branch (4809:49): [True: 6.92k, False: 6.91k]
  ------------------
 4810|  6.93k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 12, False: 6.92k]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|     12|                           ctx.error = error_code::syntax_error;
 4813|     12|                           return false;
 4814|     12|                        }
 4815|       |
 4816|   604k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 604k]
  ------------------
 4817|      0|                           return false;
 4818|   604k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   604k|                        ctx.pop_indent();
 4820|   604k|                     }
 4821|   401k|                     else {
 4822|   401k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   401k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 188k, False: 213k]
  ------------------
 4824|   188k|                           yaml::skip_to_content(it, end);
 4825|   188k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 188k, False: 0]
  |  Branch (4825:45): [True: 0, False: 188k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   188k|                           const int32_t value_indent =
 4832|   188k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 188k]
  ------------------
 4833|   188k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 188k]
  ------------------
 4834|      0|                              return false;
 4835|   188k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   188k|                           ctx.pop_indent();
 4837|   188k|                        }
 4838|   401k|                     }
 4839|  1.00M|                     return !bool(ctx.error);
 4840|  1.00M|                  };
_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_:
 4788|   604k|                              auto is_line_content_start = [&](auto pos) {
 4789|   604k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   604k|                              };
_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_:
 4792|   714k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   714k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   945k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 945k, False: 0]
  |  Branch (4794:57): [True: 230k, False: 715k]
  |  Branch (4794:73): [True: 618, False: 714k]
  ------------------
 4795|   714k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 714k, False: 0]
  |  Branch (4795:56): [True: 440k, False: 274k]
  ------------------
 4796|   714k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|  3.28M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  3.28M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 3.28M]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|  3.28M|            }
_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_:
 5205|  1.57M|      {
 5206|  1.57M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  1.57M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  1.57M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  1.57M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  1.57M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 1.57M, False: 0]
  ------------------
 5216|  1.57M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  1.57M|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4098|  1.73M|      {
 4099|  1.73M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 1.73M]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|  1.73M|         auto peek = it;
 4104|  1.73M|         yaml::node_preamble_state preamble{};
 4105|  1.73M|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 170k, False: 1.56M]
  ------------------
 4106|  1.73M|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|   170k|            it = peek;
 4108|   170k|            return;
 4109|   170k|         }
 4110|       |
 4111|  1.56M|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 173k, False: 1.39M]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|   173k|            it = peek;
 4114|   173k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|   173k|         }
 4116|  1.39M|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 1.39M, False: 132]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|  1.39M|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 7.43k, False: 1.38M]
  |  Branch (4119:57): [True: 2.88k, False: 1.38M]
  ------------------
 4120|  10.3k|               it = peek;
 4121|  10.3k|            }
 4122|  1.39M|            int32_t seq_indent = ctx.current_indent();
 4123|  1.39M|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 1.39M, False: 2.17k]
  |  Branch (4123:31): [True: 389k, False: 1.00M]
  ------------------
 4124|   389k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 18.4k, False: 370k]
  |  Branch (4124:62): [True: 9.46k, False: 8.94k]
  ------------------
 4125|   389k|                                                          : (ctx.current_indent() + 1);
 4126|   389k|            }
 4127|  1.39M|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|  1.39M|         }
 4129|    132|         else {
 4130|    132|            ctx.error = error_code::syntax_error;
 4131|    132|         }
 4132|       |
 4133|  1.56M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|  1.56M|      }
_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|  1.73M|      {
  466|  1.73M|         skip_inline_ws(it, end);
  467|       |
  468|  1.73M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 10, False: 1.73M]
  ------------------
  469|     10|            if constexpr (!AllowEmptyInput) {
  470|     10|               ctx.error = error_code::unexpected_end;
  471|     10|            }
  472|     10|            return true;
  473|     10|         }
  474|       |
  475|  1.73M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.73M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 1.73M]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  1.73M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 1.73M]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  1.73M|         skip_inline_ws(it, end);
  486|       |
  487|  1.73M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 1.73M]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  1.73M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 170k, False: 1.56M]
  ------------------
  495|   170k|            return true;
  496|   170k|         }
  497|       |
  498|  1.56M|         return false;
  499|  1.73M|      }
_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_:
 4106|  1.73M|                                             [](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|  1.73M|      {
  409|  1.73M|         state.has_anchor = false;
  410|  1.73M|         state.anchor_name.clear();
  411|  1.73M|         state.anchor_start = nullptr;
  412|  1.73M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.73M|         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.73M|            else {
  421|  1.73M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 169k, False: 1.56M]
  ------------------
  422|  1.73M|            }
  423|  1.73M|         }
  424|       |
  425|  1.73M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.56M, False: 169k]
  |  Branch (425:27): [True: 3.31k, False: 1.56M]
  ------------------
  426|  3.31k|            ++it;
  427|  3.31k|            auto name = parse_anchor_name(it, end);
  428|  3.31k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 14, False: 3.29k]
  ------------------
  429|     14|               ctx.error = error_code::syntax_error;
  430|     14|               return true;
  431|     14|            }
  432|  3.29k|            skip_inline_ws(it, end);
  433|  3.29k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 24, False: 3.27k]
  ------------------
  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|  3.27k|            state.has_anchor = true;
  446|  3.27k|            state.anchor_name = std::string(name);
  447|  3.27k|            state.anchor_start = &*it;
  448|  3.27k|         }
  449|       |
  450|  1.73M|         return false;
  451|  1.73M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|  1.73M|      {
  301|  1.73M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.73M]
  |  Branch (301:27): [True: 1.56M, False: 169k]
  ------------------
  302|       |
  303|   169k|         ++it; // skip '*'
  304|   169k|         auto name = parse_anchor_name(it, end);
  305|   169k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 20, False: 169k]
  ------------------
  306|     20|            ctx.error = error_code::syntax_error;
  307|     20|            return true;
  308|     20|         }
  309|       |
  310|   169k|         auto anchor_it = ctx.anchors.find(name);
  311|   169k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 26, False: 169k]
  ------------------
  312|     26|            ctx.error = error_code::syntax_error; // undefined alias
  313|     26|            return true;
  314|     26|         }
  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|   169k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   169k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 3.78k, False: 166k]
  ------------------
  322|  3.78k|            return true;
  323|  3.78k|         }
  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|   166k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 44, False: 166k]
  ------------------
  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|   166k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   166k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 166k]
  ------------------
  339|      0|            return true;
  340|       |
  341|   166k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 166k]
  ------------------
  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|   166k|         auto replay_it = span.begin;
  348|   166k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   166k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   166k|         ctx.indent_stack.clear();
  353|   166k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.29k, False: 163k]
  ------------------
  354|  2.29k|            ctx.push_indent(span.base_indent - 1);
  355|  2.29k|         }
  356|       |
  357|   166k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   166k|         using V = std::remove_cvref_t<T>;
  360|   166k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   166k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   166k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   166k|         return true;
  367|   166k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|   173k|      {
 2597|   173k|         using V = std::remove_cvref_t<T>;
 2598|   173k|         using value_type = typename V::value_type;
 2599|       |
 2600|   173k|         struct sequence_container_adapter
 2601|   173k|         {
 2602|   173k|            size_t index = 0;
 2603|       |
 2604|   173k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|   173k|            {
 2606|   173k|               if constexpr (!resizable<V>) {
 2607|   173k|                  return index >= container.size();
 2608|   173k|               }
 2609|   173k|               else {
 2610|   173k|                  (void)container;
 2611|   173k|                  return false;
 2612|   173k|               }
 2613|   173k|            }
 2614|       |
 2615|   173k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|   173k|            inline void append(V& container, value_type&& element) noexcept
 2618|   173k|            {
 2619|   173k|               if constexpr (emplace_backable<V>) {
 2620|   173k|                  container.emplace_back(std::move(element));
 2621|   173k|               }
 2622|   173k|               else if constexpr (emplaceable<V>) {
 2623|   173k|                  container.emplace(std::move(element));
 2624|   173k|               }
 2625|   173k|            }
 2626|   173k|         };
 2627|       |
 2628|   173k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 173k]
  |  Branch (2628:27): [True: 0, False: 173k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|   173k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|   173k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|   173k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|   173k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 6, False: 173k]
  ------------------
 2641|      6|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|   173k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 172k, False: 520]
  |  Branch (2644:27): [True: 16.9k, False: 156k]
  ------------------
 2645|  16.9k|            ++it;
 2646|  16.9k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  16.9k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 6, False: 16.9k]
  ------------------
 2648|      6|               return;
 2649|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|       |               if (ctx.current_indent() < 0) {
 2651|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|       |               }
 2653|       |            }
 2654|  16.9k|            return;
 2655|  16.9k|         }
 2656|       |
 2657|   156k|         bool just_saw_comma = false;
 2658|   156k|         sequence_container_adapter adapter{};
 2659|       |
 2660|   156k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|   204k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 203k, False: 542]
  ------------------
 2663|   203k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|   203k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 203k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|   203k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 203k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|   203k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 13.8k, False: 190k]
  ------------------
 2673|  13.8k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 13.8k, False: 0]
  ------------------
 2674|  13.8k|                     ++it;
 2675|  13.8k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  13.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 6, False: 13.8k]
  ------------------
 2677|      6|                        return;
 2678|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|       |                        if (ctx.current_indent() < 0) {
 2680|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|       |                        }
 2682|       |                     }
 2683|  13.8k|                     return;
 2684|  13.8k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  13.8k|               }
 2688|       |
 2689|   190k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 6, False: 190k]
  |  Branch (2689:34): [True: 18, False: 190k]
  ------------------
 2690|     24|                  ctx.error = error_code::syntax_error;
 2691|     24|                  return;
 2692|     24|               }
 2693|   190k|               just_saw_comma = false;
 2694|       |
 2695|   190k|               value_type element{};
 2696|   190k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|   190k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 3.68k, False: 186k]
  ------------------
 2699|  3.68k|                  return;
 2700|       |
 2701|   186k|               bool saw_line_break_before_separator = false;
 2702|   186k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|   186k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 14, False: 186k]
  ------------------
 2704|     14|                  return;
 2705|       |
 2706|   186k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 186k, False: 344]
  |  Branch (2706:33): [True: 14.0k, False: 172k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  14.0k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 6, False: 14.0k]
  ------------------
 2709|      6|                     ctx.error = error_code::syntax_error;
 2710|      6|                     return;
 2711|      6|                  }
 2712|  14.0k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  14.0k|                     glz::generic key_node = std::move(element);
 2714|  14.0k|                     ++it;
 2715|  14.0k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  14.0k|                     glz::generic mapped{};
 2718|  14.0k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  14.0k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 310, False: 13.7k]
  ------------------
 2720|    310|                        return;
 2721|       |
 2722|  13.7k|                     std::string key;
 2723|  13.7k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 0, False: 13.7k]
  ------------------
 2724|      0|                        return;
 2725|       |
 2726|  13.7k|                     glz::generic pair{};
 2727|  13.7k|                     pair[key] = std::move(mapped);
 2728|  13.7k|                     element = std::move(pair);
 2729|       |
 2730|  13.7k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  13.7k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 6, False: 13.7k]
  ------------------
 2732|      6|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  14.0k|               }
 2739|       |
 2740|   186k|               adapter.append(value, std::move(element));
 2741|       |
 2742|   186k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 348, False: 186k]
  ------------------
 2743|    348|                  ctx.error = error_code::unexpected_end;
 2744|    348|                  return;
 2745|    348|               }
 2746|       |
 2747|   186k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 137k, False: 48.4k]
  ------------------
 2748|   137k|                  ++it;
 2749|   137k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|   137k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 12, False: 137k]
  ------------------
 2751|     12|                     return;
 2752|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|       |                     if (ctx.current_indent() < 0) {
 2754|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|       |                     }
 2756|       |                  }
 2757|   137k|                  return;
 2758|   137k|               }
 2759|  48.4k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 48.0k, False: 452]
  ------------------
 2760|  48.0k|                  ++it;
 2761|  48.0k|                  just_saw_comma = true;
 2762|  48.0k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  48.0k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 6, False: 48.0k]
  ------------------
 2764|      6|                     return;
 2765|  48.0k|               }
 2766|    452|               else {
 2767|    452|                  ctx.error = error_code::syntax_error;
 2768|    452|                  return;
 2769|    452|               }
 2770|   186k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|   156k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|  1.56M|      {
 2581|  1.56M|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|  1.56M|            if constexpr (!check_append_arrays(Opts)) {
 2584|  1.56M|               value.clear();
 2585|  1.56M|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|  1.56M|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|   186k|            {
 2619|   186k|               if constexpr (emplace_backable<V>) {
 2620|   186k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|   186k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|  1.39M|      {
 3082|  1.39M|         using V = std::remove_cvref_t<T>;
 3083|  1.39M|         using value_type = typename V::value_type;
 3084|       |
 3085|  1.39M|         struct sequence_container_adapter
 3086|  1.39M|         {
 3087|  1.39M|            size_t index = 0;
 3088|       |
 3089|  1.39M|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|  1.39M|            {
 3091|  1.39M|               if constexpr (!resizable<V>) {
 3092|  1.39M|                  return index >= container.size();
 3093|  1.39M|               }
 3094|  1.39M|               else {
 3095|  1.39M|                  (void)container;
 3096|  1.39M|                  return false;
 3097|  1.39M|               }
 3098|  1.39M|            }
 3099|       |
 3100|  1.39M|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|  1.39M|            inline void append(V& container, value_type&& element) noexcept
 3103|  1.39M|            {
 3104|  1.39M|               if constexpr (emplace_backable<V>) {
 3105|  1.39M|                  container.emplace_back(std::move(element));
 3106|  1.39M|               }
 3107|  1.39M|               else if constexpr (emplaceable<V>) {
 3108|  1.39M|                  container.emplace(std::move(element));
 3109|  1.39M|               }
 3110|  1.39M|            }
 3111|  1.39M|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|  1.39M|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|  1.39M|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|  1.39M|         bool first_item = true;
 3122|  1.39M|         bool has_pending_item_anchor = false;
 3123|  1.39M|         std::string pending_item_anchor_name{};
 3124|  1.39M|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|  2.80M|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 2.20M, False: 601k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|  2.20M|            int32_t line_indent = 0;
 3137|  2.20M|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|  2.20M|            auto line_start = it;
 3139|       |
 3140|  2.80M|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 2.77M, False: 24.6k]
  ------------------
 3141|  2.77M|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 28.3k, False: 2.74M]
  ------------------
 3142|  28.3k|                  skip_comment(it, end);
 3143|  28.3k|                  skip_newline(it, end);
 3144|  28.3k|                  line_start = it;
 3145|  28.3k|                  line_indent = 0;
 3146|  28.3k|               }
 3147|  2.74M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 155k, False: 2.59M]
  |  Branch (3147:40): [True: 266k, False: 2.32M]
  ------------------
 3148|   421k|                  skip_newline(it, end);
 3149|   421k|                  line_start = it;
 3150|   421k|                  line_indent = 0;
 3151|   421k|               }
 3152|  2.32M|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 571k, False: 1.75M]
  ------------------
 3153|   571k|                  line_start = it;
 3154|   571k|                  line_indent = 0;
 3155|  2.87M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 2.87M, False: 1.96k]
  |  Branch (3155:39): [True: 2.30M, False: 569k]
  ------------------
 3156|  2.30M|                     ++line_indent;
 3157|  2.30M|                     ++it;
 3158|  2.30M|                  }
 3159|       |
 3160|   571k|                  bool saw_tab = false;
 3161|   580k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 578k, False: 2.17k]
  |  Branch (3161:40): [True: 4.97k, False: 573k]
  |  Branch (3161:54): [True: 4.10k, False: 569k]
  ------------------
 3162|  9.07k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 6.98k, False: 2.08k]
  |  Branch (3162:43): [True: 2.08k, False: 0]
  ------------------
 3163|  9.07k|                     ++it;
 3164|  9.07k|                  }
 3165|       |
 3166|   571k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 2.17k, False: 569k]
  |  Branch (3166:36): [True: 39.6k, False: 529k]
  |  Branch (3166:51): [True: 26.9k, False: 503k]
  |  Branch (3166:66): [True: 11.9k, False: 491k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|  80.7k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 78.5k, False: 2.17k]
  |  Branch (3168:39): [True: 11.9k, False: 66.6k]
  ------------------
 3169|  11.9k|                        skip_comment(it, end);
 3170|  11.9k|                     }
 3171|  80.7k|                     line_indent = 0;
 3172|  80.7k|                     continue;
 3173|  80.7k|                  }
 3174|       |
 3175|   491k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 14, False: 491k]
  ------------------
 3176|     14|                     ctx.error = error_code::syntax_error;
 3177|     14|                     return;
 3178|     14|                  }
 3179|   491k|                  break; // Found content
 3180|   491k|               }
 3181|  1.75M|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 61.9k, False: 1.69M]
  ------------------
 3182|  61.9k|                  line_start = it;
 3183|   126k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 125k, False: 1.09k]
  |  Branch (3183:40): [True: 1.57k, False: 123k]
  |  Branch (3183:54): [True: 63.1k, False: 60.8k]
  ------------------
 3184|  61.9k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 1.09k, False: 60.8k]
  |  Branch (3184:36): [True: 1.73k, False: 59.1k]
  |  Branch (3184:51): [True: 46.7k, False: 12.4k]
  |  Branch (3184:66): [True: 12.3k, False: 28]
  ------------------
 3185|  61.9k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 60.8k, False: 1.09k]
  |  Branch (3185:39): [True: 12.3k, False: 48.4k]
  ------------------
 3186|  12.3k|                        skip_comment(it, end);
 3187|  12.3k|                     }
 3188|  61.9k|                     line_indent = 0;
 3189|  61.9k|                     continue;
 3190|  61.9k|                  }
 3191|     28|                  ctx.error = error_code::syntax_error;
 3192|     28|                  return;
 3193|  61.9k|               }
 3194|  1.69M|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|  1.69M|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 1.39M, False: 297k]
  |  Branch (3198:37): [True: 1.39M, False: 2.17k]
  ------------------
 3199|  1.39M|                     line_indent = sequence_indent;
 3200|  1.39M|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|  1.39M|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 1.39M, False: 0]
  |  Branch (3201:49): [True: 1.39M, False: 0]
  ------------------
 3202|  1.39M|                           auto probe = it;
 3203|  1.39M|                           int32_t leading_ws = 0;
 3204|  1.39M|                           bool saw_tab = false;
 3205|  2.85M|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 2.85M, False: 0]
  |  Branch (3205:64): [True: 1.45M, False: 1.40M]
  |  Branch (3205:87): [True: 13.7k, False: 1.39M]
  ------------------
 3206|  1.46M|                              --probe;
 3207|  1.46M|                              ++leading_ws;
 3208|  1.46M|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 6.08k, False: 1.46M]
  |  Branch (3208:52): [True: 12.0k, False: 1.44M]
  ------------------
 3209|  1.46M|                           }
 3210|  1.39M|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 0, False: 1.39M]
  |  Branch (3210:61): [True: 25.1k, False: 1.36M]
  |  Branch (3210:85): [True: 116k, False: 1.25M]
  ------------------
 3211|   141k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 6, False: 141k]
  ------------------
 3212|      6|                                 ctx.error = error_code::syntax_error;
 3213|      6|                                 return;
 3214|      6|                              }
 3215|   141k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|   141k|                           }
 3217|  1.39M|                        }
 3218|  1.39M|                     }
 3219|  1.39M|                  }
 3220|  1.39M|                  break;
 3221|  1.69M|               }
 3222|  2.77M|            }
 3223|       |
 3224|  2.20M|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 24.6k, False: 2.18M]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|  2.18M|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 2.33k, False: 2.18M]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|  2.18M|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 104k, False: 2.07M]
  ------------------
 3231|   104k|               it = line_start;
 3232|   104k|               return;
 3233|   104k|            }
 3234|       |
 3235|  2.07M|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 20.1k, False: 2.05M]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  20.1k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 14, False: 20.1k]
  ------------------
 3240|     14|                  ctx.error = error_code::syntax_error;
 3241|     14|                  return;
 3242|     14|               }
 3243|       |
 3244|  20.1k|               ++it;
 3245|  20.1k|               auto pending_name = parse_anchor_name(it, end);
 3246|  20.1k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 18, False: 20.0k]
  ------------------
 3247|     18|                  ctx.error = error_code::syntax_error;
 3248|     18|                  return;
 3249|     18|               }
 3250|  20.0k|               skip_inline_ws(it, end);
 3251|  20.0k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 20.0k, False: 16]
  |  Branch (3251:33): [True: 13.8k, False: 6.20k]
  ------------------
 3252|  13.8k|                  skip_comment(it, end);
 3253|  13.8k|               }
 3254|       |
 3255|  20.0k|               has_pending_item_anchor = true;
 3256|  20.0k|               pending_item_anchor_name = std::string(pending_name);
 3257|  20.0k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  20.0k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 16, False: 20.0k]
  |  Branch (3259:34): [True: 16.8k, False: 3.27k]
  |  Branch (3259:49): [True: 62, False: 16.7k]
  ------------------
 3260|     78|                  ctx.error = error_code::syntax_error;
 3261|     78|                  return;
 3262|     78|               }
 3263|       |
 3264|  20.0k|               skip_newline(it, end);
 3265|  20.0k|               continue;
 3266|  20.0k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|  2.05M|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 562k, False: 1.49M]
  ------------------
 3270|   562k|               it = line_start;
 3271|   562k|               return;
 3272|   562k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|  1.49M|            dash_col = line_indent;
 3278|  1.49M|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|  1.49M|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 1.49M, False: 6]
  ------------------
 3280|  1.49M|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|  1.49M|               }
 3282|  1.49M|            }
 3283|       |
 3284|  1.49M|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|  1.49M|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 1.48M, False: 7.55k]
  |  Branch (3287:30): [True: 98.3k, False: 1.38M]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  98.3k|               it = line_start;
 3290|  98.3k|               return;
 3291|  98.3k|            }
 3292|       |
 3293|  1.39M|            bool saw_tab_after_dash = false;
 3294|  4.23M|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 4.22M, False: 12.7k]
  |  Branch (3294:34): [True: 2.25M, False: 1.96M]
  |  Branch (3294:48): [True: 582k, False: 1.38M]
  ------------------
 3295|  2.83M|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 497k, False: 2.34M]
  |  Branch (3295:59): [True: 461k, False: 1.88M]
  ------------------
 3296|  2.83M|               ++it;
 3297|  2.83M|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|  1.39M|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 461k, False: 934k]
  |  Branch (3299:39): [True: 458k, False: 2.71k]
  |  Branch (3299:52): [True: 24.5k, False: 433k]
  ------------------
 3300|  24.5k|               const auto after_dash = it + 1;
 3301|  24.5k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 6, False: 24.5k]
  |  Branch (3301:41): [True: 6, False: 24.4k]
  ------------------
 3302|     12|                  ctx.error = error_code::syntax_error;
 3303|     12|                  return;
 3304|     12|               }
 3305|  24.5k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|  1.39M|            auto parse_element = [&](auto& element) {
 3309|  1.39M|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|  1.39M|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  1.39M|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|  1.39M|                     return;
 3319|  1.39M|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  1.39M|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  1.39M|                  ctx.sequence_item_value_context = true;
 3322|  1.39M|                  ctx.sequence_dash_indent = dash_col;
 3323|  1.39M|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  1.39M|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  1.39M|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  1.39M|                  ctx.pop_indent();
 3327|  1.39M|               }
 3328|  1.39M|               else {
 3329|       |                  // Value on next line - nested block
 3330|  1.39M|                  skip_ws_and_comment(it, end);
 3331|  1.39M|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  1.39M|                  auto nested_start = it;
 3335|  1.39M|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  1.39M|                  if (bool(ctx.error)) [[unlikely]]
 3337|  1.39M|                     return;
 3338|  1.39M|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  1.39M|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|  1.39M|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  1.39M|                     const int32_t element_indent =
 3350|  1.39M|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|  1.39M|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|  1.39M|                        return;
 3353|  1.39M|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  1.39M|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  1.39M|                     ctx.sequence_item_value_context = true;
 3356|  1.39M|                     ctx.sequence_dash_indent = dash_col;
 3357|  1.39M|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  1.39M|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  1.39M|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  1.39M|                     ctx.pop_indent();
 3361|  1.39M|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  1.39M|               }
 3364|       |
 3365|  1.39M|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|  1.39M|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|  1.39M|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  1.39M|                                                                      pending_item_anchor_indent};
 3369|  1.39M|                  has_pending_item_anchor = false;
 3370|  1.39M|               }
 3371|  1.39M|            };
 3372|       |
 3373|  1.39M|            if constexpr (emplace_backable<V>) {
 3374|  1.39M|               auto& element = value.emplace_back();
 3375|  1.39M|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|  1.39M|            first_item = false;
 3394|       |
 3395|  1.39M|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 770, False: 1.39M]
  ------------------
 3396|    770|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|  1.39M|         }
 3401|  1.39M|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1ELb0ELb0ELb0ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|  1.39M|            auto parse_element = [&](auto& element) {
 3309|  1.39M|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 1.38M, False: 12.7k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|  1.39M|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 1.38M, False: 12.7k]
  |  Branch (3312:33): [True: 1.24M, False: 138k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  1.24M|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 1.24M]
  ------------------
 3318|      0|                     return;
 3319|  1.24M|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  1.24M|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  1.24M|                  ctx.sequence_item_value_context = true;
 3322|  1.24M|                  ctx.sequence_dash_indent = dash_col;
 3323|  1.24M|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  1.24M|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  1.24M|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  1.24M|                  ctx.pop_indent();
 3327|  1.24M|               }
 3328|   151k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   151k|                  skip_ws_and_comment(it, end);
 3331|   151k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   151k|                  auto nested_start = it;
 3335|   151k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   151k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 6, False: 151k]
  ------------------
 3337|      6|                     return;
 3338|   151k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   151k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 22.9k, False: 128k]
  ------------------
 3344|   151k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 33.5k, False: 117k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  33.5k|                     const int32_t element_indent =
 3350|  33.5k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 33.5k]
  ------------------
 3351|  33.5k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 33.5k]
  ------------------
 3352|      0|                        return;
 3353|  33.5k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  33.5k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  33.5k|                     ctx.sequence_item_value_context = true;
 3356|  33.5k|                     ctx.sequence_dash_indent = dash_col;
 3357|  33.5k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  33.5k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  33.5k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  33.5k|                     ctx.pop_indent();
 3361|  33.5k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   151k|               }
 3364|       |
 3365|  1.39M|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 2.46k, False: 1.39M]
  |  Branch (3365:47): [True: 2.37k, False: 84]
  ------------------
 3366|  2.37k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 1.65k, False: 726]
  ------------------
 3367|  2.37k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  2.37k|                                                                      pending_item_anchor_indent};
 3369|  2.37k|                  has_pending_item_anchor = false;
 3370|  2.37k|               }
 3371|  1.39M|            };
_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_:
 5423|  2.46M|   {
 5424|  2.46M|      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|  2.46M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|  2.46M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|  2.46M|            int depth = 0;
 5432|  2.46M|            while (pos != stop) {
 5433|  2.46M|               const char c = *pos;
 5434|  2.46M|               if (c == '"' || c == '\'') {
 5435|  2.46M|                  const char quote = c;
 5436|  2.46M|                  ++pos;
 5437|  2.46M|                  while (pos != stop && *pos != quote) {
 5438|  2.46M|                     if (*pos == '\\' && quote == '"') {
 5439|  2.46M|                        ++pos;
 5440|  2.46M|                        if (pos != stop) ++pos;
 5441|  2.46M|                     }
 5442|  2.46M|                     else {
 5443|  2.46M|                        ++pos;
 5444|  2.46M|                     }
 5445|  2.46M|                  }
 5446|  2.46M|                  if (pos != stop) ++pos;
 5447|  2.46M|                  continue;
 5448|  2.46M|               }
 5449|  2.46M|               if (c == '[' || c == '{') {
 5450|  2.46M|                  ++depth;
 5451|  2.46M|                  ++pos;
 5452|  2.46M|                  continue;
 5453|  2.46M|               }
 5454|  2.46M|               if (c == ']' || c == '}') {
 5455|  2.46M|                  if (depth == 0) return false;
 5456|  2.46M|                  --depth;
 5457|  2.46M|                  ++pos;
 5458|  2.46M|                  continue;
 5459|  2.46M|               }
 5460|  2.46M|               if (c == ',' && depth == 0) return false;
 5461|  2.46M|               if (c == ':' && depth == 0) {
 5462|  2.46M|                  auto next = pos + 1;
 5463|  2.46M|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|  2.46M|               }
 5465|  2.46M|               ++pos;
 5466|  2.46M|            }
 5467|  2.46M|            return false;
 5468|  2.46M|         };
 5469|       |
 5470|  2.46M|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5470:14): [True: 677k, False: 1.79M]
  |  Branch (5470:49): [True: 19.8k, False: 1.77M]
  ------------------
 5471|   696k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5471:17): [True: 632k, False: 64.3k]
  ------------------
 5472|   632k|               return;
 5473|   632k|            }
 5474|  64.3k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5474:17): [True: 1.92k, False: 62.4k]
  ------------------
 5475|  1.92k|               return;
 5476|  1.92k|            }
 5477|  64.3k|         }
 5478|       |
 5479|  1.83M|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|  1.83M|         return;
 5481|  2.46M|      }
 5482|       |
 5483|  2.46M|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 0, False: 2.46M]
  ------------------
 5484|      0|         return;
 5485|      0|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|  2.46M|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 0, False: 2.46M]
  ------------------
 5488|      0|         return;
 5489|      0|      }
 5490|  2.46M|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|  2.46M|   }
_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_:
 5427|  2.46M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|  2.46M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|  2.46M|            int depth = 0;
 5432|  71.3M|            while (pos != stop) {
  ------------------
  |  Branch (5432:20): [True: 70.6M, False: 751k]
  ------------------
 5433|  70.6M|               const char c = *pos;
 5434|  70.6M|               if (c == '"' || c == '\'') {
  ------------------
  |  Branch (5434:20): [True: 347k, False: 70.2M]
  |  Branch (5434:32): [True: 299k, False: 69.9M]
  ------------------
 5435|   647k|                  const char quote = c;
 5436|   647k|                  ++pos;
 5437|  77.5M|                  while (pos != stop && *pos != quote) {
  ------------------
  |  Branch (5437:26): [True: 77.2M, False: 272k]
  |  Branch (5437:41): [True: 76.9M, False: 374k]
  ------------------
 5438|  76.9M|                     if (*pos == '\\' && quote == '"') {
  ------------------
  |  Branch (5438:26): [True: 292k, False: 76.6M]
  |  Branch (5438:42): [True: 221k, False: 70.9k]
  ------------------
 5439|   221k|                        ++pos;
 5440|   221k|                        if (pos != stop) ++pos;
  ------------------
  |  Branch (5440:29): [True: 193k, False: 27.5k]
  ------------------
 5441|   221k|                     }
 5442|  76.7M|                     else {
 5443|  76.7M|                        ++pos;
 5444|  76.7M|                     }
 5445|  76.9M|                  }
 5446|   647k|                  if (pos != stop) ++pos;
  ------------------
  |  Branch (5446:23): [True: 374k, False: 272k]
  ------------------
 5447|   647k|                  continue;
 5448|   647k|               }
 5449|  69.9M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5449:20): [True: 2.01M, False: 67.9M]
  |  Branch (5449:32): [True: 495k, False: 67.4M]
  ------------------
 5450|  2.51M|                  ++depth;
 5451|  2.51M|                  ++pos;
 5452|  2.51M|                  continue;
 5453|  2.51M|               }
 5454|  67.4M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5454:20): [True: 101k, False: 67.3M]
  |  Branch (5454:32): [True: 205k, False: 67.1M]
  ------------------
 5455|   307k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5455:23): [True: 141k, False: 166k]
  ------------------
 5456|   166k|                  --depth;
 5457|   166k|                  ++pos;
 5458|   166k|                  continue;
 5459|   307k|               }
 5460|  67.1M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5460:20): [True: 2.28M, False: 64.8M]
  |  Branch (5460:32): [True: 692k, False: 1.59M]
  ------------------
 5461|  66.4M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5461:20): [True: 1.57M, False: 64.8M]
  |  Branch (5461:32): [True: 883k, False: 695k]
  ------------------
 5462|   883k|                  auto next = pos + 1;
 5463|   883k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5463:26): [True: 25.2k, False: 858k]
  |  Branch (5463:41): [True: 371k, False: 486k]
  |  Branch (5463:57): [True: 39.4k, False: 446k]
  |  Branch (5463:74): [True: 82.1k, False: 364k]
  |  Branch (5463:91): [True: 158k, False: 206k]
  ------------------
 5464|   883k|               }
 5465|  65.5M|               ++pos;
 5466|  65.5M|            }
 5467|   751k|            return false;
 5468|  2.46M|         };
_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_:
 5848|   268k|            auto is_word_boundary = [&](const auto ptr) {
 5849|   268k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 1.58k, False: 267k]
  ------------------
 5850|  1.58k|                  return true;
 5851|  1.58k|               }
 5852|   267k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 187k, False: 79.6k]
  ------------------
 5853|   187k|                  auto next = ptr + 1;
 5854|   187k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 898, False: 186k]
  |  Branch (5854:43): [True: 2.50k, False: 184k]
  |  Branch (5854:59): [True: 5.15k, False: 179k]
  |  Branch (5854:76): [True: 26.9k, False: 152k]
  |  Branch (5854:93): [True: 102k, False: 50.0k]
  ------------------
 5855|   187k|               }
 5856|  79.6k|               return is_plain_scalar_boundary(*ptr);
 5857|   267k|            };
_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:
 5774|  79.6k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  79.6k|               switch (ch) {
 5776|  14.7k|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 14.7k, False: 64.9k]
  ------------------
 5777|  17.0k|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 2.33k, False: 77.3k]
  ------------------
 5778|  33.9k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 16.8k, False: 62.7k]
  ------------------
 5779|  34.9k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 1.04k, False: 78.6k]
  ------------------
 5780|  37.2k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 2.30k, False: 77.3k]
  ------------------
 5781|  38.1k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 878, False: 78.7k]
  ------------------
 5782|  40.1k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 1.97k, False: 77.6k]
  ------------------
 5783|  40.1k|                  return true;
 5784|  39.5k|               default:
  ------------------
  |  Branch (5784:16): [True: 39.5k, False: 40.1k]
  ------------------
 5785|  39.5k|                  return false;
 5786|  79.6k|               }
 5787|  79.6k|            };
_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_:
 5789|   179k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|   179k|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|   179k|                  return false;
 5792|   179k|               }
 5793|   179k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 0, False: 179k]
  ------------------
 5794|      0|                  return false;
 5795|      0|               }
 5796|   179k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 179k, False: 0]
  |  Branch (5796:40): [True: 0, False: 0]
  |  Branch (5796:61): [True: 0, False: 0]
  ------------------
 5797|      0|                  return false;
 5798|      0|               }
 5799|       |
 5800|   179k|               auto look = word_end;
 5801|   179k|               yaml::skip_newline(look, end);
 5802|   179k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 0, False: 179k]
  ------------------
 5803|      0|                  int32_t line_indent = 0;
 5804|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 0, False: 0]
  |  Branch (5804:41): [True: 0, False: 0]
  ------------------
 5805|      0|                     ++line_indent;
 5806|      0|                     ++look;
 5807|      0|                  }
 5808|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 0, False: 0]
  |  Branch (5808:38): [True: 0, False: 0]
  ------------------
 5809|      0|                     return false;
 5810|      0|                  }
 5811|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 0, False: 0]
  |  Branch (5811:38): [True: 0, False: 0]
  |  Branch (5811:55): [True: 0, False: 0]
  ------------------
 5812|      0|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 0, False: 0]
  ------------------
 5813|      0|                        yaml::skip_newline(look, end);
 5814|      0|                        continue;
 5815|      0|                     }
 5816|      0|                     return false;
 5817|      0|                  }
 5818|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 0, False: 0]
  ------------------
 5819|      0|                     yaml::skip_comment(look, end);
 5820|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 0, False: 0]
  |  Branch (5820:42): [True: 0, False: 0]
  |  Branch (5820:59): [True: 0, False: 0]
  ------------------
 5821|      0|                        yaml::skip_newline(look, end);
 5822|      0|                        continue;
 5823|      0|                     }
 5824|      0|                     return false;
 5825|      0|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|      0|                  {
 5831|      0|                     auto scan = look;
 5832|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 0, False: 0]
  |  Branch (5832:44): [True: 0, False: 0]
  |  Branch (5832:61): [True: 0, False: 0]
  ------------------
 5833|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 0, False: 0]
  ------------------
 5834|      0|                           auto after_colon = scan + 1;
 5835|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 0, False: 0]
  |  Branch (5835:54): [True: 0, False: 0]
  |  Branch (5835:77): [True: 0, False: 0]
  ------------------
 5836|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 0, False: 0]
  |  Branch (5836:56): [True: 0, False: 0]
  ------------------
 5837|      0|                              return false;
 5838|      0|                           }
 5839|      0|                        }
 5840|      0|                        ++scan;
 5841|      0|                     }
 5842|      0|                  }
 5843|       |
 5844|      0|                  return line_indent > ctx.current_indent();
 5845|      0|               }
 5846|   179k|               return false;
 5847|   179k|            };
_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_:
 5377|  1.25M|   {
 5378|  1.25M|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|  1.25M|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|  1.25M|         const bool could_be_mapping = [&] {
 5386|  1.25M|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|  1.25M|               return line_could_be_flow_mapping(it, end);
 5388|  1.25M|            }
 5389|  1.25M|            else {
 5390|  1.25M|               return yaml::line_could_be_block_mapping(it, end);
 5391|  1.25M|            }
 5392|  1.25M|         }();
 5393|  1.25M|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 598k, False: 659k]
  ------------------
 5394|   598k|            return false;
 5395|   598k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   659k|         auto temp_ctx = ctx.make_speculative();
 5398|   659k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   659k|                                                                                               end);
 5400|   659k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   659k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   659k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 656k, False: 2.43k]
  ------------------
 5403|   656k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   656k|            return true;
 5405|   656k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  2.43k|         ctx.error = temp_ctx.error;
 5410|  2.43k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  2.43k|         return false;
 5412|   659k|      }
 5413|  1.25M|   }
_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:
 5385|  1.25M|         const bool could_be_mapping = [&] {
 5386|  1.25M|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|  1.25M|               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|       |            else {
 5390|       |               return yaml::line_could_be_block_mapping(it, end);
 5391|       |            }
 5392|  1.25M|         }();
_ZN3glz4yaml15materialize_keyILb0ENS0_12yaml_contextEEEbRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEERT0_:
   38|   957k|   {
   39|       |      if constexpr (empty_on_null) {
   40|       |         if (key_node.is_null()) {
   41|       |            key.clear();
   42|       |            return true;
   43|       |         }
   44|       |      }
   45|   957k|      if (auto* s = key_node.template get_if<std::string>()) {
  ------------------
  |  Branch (45:17): [True: 64.2k, False: 893k]
  ------------------
   46|  64.2k|         key = *s;
   47|  64.2k|         return true;
   48|  64.2k|      }
   49|   893k|      key.clear();
   50|   893k|      (void)glz::write_json(key_node, key);
   51|   893k|      if constexpr (requires { ctx.charge_key_expansion(size_t{}); }) {
   52|   893k|         if (!ctx.charge_key_expansion(key.size())) [[unlikely]] {
  ------------------
  |  Branch (52:14): [True: 82, False: 893k]
  ------------------
   53|     82|            ctx.error = error_code::exceeded_max_expansion;
   54|     82|            ctx.custom_error_message = "complex key expansion";
   55|     82|            return false;
   56|     82|         }
   57|   893k|      }
   58|   893k|      return true;
   59|   957k|   }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERS4_TkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  1.72M|      {
  275|  1.72M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  1.72M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  1.72M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  1.72M|      }
_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_:
 5635|  1.95M|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|  1.95M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|  1.95M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|  1.95M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|  1.95M|                       "the internally tagged shape, so it is rejected here instead.");
 5642|  1.95M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 1.95M]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|  1.95M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|  1.95M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 2.14k, False: 1.95M]
  ------------------
 5650|  2.14k|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|  1.95M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 1.06M, False: 894k]
  ------------------
 5655|  1.06M|            yaml::skip_ws_newlines_comments(it, end);
 5656|  1.06M|         }
 5657|   894k|         else {
 5658|   894k|            yaml::skip_inline_ws(it, end);
 5659|   894k|         }
 5660|       |
 5661|  1.95M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 50, False: 1.95M]
  ------------------
 5662|     50|            ctx.error = error_code::unexpected_end;
 5663|     50|            return;
 5664|     50|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|  1.95M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|  1.95M|            using V = std::remove_cvref_t<T>;
 5772|  1.95M|            using counts = yaml_variant_type_count<V>;
 5773|  1.95M|            const char c = *it;
 5774|  1.95M|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  1.95M|               switch (ch) {
 5776|  1.95M|               case ' ':
 5777|  1.95M|               case '\t':
 5778|  1.95M|               case '\n':
 5779|  1.95M|               case '\r':
 5780|  1.95M|               case ',':
 5781|  1.95M|               case ']':
 5782|  1.95M|               case '}':
 5783|  1.95M|                  return true;
 5784|  1.95M|               default:
 5785|  1.95M|                  return false;
 5786|  1.95M|               }
 5787|  1.95M|            };
 5788|       |
 5789|  1.95M|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  1.95M|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  1.95M|                  return false;
 5792|  1.95M|               }
 5793|  1.95M|               if (ctx.current_indent() < 0) {
 5794|  1.95M|                  return false;
 5795|  1.95M|               }
 5796|  1.95M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|  1.95M|                  return false;
 5798|  1.95M|               }
 5799|       |
 5800|  1.95M|               auto look = word_end;
 5801|  1.95M|               yaml::skip_newline(look, end);
 5802|  1.95M|               while (look != end) {
 5803|  1.95M|                  int32_t line_indent = 0;
 5804|  1.95M|                  while (look != end && *look == ' ') {
 5805|  1.95M|                     ++line_indent;
 5806|  1.95M|                     ++look;
 5807|  1.95M|                  }
 5808|  1.95M|                  if (look != end && *look == '\t') {
 5809|  1.95M|                     return false;
 5810|  1.95M|                  }
 5811|  1.95M|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|  1.95M|                     if (look != end) {
 5813|  1.95M|                        yaml::skip_newline(look, end);
 5814|  1.95M|                        continue;
 5815|  1.95M|                     }
 5816|  1.95M|                     return false;
 5817|  1.95M|                  }
 5818|  1.95M|                  if (*look == '#') {
 5819|  1.95M|                     yaml::skip_comment(look, end);
 5820|  1.95M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|  1.95M|                        yaml::skip_newline(look, end);
 5822|  1.95M|                        continue;
 5823|  1.95M|                     }
 5824|  1.95M|                     return false;
 5825|  1.95M|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  1.95M|                  {
 5831|  1.95M|                     auto scan = look;
 5832|  1.95M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|  1.95M|                        if (*scan == ':') {
 5834|  1.95M|                           auto after_colon = scan + 1;
 5835|  1.95M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|  1.95M|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|  1.95M|                              return false;
 5838|  1.95M|                           }
 5839|  1.95M|                        }
 5840|  1.95M|                        ++scan;
 5841|  1.95M|                     }
 5842|  1.95M|                  }
 5843|       |
 5844|  1.95M|                  return line_indent > ctx.current_indent();
 5845|  1.95M|               }
 5846|  1.95M|               return false;
 5847|  1.95M|            };
 5848|  1.95M|            auto is_word_boundary = [&](const auto ptr) {
 5849|  1.95M|               if (ptr == end) {
 5850|  1.95M|                  return true;
 5851|  1.95M|               }
 5852|  1.95M|               if (*ptr == ':') {
 5853|  1.95M|                  auto next = ptr + 1;
 5854|  1.95M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|  1.95M|               }
 5856|  1.95M|               return is_plain_scalar_boundary(*ptr);
 5857|  1.95M|            };
 5858|       |
 5859|  1.95M|            switch (c) {
 5860|   309k|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 309k, False: 1.64M]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|   309k|               ++it;
 5863|   309k|               auto aname = yaml::parse_anchor_name(it, end);
 5864|   309k|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 32, False: 309k]
  ------------------
 5865|     32|                  ctx.error = error_code::syntax_error;
 5866|     32|                  return;
 5867|     32|               }
 5868|   309k|               yaml::skip_inline_ws(it, end);
 5869|   309k|               bool anchor_on_same_line = true;
 5870|   309k|               bool value_is_indentless_sequence = false;
 5871|   309k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 4.81k, False: 304k]
  |  Branch (5871:33): [True: 53.1k, False: 251k]
  |  Branch (5871:48): [True: 49.4k, False: 201k]
  |  Branch (5871:63): [True: 13.9k, False: 187k]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|   121k|                  bool value_on_next_line = false;
 5875|   121k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 116k, False: 4.81k]
  ------------------
 5876|   116k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|   116k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 13.9k, False: 102k]
  ------------------
 5879|   193k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 193k, False: 142]
  |  Branch (5879:47): [True: 185k, False: 8.00k]
  |  Branch (5879:64): [True: 179k, False: 5.83k]
  ------------------
 5880|  13.9k|                     }
 5881|       |                     // Skip newline
 5882|   116k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 116k, False: 142]
  |  Branch (5882:42): [True: 61.1k, False: 55.2k]
  |  Branch (5882:59): [True: 55.2k, False: 0]
  ------------------
 5883|   116k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|   170k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 168k, False: 2.05k]
  |  Branch (5885:48): [True: 26.3k, False: 142k]
  |  Branch (5885:65): [True: 28.1k, False: 114k]
  ------------------
 5886|  54.5k|                           yaml::skip_newline(peek, end);
 5887|  54.5k|                        }
 5888|       |                        // Measure indent of next content line
 5889|   116k|                        int32_t next_indent = 0;
 5890|   249k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 245k, False: 4.33k]
  |  Branch (5890:47): [True: 133k, False: 112k]
  ------------------
 5891|   133k|                           ++next_indent;
 5892|   133k|                           ++peek;
 5893|   133k|                        }
 5894|   116k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 112k, False: 4.33k]
  |  Branch (5894:44): [True: 105k, False: 6.27k]
  |  Branch (5894:61): [True: 105k, False: 618]
  ------------------
 5895|   105k|                           const bool indentless_sequence =
 5896|   105k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 94.7k, False: 10.3k]
  |  Branch (5896:69): [True: 16.0k, False: 78.6k]
  ------------------
 5897|  16.0k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 770, False: 15.3k]
  ------------------
 5898|  15.3k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 12.1k, False: 3.21k]
  ------------------
 5899|  12.8k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 1.46k, False: 11.4k]
  ------------------
 5900|  11.4k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 3.86k, False: 7.55k]
  |  Branch (5900:61): [True: 3.65k, False: 206]
  ------------------
 5901|   105k|                           value_is_indentless_sequence = indentless_sequence;
 5902|   105k|                           const bool same_indent_property_node =
 5903|   105k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 19.9k, False: 85.1k]
  ------------------
 5904|  19.9k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 2.57k, False: 17.4k]
  |  Branch (5904:48): [True: 1.67k, False: 15.7k]
  |  Branch (5904:64): [True: 80, False: 15.6k]
  |  Branch (5904:80): [True: 800, False: 14.8k]
  |  Branch (5904:96): [True: 1.42k, False: 13.4k]
  ------------------
 5905|  13.4k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 254, False: 13.1k]
  |  Branch (5905:48): [True: 86, False: 13.0k]
  |  Branch (5905:65): [True: 278, False: 12.8k]
  |  Branch (5905:81): [True: 68, False: 12.7k]
  ------------------
 5906|   105k|                           value_on_next_line =
 5907|   105k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 79.1k, False: 25.9k]
  |  Branch (5907:71): [True: 5.11k, False: 20.8k]
  |  Branch (5907:94): [True: 7.24k, False: 13.5k]
  ------------------
 5908|   105k|                        }
 5909|   116k|                     }
 5910|   116k|                  }
 5911|   121k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 29.7k, False: 91.5k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  29.7k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  29.7k|                     return;
 5915|  29.7k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|  91.5k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 10.9k, False: 80.6k]
  ------------------
 5918|   117k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 117k, False: 0]
  |  Branch (5918:42): [True: 112k, False: 5.32k]
  |  Branch (5918:57): [True: 106k, False: 5.61k]
  ------------------
 5919|  10.9k|                  }
 5920|  91.5k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 91.5k, False: 0]
  ------------------
 5921|   142k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 142k, False: 0]
  |  Branch (5921:40): [True: 25.1k, False: 117k]
  |  Branch (5921:55): [True: 25.9k, False: 91.5k]
  ------------------
 5922|  51.1k|                     yaml::skip_newline(it, end);
 5923|  51.1k|                  }
 5924|  91.5k|                  yaml::skip_inline_ws(it, end);
 5925|  91.5k|                  anchor_on_same_line = false;
 5926|  91.5k|               }
 5927|       |
 5928|   279k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|   279k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (5929:23): [True: 187k, False: 91.5k]
  |  Branch (5929:46): [True: 4.36k, False: 183k]
  ------------------
 5930|  4.36k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (5930:24): [True: 6, False: 4.35k]
  |  Branch (5930:43): [True: 10, False: 4.34k]
  ------------------
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|     16|                     ctx.error = error_code::syntax_error;
 5933|     16|                     return;
 5934|     16|                  }
 5935|   279k|               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|   279k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 279k, False: 28]
  |  Branch (5939:33): [True: 1.76k, False: 277k]
  |  Branch (5939:47): [True: 24, False: 1.74k]
  ------------------
 5940|     24|                  ctx.error = error_code::syntax_error;
 5941|     24|                  return;
 5942|     24|               }
 5943|       |
 5944|   279k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|   279k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (5945:23): [True: 91.5k, False: 187k]
  |  Branch (5945:47): [True: 91.5k, False: 12]
  |  Branch (5945:60): [True: 3.95k, False: 87.5k]
  ------------------
 5946|  3.95k|                     auto probe = it + 1;
 5947|  3.95k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|  3.95k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (5948:26): [True: 8, False: 3.94k]
  ------------------
 5949|      8|                        ctx.error = error_code::syntax_error;
 5950|      8|                        return;
 5951|      8|                     }
 5952|  3.94k|                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|  3.94k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (5956:26): [True: 42, False: 3.90k]
  ------------------
 5957|     42|                        ctx.error = error_code::syntax_error;
 5958|     42|                        return;
 5959|     42|                     }
 5960|  3.94k|                  }
 5961|   279k|               }
 5962|       |
 5963|   279k|               const char* anchor_start = &*it;
 5964|   279k|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|   279k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|   279k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (5970:23): [True: 187k, False: 91.5k]
  |  Branch (5970:46): [True: 58.6k, False: 129k]
  ------------------
 5971|  58.6k|                     auto key_start = it;
 5972|  58.6k|                     if (*key_start == '!') {
  ------------------
  |  Branch (5972:26): [True: 1.55k, False: 57.1k]
  ------------------
 5973|  1.55k|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|  1.55k|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (5974:29): [True: 6, False: 1.54k]
  |  Branch (5974:67): [True: 6, False: 1.53k]
  ------------------
 5975|     12|                           ctx.error = error_code::syntax_error;
 5976|     12|                           return;
 5977|     12|                        }
 5978|  1.53k|                        yaml::skip_inline_ws(key_start, end);
 5979|  1.53k|                        if (key_start == end) {
  ------------------
  |  Branch (5979:29): [True: 4, False: 1.53k]
  ------------------
 5980|      4|                           ctx.error = error_code::unexpected_end;
 5981|      4|                           return;
 5982|      4|                        }
 5983|  1.53k|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (5983:29): [True: 0, False: 1.53k]
  |  Branch (5983:51): [True: 0, False: 1.53k]
  ------------------
 5984|      0|                           ctx.error = error_code::syntax_error;
 5985|      0|                           return;
 5986|      0|                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|  1.53k|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (5992:29): [True: 760, False: 774]
  |  Branch (5992:50): [True: 6, False: 754]
  ------------------
 5993|      6|                           ctx.error = error_code::syntax_error;
 5994|      6|                           return;
 5995|      6|                        }
 5996|  1.53k|                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|  58.6k|                     auto key_scan = key_start;
 6000|  58.6k|                     auto key_end = key_start;
 6001|  58.6k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6001:26): [True: 116, False: 58.5k]
  |  Branch (6001:46): [True: 242, False: 58.2k]
  ------------------
 6002|       |                        // Quoted key: skip to closing quote
 6003|    358|                        const char quote = *key_scan;
 6004|    358|                        ++key_scan;
 6005|  2.66k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6005:32): [True: 2.66k, False: 0]
  |  Branch (6005:51): [True: 2.30k, False: 358]
  ------------------
 6006|  2.30k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6006:32): [True: 298, False: 2.00k]
  |  Branch (6006:53): [True: 286, False: 12]
  ------------------
 6007|    286|                              ++key_scan;
 6008|    286|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6008:35): [True: 286, False: 0]
  ------------------
 6009|    286|                           }
 6010|  2.02k|                           else {
 6011|  2.02k|                              ++key_scan;
 6012|  2.02k|                           }
 6013|  2.30k|                        }
 6014|    358|                        if (key_scan == end) {
  ------------------
  |  Branch (6014:29): [True: 0, False: 358]
  ------------------
 6015|      0|                           ctx.error = error_code::syntax_error;
 6016|      0|                           return;
 6017|      0|                        }
 6018|    358|                        ++key_scan; // past closing quote
 6019|    358|                        key_end = key_scan;
 6020|    358|                        yaml::skip_inline_ws(key_scan, end);
 6021|    358|                     }
 6022|  58.2k|                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|   664k|                        while (key_scan != end) {
  ------------------
  |  Branch (6024:32): [True: 664k, False: 0]
  ------------------
 6025|   664k|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6025:32): [True: 78.8k, False: 585k]
  ------------------
 6026|  78.8k|                              auto next = key_scan + 1;
 6027|  78.8k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6027:35): [True: 3.26k, False: 75.5k]
  |  Branch (6027:50): [True: 20.9k, False: 54.6k]
  |  Branch (6027:66): [True: 4.22k, False: 50.4k]
  |  Branch (6027:83): [True: 13.1k, False: 37.2k]
  |  Branch (6027:100): [True: 16.7k, False: 20.5k]
  ------------------
 6028|  58.2k|                                 break;
 6029|  58.2k|                              }
 6030|  78.8k|                           }
 6031|   605k|                           ++key_scan;
 6032|   605k|                        }
 6033|  58.2k|                        key_end = key_scan;
 6034|  66.7k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6034:32): [True: 63.4k, False: 3.29k]
  |  Branch (6034:57): [True: 7.08k, False: 56.3k]
  |  Branch (6034:82): [True: 1.35k, False: 54.9k]
  ------------------
 6035|  8.43k|                           --key_end;
 6036|  8.43k|                        }
 6037|  58.2k|                     }
 6038|  58.6k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6038:26): [True: 0, False: 58.6k]
  |  Branch (6038:45): [True: 38, False: 58.5k]
  ------------------
 6039|     38|                        ctx.error = error_code::syntax_error;
 6040|     38|                        return;
 6041|     38|                     }
 6042|       |                     // Store anchor with just the key text span
 6043|  58.5k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|  58.5k|                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|  58.5k|                     if constexpr (counts::n_object > 0) {
 6047|  58.5k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|  58.5k|                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|  58.5k|                     return;
 6054|  58.6k|                  }
 6055|   279k|               }
 6056|       |
 6057|   220k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|   279k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|   279k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|   279k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|   279k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 194k, False: 84.6k]
  ------------------
 6062|   194k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|   194k|               }
 6064|   279k|               return;
 6065|   279k|            }
 6066|  19.7k|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 19.7k, False: 1.93M]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|  19.7k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|  19.7k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6069:23): [True: 13.1k, False: 6.64k]
  ------------------
 6070|  13.1k|                     if constexpr (counts::n_object > 0) {
 6071|  13.1k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|  13.1k|                                                                                                        end);
 6073|  13.1k|                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|  13.1k|                  }
 6080|  19.7k|               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|  19.7k|               return;
 6085|   279k|            }
 6086|   196k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 196k, False: 1.75M]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|   196k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|   196k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 14, False: 196k]
  ------------------
 6090|     14|                  ctx.error = error_code::syntax_error;
 6091|     14|                  return;
 6092|     14|               }
 6093|   196k|               yaml::skip_inline_ws(it, end);
 6094|   196k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 193k, False: 3.16k]
  |  Branch (6094:33): [True: 6.23k, False: 187k]
  ------------------
 6095|  6.23k|                  yaml::skip_comment(it, end);
 6096|  6.23k|               }
 6097|   196k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 193k, False: 3.54k]
  |  Branch (6097:34): [True: 52.0k, False: 141k]
  |  Branch (6097:49): [True: 23.1k, False: 117k]
  ------------------
 6098|  75.2k|                  auto content = it;
 6099|  75.2k|                  yaml::skip_newline(content, end);
 6100|  75.2k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  75.2k|                  bool consume_following_content = false;
 6103|  75.2k|                  auto content_token = content;
 6104|  75.2k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 71.1k, False: 4.06k]
  ------------------
 6105|  71.1k|                     auto indent_probe = content;
 6106|  71.1k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  71.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 6, False: 71.1k]
  ------------------
 6108|      6|                        return;
 6109|  71.1k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  71.1k|                     bool tagged_indentless_sequence = false;
 6114|  71.1k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 9.04k, False: 62.0k]
  |  Branch (6114:56): [True: 9.04k, False: 0]
  |  Branch (6114:79): [True: 8.70k, False: 344]
  ------------------
 6115|  8.70k|                        const auto after_dash = indent_probe + 1;
 6116|  8.70k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 1.26k, False: 7.43k]
  ------------------
 6117|  7.79k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 6.52k, False: 910]
  ------------------
 6118|  7.79k|                           tagged_indentless_sequence =
 6119|  7.79k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 222, False: 7.57k]
  ------------------
 6120|  7.57k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 4.50k, False: 3.06k]
  |  Branch (6120:60): [True: 674, False: 3.82k]
  ------------------
 6121|  7.79k|                        }
 6122|  8.70k|                     }
 6123|       |
 6124|  71.1k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 26.1k, False: 45.0k]
  ------------------
 6125|  45.0k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 6.61k, False: 38.4k]
  |  Branch (6125:93): [True: 896, False: 37.5k]
  ------------------
 6126|  71.1k|                  }
 6127|       |
 6128|  75.1k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 33.6k, False: 41.5k]
  ------------------
 6129|  33.6k|                     it = content_token;
 6130|  33.6k|                  }
 6131|  41.5k|                  else {
 6132|  41.5k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 428, False: 41.1k]
  ------------------
 6133|    428|                        if constexpr (counts::n_str > 0) {
 6134|    428|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|    428|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|    428|                           value = StrType{};
 6137|    428|                           return;
 6138|    428|                        }
 6139|    428|                     }
 6140|  41.5k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 428, False: 41.1k]
  ------------------
 6141|    428|                        if constexpr (counts::n_null > 0) {
 6142|    428|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|    428|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|    428|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 428]
  ------------------
 6145|    428|                           return;
 6146|    428|                        }
 6147|    428|                     }
 6148|  41.5k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 40.5k, False: 1.03k]
  ------------------
 6149|  40.5k|                        if constexpr (counts::n_null > 0) {
 6150|  40.5k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  40.5k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  40.5k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 40.5k]
  ------------------
 6153|  40.5k|                           return;
 6154|  40.5k|                        }
 6155|  40.5k|                     }
 6156|  41.5k|                  }
 6157|  75.1k|               }
 6158|   196k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|   196k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6161:23): [True: 151k, False: 44.9k]
  |  Branch (6161:36): [True: 6, False: 151k]
  ------------------
 6162|      6|                     ctx.error = error_code::syntax_error;
 6163|      6|                     return;
 6164|      6|                  }
 6165|   196k|                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|   196k|                     const bool starts_block_sequence_entry =
 6168|   196k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6168:26): [True: 151k, False: 44.9k]
  |  Branch (6168:39): [True: 11.7k, False: 139k]
  ------------------
 6169|  11.7k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6169:26): [True: 1.46k, False: 10.3k]
  |  Branch (6169:45): [True: 8.73k, False: 1.56k]
  ------------------
 6170|   196k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6170:26): [True: 145k, False: 51.5k]
  |  Branch (6170:58): [True: 3.05k, False: 142k]
  ------------------
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|  3.05k|                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|  3.05k|                        return;
 6175|  3.05k|                     }
 6176|   196k|                  }
 6177|   196k|               }
 6178|   196k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 3.54k, False: 193k]
  ------------------
 6179|  3.54k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 368, False: 3.17k]
  ------------------
 6180|    368|                     if constexpr (counts::n_str > 0) {
 6181|    368|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    368|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    368|                        value = StrType{};
 6184|    368|                        return;
 6185|    368|                     }
 6186|    368|                  }
 6187|  3.54k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 3.17k, False: 374]
  ------------------
 6188|  3.17k|                     if constexpr (counts::n_null > 0) {
 6189|  3.17k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|  3.17k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|  3.17k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 3.17k]
  ------------------
 6192|  3.17k|                        return;
 6193|  3.17k|                     }
 6194|  3.17k|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  3.54k|                  return;
 6197|  3.54k|               }
 6198|   193k|               switch (tag) {
 6199|    416|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 416, False: 192k]
  ------------------
 6200|    416|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|    416|                  return;
 6202|  14.8k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 14.8k, False: 178k]
  ------------------
 6203|  14.8k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 30, False: 193k]
  ------------------
 6204|  14.8k|                  if constexpr (counts::n_num > 0) {
 6205|  14.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  14.8k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  20.1k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 5.25k, False: 187k]
  ------------------
 6213|  20.1k|                  if constexpr (counts::n_bool > 0) {
 6214|  20.1k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  20.1k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  21.2k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 1.16k, False: 191k]
  ------------------
 6222|  21.2k|                  if constexpr (counts::n_null > 0) {
 6223|  21.2k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  21.2k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  21.2k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 21.2k]
  ------------------
 6226|  21.2k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  21.2k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  23.8k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 2.56k, False: 190k]
  ------------------
 6234|  23.8k|                  if constexpr (counts::n_object > 0) {
 6235|  23.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  23.8k|                                                                                                     end);
 6237|  23.8k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|  38.3k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 14.4k, False: 178k]
  ------------------
 6244|  38.3k|                  if constexpr (counts::n_array > 0) {
 6245|  38.3k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|  38.3k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|  38.3k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6247:29): [True: 14.4k, False: 23.8k]
  |  Branch (6247:42): [True: 8.71k, False: 5.76k]
  ------------------
 6248|  8.71k|                           ctx.allow_indentless_sequence = true;
 6249|  8.71k|                        }
 6250|  38.3k|                     }
 6251|  38.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|  38.3k|                                                                                                    end);
 6253|  38.3k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|  38.3k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|   148k|               default: {
  ------------------
  |  Branch (6260:16): [True: 109k, False: 83.1k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|   148k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 109k, False: 38.3k]
  |  Branch (6263:36): [True: 1.93k, False: 108k]
  ------------------
 6264|  1.93k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  1.93k|                     return;
 6266|  1.93k|                  }
 6267|       |
 6268|   146k|                  if constexpr (counts::n_array > 0) {
 6269|   146k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 108k, False: 38.3k]
  |  Branch (6269:39): [True: 764, False: 107k]
  ------------------
 6270|    764|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|    764|                                                                                                       end);
 6272|    764|                        return;
 6273|    764|                     }
 6274|   146k|                  }
 6275|   146k|                  if constexpr (counts::n_object > 0) {
 6276|   146k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 107k, False: 39.0k]
  |  Branch (6276:39): [True: 83.7k, False: 23.5k]
  ------------------
 6277|  83.7k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|  83.7k|                                                                                                        end);
 6279|  83.7k|                        return;
 6280|  83.7k|                     }
 6281|   146k|                  }
 6282|       |
 6283|   146k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|   146k|                     if constexpr (counts::n_array > 0) {
 6285|   146k|                        const bool starts_block_sequence_entry =
 6286|   146k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6286:29): [True: 23.5k, False: 122k]
  |  Branch (6286:42): [True: 3.04k, False: 20.4k]
  ------------------
 6287|  3.04k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6287:29): [True: 196, False: 2.85k]
  |  Branch (6287:48): [True: 2.19k, False: 656]
  ------------------
 6288|   146k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6288:29): [True: 2.39k, False: 143k]
  ------------------
 6289|  2.39k|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|  2.39k|                                                                                                          it, end);
 6291|  2.39k|                           return;
 6292|  2.39k|                        }
 6293|   146k|                     }
 6294|   146k|                     if constexpr (counts::n_object > 0) {
 6295|   146k|                        const bool starts_explicit_mapping_indicator =
 6296|   146k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6296:29): [True: 21.1k, False: 125k]
  |  Branch (6296:43): [True: 732, False: 20.3k]
  |  Branch (6296:57): [True: 1.54k, False: 18.8k]
  ------------------
 6297|  2.28k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6297:29): [True: 194, False: 2.08k]
  |  Branch (6297:48): [True: 464, False: 1.62k]
  ------------------
 6298|   146k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6298:29): [True: 658, False: 145k]
  ------------------
 6299|    658|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|    658|                                                                                                           it, end);
 6301|    658|                           return;
 6302|    658|                        }
 6303|   145k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6303:29): [True: 0, False: 145k]
  ------------------
 6304|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|      0|                                                                                                           it, end);
 6306|      0|                           return;
 6307|      0|                        }
 6308|   145k|                     }
 6309|   146k|                  }
 6310|       |
 6311|   146k|                  if constexpr (counts::n_str > 0) {
 6312|   146k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|   146k|                     return;
 6314|   146k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|   146k|                  return;
 6319|   148k|               }
 6320|   193k|               }
 6321|      0|               return;
 6322|   193k|            }
 6323|  76.0k|            case '{':
  ------------------
  |  Branch (6323:13): [True: 76.0k, False: 1.87M]
  ------------------
 6324|  76.0k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|  76.0k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6326:23): [True: 49.9k, False: 26.0k]
  |  Branch (6326:51): [True: 788, False: 49.1k]
  ------------------
 6327|    788|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|    788|                                                                                                     end);
 6329|    788|                     return;
 6330|    788|                  }
 6331|  76.0k|               }
 6332|       |               // Flow mapping - object type
 6333|  75.2k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|  76.0k|               return;
 6335|  33.4k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 33.4k, False: 1.92M]
  ------------------
 6336|  33.4k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|  33.4k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6338:23): [True: 14.6k, False: 18.7k]
  |  Branch (6338:51): [True: 152, False: 14.5k]
  ------------------
 6339|    152|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|    152|                                                                                                     end);
 6341|    152|                     return;
 6342|    152|                  }
 6343|  33.4k|               }
 6344|       |               // Flow sequence - array type
 6345|  33.2k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|  33.4k|               return;
 6347|   310k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 310k, False: 1.64M]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   310k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 266k, False: 43.6k]
  |  Branch (6349:39): [True: 6, False: 266k]
  ------------------
 6350|      6|                  ctx.error = error_code::syntax_error;
 6351|      6|                  return;
 6352|      6|               }
 6353|   310k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 266k, False: 43.6k]
  |  Branch (6353:40): [True: 94.4k, False: 172k]
  |  Branch (6353:56): [True: 107k, False: 64.3k]
  |  Branch (6353:73): [True: 23.5k, False: 40.8k]
  ------------------
 6354|   225k|                  if constexpr (counts::n_object > 0) {
 6355|   225k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   225k|                                                                                                     end);
 6357|   225k|                     return;
 6358|   225k|                  }
 6359|   225k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   310k|               return;
 6362|      6|            case '%':
  ------------------
  |  Branch (6362:13): [True: 6, False: 1.95M]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|      6|               ctx.error = error_code::syntax_error;
 6365|      6|               return;
 6366|  4.71k|            case '"':
  ------------------
  |  Branch (6366:13): [True: 4.71k, False: 1.95M]
  ------------------
 6367|  10.4k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 5.73k, False: 1.94M]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  10.4k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  10.4k|               return;
 6372|  16.1k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 16.1k, False: 1.93M]
  ------------------
 6373|  22.9k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 6.75k, False: 1.94M]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  22.9k|               if constexpr (counts::n_bool > 0) {
 6376|  22.9k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 22.0k, False: 876]
  |  Branch (6376:44): [True: 15.8k, False: 6.16k]
  |  Branch (6376:60): [True: 14.0k, False: 1.88k]
  |  Branch (6376:76): [True: 12.4k, False: 1.59k]
  ------------------
 6377|  13.0k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 2.16k, False: 7.47k]
  |  Branch (6377:60): [True: 1.47k, False: 694]
  |  Branch (6377:76): [True: 634, False: 838]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  13.0k|                     const auto after_true = it + 4;
 6380|  13.0k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  13.0k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 11.1k, False: 1.89k]
  ------------------
 6383|  11.1k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 98, False: 11.0k]
  ------------------
 6384|     98|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|     98|                           return;
 6386|     98|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  11.0k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 10.6k, False: 412]
  |  Branch (6389:47): [True: 6.18k, False: 4.44k]
  ------------------
 6390|  6.18k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 1.53k, False: 4.65k]
  |  Branch (6390:47): [True: 1.34k, False: 3.31k]
  |  Branch (6390:63): [True: 414, False: 2.90k]
  |  Branch (6390:80): [True: 468, False: 2.43k]
  |  Branch (6390:97): [True: 2.43k, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  6.18k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  6.18k|                           return;
 6394|  6.18k|                        }
 6395|  4.86k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  4.86k|                                                                                                      end);
 6397|  4.86k|                        return;
 6398|  11.0k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  13.0k|                  }
 6401|  22.9k|               }
 6402|  11.7k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  22.9k|               return;
 6404|  45.9k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 45.9k, False: 1.90M]
  ------------------
 6405|  52.3k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 6.38k, False: 1.94M]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|  52.3k|               if constexpr (counts::n_bool > 0) {
 6408|  52.3k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 51.1k, False: 1.18k]
  |  Branch (6408:44): [True: 33.2k, False: 17.9k]
  |  Branch (6408:60): [True: 23.0k, False: 10.1k]
  |  Branch (6408:76): [True: 19.9k, False: 3.17k]
  |  Branch (6408:92): [True: 8.77k, False: 11.1k]
  ------------------
 6409|  42.3k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 4.71k, False: 37.6k]
  |  Branch (6409:60): [True: 1.78k, False: 2.93k]
  |  Branch (6409:76): [True: 1.48k, False: 294]
  |  Branch (6409:92): [True: 810, False: 678]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  9.58k|                     const auto after_false = it + 5;
 6412|  9.58k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  9.58k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 8.85k, False: 730]
  ------------------
 6415|  8.85k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 282, False: 8.57k]
  ------------------
 6416|    282|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|    282|                           return;
 6418|    282|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  8.57k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 8.06k, False: 512]
  |  Branch (6421:47): [True: 3.17k, False: 4.88k]
  ------------------
 6422|  3.17k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 308, False: 2.86k]
  |  Branch (6422:47): [True: 786, False: 2.08k]
  |  Branch (6422:63): [True: 538, False: 1.54k]
  |  Branch (6422:80): [True: 1.03k, False: 506]
  |  Branch (6422:97): [True: 506, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  3.17k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  3.17k|                           return;
 6426|  3.17k|                        }
 6427|  5.40k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  5.40k|                                                                                                      end);
 6429|  5.40k|                        return;
 6430|  8.57k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  9.58k|                  }
 6433|  52.3k|               }
 6434|  43.4k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|  52.3k|               return;
 6436|  13.6k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 13.6k, False: 1.94M]
  ------------------
 6437|  20.6k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 7.03k, False: 1.94M]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  20.6k|               if constexpr (counts::n_null > 0) {
 6440|  20.6k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 19.4k, False: 1.27k]
  |  Branch (6440:44): [True: 13.3k, False: 6.10k]
  |  Branch (6440:60): [True: 12.7k, False: 582]
  |  Branch (6440:76): [True: 12.1k, False: 566]
  ------------------
 6441|  12.8k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 1.68k, False: 5.56k]
  |  Branch (6441:60): [True: 1.17k, False: 506]
  |  Branch (6441:76): [True: 672, False: 504]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  12.8k|                     const auto after_null = it + 4;
 6444|  12.8k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  12.8k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 9.93k, False: 2.90k]
  ------------------
 6447|  9.93k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 106, False: 9.82k]
  ------------------
 6448|    106|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|    106|                           return;
 6450|    106|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  9.82k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 9.26k, False: 564]
  |  Branch (6453:47): [True: 556, False: 8.70k]
  ------------------
 6454|    556|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 106, False: 450]
  |  Branch (6454:47): [True: 132, False: 318]
  |  Branch (6454:63): [True: 96, False: 222]
  |  Branch (6454:80): [True: 32, False: 190]
  |  Branch (6454:97): [True: 190, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|    556|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|    556|                           return;
 6458|    556|                        }
 6459|  9.27k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  9.27k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  9.27k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 9.27k]
  ------------------
 6462|  9.27k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  9.27k|                        return;
 6464|  9.82k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  12.8k|                  }
 6467|  20.6k|               }
 6468|  10.7k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  20.6k|               return;
 6470|    370|            case '~':
  ------------------
  |  Branch (6470:13): [True: 370, False: 1.95M]
  ------------------
 6471|       |               // Null indicator
 6472|    370|               if constexpr (counts::n_null > 0) {
 6473|    370|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|    370|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|    370|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 370]
  ------------------
 6476|    370|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|    370|                  return;
 6478|    370|               }
 6479|      0|               break; // Fall through to try other types
 6480|   512k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 512k, False: 1.44M]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|   512k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 8.63k, False: 504k]
  |  Branch (6482:41): [True: 364k, False: 139k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|   372k|                  if constexpr (counts::n_array > 0) {
 6485|   372k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|   372k|                                                                                                    end);
 6487|   372k|                     return;
 6488|   372k|                  }
 6489|   372k|               }
 6490|   512k|               if constexpr (counts::n_num > 0) {
 6491|   512k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 139k, False: 372k]
  |  Branch (6491:43): [True: 14.2k, False: 125k]
  |  Branch (6491:94): [True: 63.2k, False: 62.3k]
  ------------------
 6492|  77.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|  77.4k|                     return;
 6494|  77.4k|                  }
 6495|   512k|               }
 6496|   435k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|   512k|               return;
 6498|  45.8k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 45.8k, False: 1.90M]
  ------------------
 6499|  75.6k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 29.7k, False: 1.92M]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  75.6k|               if constexpr (counts::n_num > 0) {
 6503|  75.6k|                  auto start_it = it;
 6504|  75.6k|                  auto temp_ctx = ctx.make_speculative();
 6505|  75.6k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  75.6k|                                                                                               end);
 6507|  75.6k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  75.6k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  75.6k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 9.11k, False: 66.5k]
  ------------------
 6510|  9.11k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  9.11k|                     return; // Successfully parsed as number
 6512|  9.11k|                  }
 6513|  66.5k|                  it = start_it; // Restore and fall through to string
 6514|  66.5k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  75.6k|               return;
 6517|   314k|            default:
  ------------------
  |  Branch (6517:13): [True: 314k, False: 1.64M]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|   314k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 171k, False: 143k]
  |  Branch (6519:32): [True: 63.8k, False: 107k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|  63.8k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 10.6k, False: 53.2k]
  ------------------
 6522|  10.6k|                     return;
 6523|  10.6k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|  53.2k|                  if constexpr (counts::n_num > 0) {
 6526|  53.2k|                     auto start_it = it;
 6527|  53.2k|                     auto temp_ctx = ctx.make_speculative();
 6528|  53.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|  53.2k|                                                                                                  end);
 6530|  53.2k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|  53.2k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|  53.2k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 11.1k, False: 42.1k]
  ------------------
 6533|  11.1k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|  11.1k|                        return; // Successfully parsed as number
 6535|  11.1k|                     }
 6536|  42.1k|                     it = start_it; // Restore and fall through to string
 6537|  42.1k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|  53.2k|                  return;
 6541|  63.8k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   250k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   250k|               return;
 6545|  1.95M|            }
 6546|  1.95M|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|  1.95M|         error_code expansion_error{};
 6556|  1.95M|         std::string_view expansion_message{};
 6557|       |
 6558|  1.95M|         auto try_parse = [&]<size_t I>() -> bool {
 6559|  1.95M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|  1.95M|            auto start = it;
 6561|       |
 6562|  1.95M|            V v{};
 6563|  1.95M|            auto temp_ctx = ctx.make_speculative();
 6564|  1.95M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|  1.95M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|  1.95M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|  1.95M|            if (!bool(temp_ctx.error)) {
 6569|  1.95M|               value = std::move(v);
 6570|  1.95M|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|  1.95M|               return true;
 6572|  1.95M|            }
 6573|       |
 6574|  1.95M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|  1.95M|               expansion_error = temp_ctx.error;
 6576|  1.95M|               expansion_message = temp_ctx.custom_error_message;
 6577|  1.95M|            }
 6578|  1.95M|            it = start;
 6579|  1.95M|            return false;
 6580|  1.95M|         };
 6581|       |
 6582|  1.95M|         bool parsed = false;
 6583|  1.95M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|  1.95M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|  1.95M|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|  1.95M|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 1.95M]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|  1.95M|      }
_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_:
 5205|   659k|      {
 5206|   659k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   659k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   659k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   659k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   659k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 659k, False: 0]
  ------------------
 5216|   659k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   659k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_:
 4515|   659k|      {
 4516|   659k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 659k]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|   659k|         yaml::node_preamble_state preamble{};
 4520|   659k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 1.10k, False: 658k]
  ------------------
 4521|   659k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  1.10k|            return;
 4523|       |
 4524|   658k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|   658k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|   658k|         std::remove_cvref_t<T> preexisting_entries;
 4538|   658k|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 658k]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|   658k|         struct merge_restore_guard
 4543|   658k|         {
 4544|   658k|            std::remove_cvref_t<T>& target;
 4545|   658k|            std::remove_cvref_t<T>& saved;
 4546|   658k|            ~merge_restore_guard()
 4547|   658k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   658k|               for (auto& entry : saved) {
 4551|   658k|                  target.emplace(entry.first, std::move(entry.second));
 4552|   658k|               }
 4553|   658k|            }
 4554|   658k|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|   658k|         const bool treat_as_block_mapping =
 4557|   658k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [True: 658k, Folded]
  |  Branch (4557:48): [True: 160k, False: 497k]
  |  Branch (4557:62): [True: 880, False: 159k]
  ------------------
 4558|       |
 4559|   658k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 160k, False: 497k]
  |  Branch (4559:28): [True: 159k, False: 880]
  ------------------
 4560|       |            // Flow mapping
 4561|   159k|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|   159k|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|   159k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 157k, False: 1.94k]
  |  Branch (4565:30): [True: 2.80k, False: 155k]
  ------------------
 4566|  2.80k|               ++it;
 4567|  2.80k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  2.80k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 10, False: 2.79k]
  ------------------
 4569|     10|                  return;
 4570|  2.79k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  2.79k|               return;
 4572|  2.80k|            }
 4573|       |
 4574|   516k|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 512k, False: 4.12k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|   512k|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|   512k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 512k, False: 0]
  |  Branch (4578:33): [True: 9.17k, False: 502k]
  ------------------
 4579|  9.17k|                  ++it;
 4580|  9.17k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|  9.17k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 10, False: 9.16k]
  ------------------
 4582|     10|                     return;
 4583|  9.16k|                  break;
 4584|  9.17k|               }
 4585|       |
 4586|   502k|               bool explicit_flow_key = false;
 4587|   502k|               auto explicit_probe = it;
 4588|   502k|               yaml::skip_inline_ws(explicit_probe, end);
 4589|   502k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 502k, False: 0]
  |  Branch (4589:45): [True: 9.43k, False: 493k]
  ------------------
 4590|  9.43k|                  const auto after_q = explicit_probe + 1;
 4591|  9.43k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 10, False: 9.42k]
  |  Branch (4591:41): [True: 5.12k, False: 4.29k]
  ------------------
 4592|  6.98k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 1.45k, False: 2.84k]
  |  Branch (4592:42): [True: 392, False: 2.45k]
  ------------------
 4593|  6.98k|                     explicit_flow_key = true;
 4594|  6.98k|                     it = explicit_probe + 1;
 4595|  6.98k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  6.98k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 6, False: 6.97k]
  ------------------
 4597|      6|                        return;
 4598|  6.98k|                  }
 4599|  9.43k|               }
 4600|       |               // Parse key
 4601|   502k|               key_t key{};
 4602|   502k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|   502k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 6.97k, False: 495k]
  |  Branch (4603:44): [True: 6.96k, False: 12]
  |  Branch (4603:58): [True: 444, False: 6.51k]
  |  Branch (4603:72): [True: 1.45k, False: 5.06k]
  |  Branch (4603:86): [True: 1.59k, False: 3.47k]
  ------------------
 4604|  3.49k|                     key.clear();
 4605|  3.49k|                  }
 4606|   499k|                  else {
 4607|   499k|                     auto key_probe = it;
 4608|   499k|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|   499k|                     bool parse_complex_flow_key = false;
 4613|   499k|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 499k, False: 12]
  ------------------
 4614|   499k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 924, False: 498k]
  |  Branch (4614:50): [True: 2.32k, False: 496k]
  ------------------
 4615|  3.25k|                           parse_complex_flow_key = true;
 4616|  3.25k|                        }
 4617|   496k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 130k, False: 365k]
  ------------------
 4618|   130k|                           ++key_probe;
 4619|   130k|                           yaml::parse_anchor_name(key_probe, end);
 4620|   130k|                           yaml::skip_inline_ws(key_probe, end);
 4621|   130k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 130k, False: 44]
  |  Branch (4621:53): [True: 548, False: 129k]
  |  Branch (4621:74): [True: 89.9k, False: 40.0k]
  ------------------
 4622|  90.4k|                              parse_complex_flow_key = true;
 4623|  90.4k|                           }
 4624|   130k|                        }
 4625|   499k|                     }
 4626|       |
 4627|   499k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 93.7k, False: 405k]
  ------------------
 4628|  93.7k|                        glz::generic key_node{};
 4629|  93.7k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|  93.7k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 2.08k, False: 91.6k]
  ------------------
 4631|  2.08k|                           return;
 4632|  91.6k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 6, False: 91.6k]
  ------------------
 4633|      6|                           return;
 4634|  91.6k|                     }
 4635|   405k|                     else {
 4636|   405k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 5.92k, False: 399k]
  ------------------
 4637|  5.92k|                           return;
 4638|  5.92k|                        }
 4639|   405k|                     }
 4640|   499k|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|   494k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|   502k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 6, False: 502k]
  ------------------
 4656|      6|                  return;
 4657|       |
 4658|   502k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|   502k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|   502k|                     val = {};
 4661|   502k|                     return true;
 4662|   502k|                  }
 4663|   502k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   502k|                     val = glz::generic{};
 4665|   502k|                     return true;
 4666|   502k|                  }
 4667|   502k|                  else {
 4668|   502k|                     static constexpr std::string_view null_value{"null"};
 4669|   502k|                     auto null_it = null_value.data();
 4670|   502k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|   502k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|   502k|                     return !bool(ctx.error);
 4673|   502k|                  }
 4674|   502k|               };
 4675|       |
 4676|   502k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 494k, False: 8.11k]
  |  Branch (4676:34): [True: 323k, False: 171k]
  |  Branch (4676:48): [True: 24.0k, False: 147k]
  ------------------
 4677|   347k|                  val_t val{};
 4678|   347k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 347k]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|   347k|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|   347k|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 24.0k, False: 323k]
  ------------------
 4684|  24.0k|                     ++it;
 4685|  24.0k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  24.0k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 8, False: 23.9k]
  ------------------
 4687|      8|                        return;
 4688|  23.9k|                     break;
 4689|  24.0k|                  }
 4690|       |
 4691|   323k|                  ++it; // skip comma
 4692|   323k|                  yaml::skip_ws_and_newlines(it, end);
 4693|   323k|                  continue;
 4694|   347k|               }
 4695|       |
 4696|   155k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 8.11k, False: 147k]
  |  Branch (4696:33): [True: 60, False: 147k]
  ------------------
 4697|    154|                  ctx.error = error_code::syntax_error;
 4698|    154|                  return;
 4699|    154|               }
 4700|   155k|               ++it;
 4701|       |
 4702|   155k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|   155k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 6, False: 155k]
  ------------------
 4704|      6|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|   155k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 147k, False: 8.02k]
  |  Branch (4707:34): [True: 4.32k, False: 142k]
  |  Branch (4707:48): [True: 26.2k, False: 116k]
  ------------------
 4708|  30.5k|                  val_t val{};
 4709|  30.5k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 30.5k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|  30.5k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|  30.5k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 26.2k, False: 4.32k]
  ------------------
 4715|  26.2k|                     ++it;
 4716|  26.2k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  26.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 6, False: 26.2k]
  ------------------
 4718|      6|                        return;
 4719|  26.2k|                     break;
 4720|  26.2k|                  }
 4721|       |
 4722|  4.32k|                  ++it; // skip comma
 4723|  4.32k|                  yaml::skip_ws_and_newlines(it, end);
 4724|  4.32k|                  continue;
 4725|  30.5k|               }
 4726|       |
 4727|       |               // Parse value
 4728|   124k|               val_t val{};
 4729|   124k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|   124k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 606, False: 123k]
  ------------------
 4731|    606|                  return;
 4732|       |
 4733|   123k|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|   123k|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|   123k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 115k, False: 8.08k]
  |  Branch (4737:33): [True: 84.0k, False: 31.7k]
  ------------------
 4738|  84.0k|                  ++it;
 4739|  84.0k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|  84.0k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 6, False: 84.0k]
  ------------------
 4741|      6|                     return;
 4742|  84.0k|                  break;
 4743|  84.0k|               }
 4744|  39.8k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 31.7k, False: 8.08k]
  |  Branch (4744:38): [True: 28.1k, False: 3.56k]
  ------------------
 4745|  28.1k|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|  28.1k|                  yaml::skip_ws_and_newlines(it, end);
 4748|  28.1k|               }
 4749|  11.6k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 3.56k, False: 8.08k]
  |  Branch (4749:39): [True: 2.55k, False: 1.01k]
  |  Branch (4749:54): [True: 982, False: 32]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|  3.53k|                  yaml::skip_ws_and_newlines(it, end);
 4753|  3.53k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 3.53k, False: 6]
  |  Branch (4753:36): [True: 572, False: 2.95k]
  ------------------
 4754|    572|                     ++it;
 4755|    572|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|    572|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 6, False: 566]
  ------------------
 4757|      6|                        return;
 4758|    566|                     break;
 4759|    572|                  }
 4760|  2.96k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 2.95k, False: 6]
  |  Branch (4760:36): [True: 2.94k, False: 10]
  ------------------
 4761|  2.94k|                     ++it;
 4762|  2.94k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  2.94k|                     continue;
 4764|  2.94k|                  }
 4765|     16|                  ctx.error = error_code::syntax_error;
 4766|     16|                  return;
 4767|  2.96k|               }
 4768|  8.11k|               else {
 4769|  8.11k|                  ctx.error = error_code::syntax_error;
 4770|  8.11k|                  return;
 4771|  8.11k|               }
 4772|   123k|            }
 4773|   157k|         }
 4774|   498k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   498k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   498k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   498k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   498k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   498k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   498k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   498k|                           if (ctx.stream_begin) {
 4788|   498k|                              auto is_line_content_start = [&](auto pos) {
 4789|   498k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   498k|                              };
 4791|       |
 4792|   498k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   498k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   498k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   498k|                                 return line != end && *line == ':';
 4796|   498k|                              };
 4797|       |
 4798|   498k|                              if (!is_line_content_start(it) &&
 4799|   498k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   498k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   498k|                                 ctx.error = error_code::syntax_error;
 4802|   498k|                                 return false;
 4803|   498k|                              }
 4804|   498k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   498k|                           }
 4806|   498k|                        }
 4807|       |
 4808|   498k|                        if (*it == '-' &&
 4809|   498k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   498k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   498k|                           ctx.error = error_code::syntax_error;
 4813|   498k|                           return false;
 4814|   498k|                        }
 4815|       |
 4816|   498k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   498k|                           return false;
 4818|   498k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   498k|                        ctx.pop_indent();
 4820|   498k|                     }
 4821|   498k|                     else {
 4822|   498k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   498k|                        if (nested_indent >= 0) {
 4824|   498k|                           yaml::skip_to_content(it, end);
 4825|   498k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   498k|                              ctx.error = error_code::syntax_error;
 4827|   498k|                              return false;
 4828|   498k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   498k|                           const int32_t value_indent =
 4832|   498k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   498k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   498k|                              return false;
 4835|   498k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   498k|                           ctx.pop_indent();
 4837|   498k|                        }
 4838|   498k|                     }
 4839|   498k|                     return !bool(ctx.error);
 4840|   498k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   498k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   498k|                     ctx.error = error_code::syntax_error;
 4847|   498k|                     return false;
 4848|   498k|                  }
 4849|   498k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   498k|                     ++it; // skip '?'
 4851|   498k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   498k|                     const int32_t explicit_value_indicator_indent =
 4854|   498k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   498k|                     key_t key{};
 4857|   498k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   498k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   498k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   498k|                        };
 4861|       |
 4862|   498k|                        auto key_it = it;
 4863|   498k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   498k|                        auto content = key_it;
 4866|   498k|                        yaml::skip_to_content(content, end);
 4867|   498k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   498k|                        if (content != end && *content == '&') {
 4873|   498k|                           auto anchor_probe = content + 1;
 4874|   498k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   498k|                           if (!anchor_name.empty()) {
 4876|   498k|                              auto after_anchor = anchor_probe;
 4877|   498k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   498k|                              auto value_indicator = after_anchor;
 4880|   498k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   498k|                                 key.clear();
 4882|   498k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   498k|                                 it = value_indicator;
 4884|   498k|                                 handled_anchor_only_empty_key = true;
 4885|   498k|                              }
 4886|   498k|                              else {
 4887|   498k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   498k|                                    yaml::skip_comment(value_indicator, end);
 4889|   498k|                                 }
 4890|   498k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   498k|                                    yaml::skip_newline(value_indicator, end);
 4892|   498k|                                    auto value_line = value_indicator;
 4893|   498k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   498k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   498k|                                       return false;
 4896|   498k|                                    if (value_line != end && *value_line == ':' &&
 4897|   498k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   498k|                                       key.clear();
 4899|   498k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   498k|                                       it = value_line;
 4901|   498k|                                       handled_anchor_only_empty_key = true;
 4902|   498k|                                    }
 4903|   498k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   498k|                                       ctx.error = error_code::syntax_error;
 4908|   498k|                                       return false;
 4909|   498k|                                    }
 4910|   498k|                                 }
 4911|   498k|                              }
 4912|   498k|                           }
 4913|   498k|                        }
 4914|       |
 4915|   498k|                        const bool key_content_spans_lines = [&] {
 4916|   498k|                           auto scan = key_it;
 4917|   498k|                           while (scan != content && scan != end) {
 4918|   498k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   498k|                              ++scan;
 4920|   498k|                           }
 4921|   498k|                           return false;
 4922|   498k|                        }();
 4923|       |
 4924|   498k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   498k|                        }
 4927|   498k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   498k|                           key.clear();
 4929|   498k|                           it = content;
 4930|   498k|                        }
 4931|   498k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   498k|                           auto key_node_it = content;
 4937|   498k|                           auto key_node_end = end;
 4938|   498k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   498k|                              auto scan = content;
 4943|   498k|                              while (scan != end) {
 4944|   498k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   498k|                                    ++scan;
 4946|   498k|                                 }
 4947|   498k|                                 if (scan == end) {
 4948|   498k|                                    break;
 4949|   498k|                                 }
 4950|       |
 4951|   498k|                                 yaml::skip_newline(scan, end);
 4952|   498k|                                 auto line_start = scan;
 4953|       |
 4954|   498k|                                 int32_t indicator_indent = 0;
 4955|   498k|                                 while (scan != end && *scan == ' ') {
 4956|   498k|                                    ++indicator_indent;
 4957|   498k|                                    ++scan;
 4958|   498k|                                 }
 4959|       |
 4960|   498k|                                 if (scan != end && *scan == ':') {
 4961|   498k|                                    const auto after_colon = scan + 1;
 4962|   498k|                                    if ((after_colon == end ||
 4963|   498k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   498k|                                        indicator_indent <= line_indent) {
 4965|   498k|                                       key_node_end = line_start;
 4966|   498k|                                       break;
 4967|   498k|                                    }
 4968|   498k|                                 }
 4969|   498k|                              }
 4970|   498k|                           }
 4971|       |
 4972|   498k|                           glz::generic key_node{};
 4973|   498k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   498k|                           ctx.explicit_mapping_key_context = true;
 4975|   498k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   498k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   498k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   498k|                              return false;
 4979|   498k|                           it = key_node_it;
 4980|   498k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   498k|                              return false;
 4982|   498k|                        }
 4983|   498k|                     }
 4984|   498k|                     else {
 4985|   498k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   498k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   498k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   498k|                              return false;
 4989|   498k|                        }
 4990|   498k|                     }
 4991|       |
 4992|   498k|                     yaml::skip_inline_ws(it, end);
 4993|   498k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   498k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   498k|                        auto probe = it;
 4998|   498k|                        bool found_value_indicator = false;
 4999|       |
 5000|   498k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   498k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   498k|                           auto value_line = probe;
 5004|   498k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   498k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   498k|                              return false;
 5007|       |
 5008|   498k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   498k|                              probe = value_line;
 5010|   498k|                              continue; // blank line
 5011|   498k|                           }
 5012|   498k|                           if (*value_line == '#') {
 5013|   498k|                              yaml::skip_comment(value_line, end);
 5014|   498k|                              probe = value_line;
 5015|   498k|                              continue; // comment-only line
 5016|   498k|                           }
 5017|   498k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   498k|                              it = value_line;
 5019|   498k|                              found_value_indicator = true;
 5020|   498k|                           }
 5021|   498k|                           break;
 5022|   498k|                        }
 5023|       |
 5024|   498k|                        if (found_value_indicator) {
 5025|   498k|                           yaml::skip_inline_ws(it, end);
 5026|   498k|                        }
 5027|   498k|                     }
 5028|       |
 5029|   498k|                     val_t val{};
 5030|   498k|                     if (it != end && *it == ':') {
 5031|   498k|                        ++it;
 5032|   498k|                        if (it != end && *it == '\t') {
 5033|   498k|                           ctx.error = error_code::syntax_error;
 5034|   498k|                           return false;
 5035|   498k|                        }
 5036|   498k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   498k|                           auto probe = it;
 5038|   498k|                           yaml::skip_newline(probe, end);
 5039|   498k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   498k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   498k|                              ctx.error = error_code::syntax_error;
 5042|   498k|                              return false;
 5043|   498k|                           }
 5044|   498k|                        }
 5045|   498k|                        yaml::skip_inline_ws(it, end);
 5046|   498k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   498k|                           return false;
 5048|   498k|                     }
 5049|       |
 5050|   498k|                     value.emplace(std::move(key), std::move(val));
 5051|   498k|                     return true;
 5052|   498k|                  }
 5053|       |
 5054|   498k|                  key_t key{};
 5055|   498k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   498k|                     auto key_probe = it;
 5057|   498k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   498k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   498k|                     if (complex_flow_key) {
 5060|   498k|                        glz::generic key_node{};
 5061|   498k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   498k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   498k|                           return false;
 5064|   498k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   498k|                           return false;
 5066|   498k|                     }
 5067|   498k|                     else {
 5068|   498k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   498k|                           return false;
 5070|   498k|                        }
 5071|   498k|                     }
 5072|   498k|                  }
 5073|   498k|                  else {
 5074|   498k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   498k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   498k|                        return false;
 5077|   498k|                  }
 5078|       |
 5079|   498k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   498k|                  if (it == end || *it != ':') {
 5082|   498k|                     ctx.error = error_code::syntax_error;
 5083|   498k|                     return false;
 5084|   498k|                  }
 5085|   498k|                  ++it;
 5086|   498k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   498k|                  val_t val{};
 5089|   498k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   498k|                     return false;
 5091|       |
 5092|   498k|                  value.emplace(std::move(key), std::move(val));
 5093|   498k|                  return true;
 5094|   498k|               });
 5095|   498k|         }
 5096|       |
 5097|   646k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|   646k|      }
_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|   659k|      {
  466|   659k|         skip_inline_ws(it, end);
  467|       |
  468|   659k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 659k]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|   659k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   659k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 659k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|   659k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 659k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   659k|         skip_inline_ws(it, end);
  486|       |
  487|   659k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 659k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   659k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 1.07k, False: 658k]
  ------------------
  495|  1.07k|            return true;
  496|  1.07k|         }
  497|       |
  498|   658k|         return false;
  499|   659k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlNSD_8yaml_tagEE_clESN_:
 4521|   659k|                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|   659k|      {
  409|   659k|         state.has_anchor = false;
  410|   659k|         state.anchor_name.clear();
  411|   659k|         state.anchor_start = nullptr;
  412|   659k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   659k|         if constexpr (Policy.allow_alias) {
  415|   659k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   659k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 644k, False: 15.5k]
  ------------------
  417|   644k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 1.05k, False: 643k]
  ------------------
  418|   644k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   659k|         }
  424|       |
  425|   659k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 658k, False: 1.05k]
  |  Branch (425:27): [True: 15.8k, False: 642k]
  ------------------
  426|  15.8k|            ++it;
  427|  15.8k|            auto name = parse_anchor_name(it, end);
  428|  15.8k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 10, False: 15.8k]
  ------------------
  429|     10|               ctx.error = error_code::syntax_error;
  430|     10|               return true;
  431|     10|            }
  432|  15.8k|            skip_inline_ws(it, end);
  433|  15.8k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 14, False: 15.7k]
  ------------------
  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|  15.7k|            state.has_anchor = true;
  446|  15.7k|            state.anchor_name = std::string(name);
  447|  15.7k|            state.anchor_start = &*it;
  448|  15.7k|         }
  449|       |
  450|   659k|         return false;
  451|   659k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   644k|      {
  301|   644k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 644k]
  |  Branch (301:27): [True: 643k, False: 1.05k]
  ------------------
  302|       |
  303|  1.05k|         ++it; // skip '*'
  304|  1.05k|         auto name = parse_anchor_name(it, end);
  305|  1.05k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 18, False: 1.03k]
  ------------------
  306|     18|            ctx.error = error_code::syntax_error;
  307|     18|            return true;
  308|     18|         }
  309|       |
  310|  1.03k|         auto anchor_it = ctx.anchors.find(name);
  311|  1.03k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 40, False: 996]
  ------------------
  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|    996|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|    996|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 610, False: 386]
  ------------------
  322|    610|            return true;
  323|    610|         }
  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|    386|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 54, False: 332]
  ------------------
  329|     54|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     54|            return true;
  331|     54|         }
  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|    332|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    332|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 332]
  ------------------
  339|      0|            return true;
  340|       |
  341|    332|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 332]
  ------------------
  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|    332|         auto replay_it = span.begin;
  348|    332|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    332|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    332|         ctx.indent_stack.clear();
  353|    332|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 226, False: 106]
  ------------------
  354|    226|            ctx.push_indent(span.base_indent - 1);
  355|    226|         }
  356|       |
  357|    332|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    332|         using V = std::remove_cvref_t<T>;
  360|    332|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    332|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    332|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    332|         return true;
  367|    332|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|   378k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|   378k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   378k|                     val = glz::generic{};
 4665|   378k|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|   378k|               };
_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_:
 3633|   498k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   498k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 498k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   498k|         const int32_t parent_indent = ctx.current_indent();
 3644|   498k|         const bool discover_indent = (mapping_indent < 0);
 3645|   498k|         bool first_key = !discover_indent;
 3646|   498k|         bool discovered_first_key_mid_line = false;
 3647|   498k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|  1.07M|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 814k, False: 257k]
  ------------------
 3650|   814k|            auto line_start = it;
 3651|   814k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 814k]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|   964k|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 929k, False: 34.9k]
  ------------------
 3655|   929k|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 51.1k, False: 877k]
  ------------------
 3656|  51.1k|                  skip_comment(it, end);
 3657|  51.1k|                  skip_newline(it, end);
 3658|  51.1k|                  first_key = false;
 3659|  51.1k|                  line_indent = 0;
 3660|  51.1k|               }
 3661|   877k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 32.7k, False: 845k]
  |  Branch (3661:40): [True: 29.9k, False: 815k]
  ------------------
 3662|  62.6k|                  skip_newline(it, end);
 3663|  62.6k|                  first_key = false;
 3664|  62.6k|                  line_indent = 0;
 3665|  62.6k|               }
 3666|   815k|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 110k, False: 704k]
  ------------------
 3667|   110k|                  line_start = it;
 3668|   110k|                  line_indent = 0;
 3669|   316k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 312k, False: 4.29k]
  |  Branch (3669:39): [True: 205k, False: 106k]
  ------------------
 3670|   205k|                     ++line_indent;
 3671|   205k|                     ++it;
 3672|   205k|                  }
 3673|       |
 3674|   110k|                  bool saw_tab = false;
 3675|   121k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 116k, False: 4.43k]
  |  Branch (3675:40): [True: 3.98k, False: 112k]
  |  Branch (3675:54): [True: 6.18k, False: 106k]
  ------------------
 3676|  10.1k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 7.71k, False: 2.44k]
  |  Branch (3676:43): [True: 2.44k, False: 0]
  ------------------
 3677|  10.1k|                     ++it;
 3678|  10.1k|                  }
 3679|       |
 3680|   110k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 4.43k, False: 106k]
  |  Branch (3680:36): [True: 18.7k, False: 87.7k]
  |  Branch (3680:51): [True: 2.79k, False: 84.9k]
  |  Branch (3680:66): [True: 6.52k, False: 78.4k]
  ------------------
 3681|  32.5k|                     first_key = false;
 3682|  32.5k|                     line_indent = 0;
 3683|  32.5k|                     continue; // Blank or comment line
 3684|  32.5k|                  }
 3685|       |
 3686|  78.4k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 14, False: 78.4k]
  ------------------
 3687|     14|                     ctx.error = error_code::syntax_error;
 3688|     14|                     return;
 3689|     14|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|  78.4k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 76.7k, False: 1.67k]
  |  Branch (3692:46): [True: 502, False: 76.2k]
  ------------------
 3693|    502|                     it = line_start;
 3694|    502|                     return;
 3695|    502|                  }
 3696|       |
 3697|  77.9k|                  first_key = false;
 3698|  77.9k|                  break; // Found content
 3699|  78.4k|               }
 3700|   704k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 3.49k, False: 700k]
  ------------------
 3701|  3.49k|                  line_start = it;
 3702|  16.4k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 13.8k, False: 2.60k]
  |  Branch (3702:40): [True: 7.83k, False: 5.98k]
  |  Branch (3702:54): [True: 5.09k, False: 896]
  ------------------
 3703|  3.49k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 2.60k, False: 896]
  |  Branch (3703:36): [True: 134, False: 762]
  |  Branch (3703:51): [True: 510, False: 252]
  |  Branch (3703:66): [True: 234, False: 18]
  ------------------
 3704|  3.47k|                     first_key = false;
 3705|  3.47k|                     line_indent = 0;
 3706|  3.47k|                     continue; // Blank or comment-only line with tab indentation
 3707|  3.47k|                  }
 3708|     18|                  ctx.error = error_code::syntax_error;
 3709|     18|                  return;
 3710|  3.49k|               }
 3711|   700k|               else {
 3712|   700k|                  line_start = it;
 3713|   700k|                  break; // Content at column 0
 3714|   700k|               }
 3715|   929k|            }
 3716|       |
 3717|   813k|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 34.9k, False: 778k]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|   778k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 1.02k, False: 777k]
  |  Branch (3721:45): [True: 3.22k, False: 774k]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|   774k|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 774k, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|   774k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 774k, False: 0]
  |  Branch (3728:39): [True: 276k, False: 497k]
  |  Branch (3728:62): [True: 96.0k, False: 180k]
  |  Branch (3728:84): [True: 71.7k, False: 24.2k]
  ------------------
 3729|  71.7k|                  it = line_start;
 3730|  71.7k|                  return;
 3731|  71.7k|               }
 3732|   702k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 204k, False: 497k]
  |  Branch (3732:43): [True: 80, False: 204k]
  ------------------
 3733|     80|                  it = line_start;
 3734|     80|                  return;
 3735|     80|               }
 3736|   702k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   702k|            bool established_mapping_indent_this_line = false;
 3740|   702k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 497k, False: 204k]
  ------------------
 3741|   497k|               mapping_indent = line_indent;
 3742|   497k|               established_mapping_indent_this_line = true;
 3743|   497k|               discovered_first_key_visual_indent = line_indent;
 3744|   497k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   497k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 497k, False: 0]
  |  Branch (3745:43): [True: 497k, False: 0]
  ------------------
 3746|   497k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   497k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 76, False: 497k]
  ------------------
 3748|     76|                        ctx.error = error_code::syntax_error;
 3749|     76|                        return;
 3750|     76|                     }
 3751|       |
 3752|   497k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   497k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 496k, False: 1.67k]
  |  Branch (3753:49): [True: 377k, False: 118k]
  ------------------
 3754|   377k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   377k|                     }
 3756|   497k|                  }
 3757|   497k|               }
 3758|   497k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   702k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 702k, False: 76]
  |  Branch (3762:36): [True: 702k, False: 0]
  |  Branch (3762:59): [True: 204k, False: 497k]
  ------------------
 3763|   204k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 50.2k, False: 154k]
  ------------------
 3764|  50.2k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 50.1k, False: 108]
  |  Branch (3764:43): [True: 11.9k, False: 38.2k]
  ------------------
 3765|  11.9k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 14, False: 11.9k]
  ------------------
 3766|     14|                     ctx.error = error_code::syntax_error;
 3767|     14|                     return;
 3768|     14|                  }
 3769|  11.9k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 4.98k, False: 6.95k]
  ------------------
 3770|  4.98k|                     it = line_start;
 3771|  4.98k|                     return;
 3772|  4.98k|                  }
 3773|  11.9k|               }
 3774|  38.3k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 1.44k, False: 36.8k]
  ------------------
 3775|  1.44k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 20, False: 1.42k]
  |  Branch (3775:47): [True: 6, False: 1.41k]
  ------------------
 3776|  1.41k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 1.41k, False: 0]
  |  Branch (3776:49): [True: 1.41k, False: 0]
  |  Branch (3776:72): [True: 2, False: 1.41k]
  ------------------
 3777|     28|                  ctx.error = error_code::syntax_error;
 3778|     28|                  return;
 3779|     28|               }
 3780|  50.2k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   697k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 697k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   697k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 697k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   697k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 76, False: 697k]
  |  Branch (3798:32): [True: 0, False: 697k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   697k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 195k, False: 502k]
  |  Branch (3807:53): [True: 20.9k, False: 174k]
  |  Branch (3807:94): [True: 2.55k, False: 18.4k]
  ------------------
 3808|  2.55k|               const auto after_colon = it + 1;
 3809|  2.55k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 1.07k, False: 1.47k]
  ------------------
 3810|  2.55k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 140, False: 2.41k]
  |  Branch (3810:43): [True: 1.27k, False: 1.13k]
  ------------------
 3811|  1.41k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 92, False: 1.32k]
  ------------------
 3812|     92|                  it = line_start;
 3813|     92|                  return;
 3814|     92|               }
 3815|  2.55k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   697k|            int32_t effective_line_indent = line_indent;
 3819|   697k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 697k, False: 76]
  |  Branch (3819:36): [True: 497k, False: 199k]
  ------------------
 3820|   497k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 377k, False: 120k]
  ------------------
 3821|   377k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 340k, False: 36.4k]
  |  Branch (3821:52): [True: 170k, False: 170k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   207k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   207k|            }
 3834|       |
 3835|   697k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 124k, False: 573k]
  ------------------
 3836|   124k|               return;
 3837|   124k|            }
 3838|   573k|            first_key = false;
 3839|       |
 3840|   573k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 573k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|       |               auto flow_end = it;
 3847|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|       |               if (bool(ctx.error)) [[unlikely]]
 3849|       |                  return;
 3850|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3851|       |                  it = flow_end;
 3852|       |                  return;
 3853|       |               }
 3854|       |            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   573k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 360k, False: 212k]
  ------------------
 3860|   360k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 68.3k, False: 291k]
  |  Branch (3860:34): [True: 2.26k, False: 289k]
  ------------------
 3861|  70.6k|                  auto peek = it;
 3862|  70.6k|                  skip_inline_ws(peek, end);
 3863|  70.6k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 58.2k, False: 12.3k]
  |  Branch (3863:38): [True: 55.5k, False: 2.71k]
  |  Branch (3863:55): [True: 54.6k, False: 896]
  |  Branch (3863:72): [True: 52.9k, False: 1.75k]
  ------------------
 3864|  52.9k|                     continue; // At leading indent of new line
 3865|  52.9k|                  }
 3866|  70.6k|               }
 3867|   307k|               skip_inline_ws(it, end);
 3868|   307k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 295k, False: 12.3k]
  |  Branch (3868:33): [True: 11.1k, False: 283k]
  ------------------
 3869|  11.1k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  11.1k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 11.1k, False: 0]
  ------------------
 3871|  11.1k|                        const char prev = *(it - 1);
 3872|  11.1k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 2.98k, False: 8.16k]
  |  Branch (3872:44): [True: 1.49k, False: 1.49k]
  |  Branch (3872:60): [True: 386, False: 1.10k]
  |  Branch (3872:76): [True: 8, False: 378]
  ------------------
 3873|      8|                           ctx.error = error_code::syntax_error;
 3874|      8|                           return;
 3875|      8|                        }
 3876|  11.1k|                     }
 3877|  11.1k|                  }
 3878|  11.1k|               }
 3879|  11.1k|               skip_comment(it, end);
 3880|   307k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 294k, False: 12.5k]
  |  Branch (3880:34): [True: 101k, False: 192k]
  |  Branch (3880:49): [True: 125k, False: 67.6k]
  ------------------
 3881|   227k|                  skip_newline(it, end);
 3882|   227k|               }
 3883|  80.2k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 67.6k, False: 12.5k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|  67.6k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|  67.6k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 198, False: 67.4k]
  ------------------
 3890|    198|                        ctx.error = error_code::syntax_error;
 3891|    198|                        return;
 3892|    198|                     }
 3893|  67.6k|                  }
 3894|  67.6k|               }
 3895|   307k|            }
 3896|   573k|         }
 3897|   498k|      }
_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:
 4777|   697k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   697k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   697k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   697k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   697k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   697k|                           if (ctx.stream_begin) {
 4788|   697k|                              auto is_line_content_start = [&](auto pos) {
 4789|   697k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   697k|                              };
 4791|       |
 4792|   697k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   697k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   697k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   697k|                                 return line != end && *line == ':';
 4796|   697k|                              };
 4797|       |
 4798|   697k|                              if (!is_line_content_start(it) &&
 4799|   697k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   697k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   697k|                                 ctx.error = error_code::syntax_error;
 4802|   697k|                                 return false;
 4803|   697k|                              }
 4804|   697k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   697k|                           }
 4806|   697k|                        }
 4807|       |
 4808|   697k|                        if (*it == '-' &&
 4809|   697k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   697k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   697k|                           ctx.error = error_code::syntax_error;
 4813|   697k|                           return false;
 4814|   697k|                        }
 4815|       |
 4816|   697k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   697k|                           return false;
 4818|   697k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   697k|                        ctx.pop_indent();
 4820|   697k|                     }
 4821|   697k|                     else {
 4822|   697k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   697k|                        if (nested_indent >= 0) {
 4824|   697k|                           yaml::skip_to_content(it, end);
 4825|   697k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   697k|                              ctx.error = error_code::syntax_error;
 4827|   697k|                              return false;
 4828|   697k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   697k|                           const int32_t value_indent =
 4832|   697k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   697k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   697k|                              return false;
 4835|   697k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   697k|                           ctx.pop_indent();
 4837|   697k|                        }
 4838|   697k|                     }
 4839|   697k|                     return !bool(ctx.error);
 4840|   697k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   697k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 319k, False: 377k]
  |  Branch (4845:37): [True: 319k, False: 506]
  |  Branch (4845:58): [True: 6, False: 319k]
  ------------------
 4846|      6|                     ctx.error = error_code::syntax_error;
 4847|      6|                     return false;
 4848|      6|                  }
 4849|   697k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 319k, False: 377k]
  |  Branch (4849:38): [True: 506, False: 319k]
  |  Branch (4849:57): [True: 151k, False: 168k]
  |  Branch (4849:77): [True: 117k, False: 51.0k]
  |  Branch (4849:98): [True: 29.8k, False: 21.2k]
  ------------------
 4850|   298k|                     ++it; // skip '?'
 4851|   298k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   298k|                     const int32_t explicit_value_indicator_indent =
 4854|   298k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 184k, False: 113k]
  ------------------
 4855|       |
 4856|   298k|                     key_t key{};
 4857|   298k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   298k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   298k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   298k|                        };
 4861|       |
 4862|   298k|                        auto key_it = it;
 4863|   298k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   298k|                        auto content = key_it;
 4866|   298k|                        yaml::skip_to_content(content, end);
 4867|   298k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   298k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 290k, False: 8.29k]
  |  Branch (4872:47): [True: 86.5k, False: 203k]
  ------------------
 4873|  86.5k|                           auto anchor_probe = content + 1;
 4874|  86.5k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|  86.5k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 86.5k, False: 12]
  ------------------
 4876|  86.5k|                              auto after_anchor = anchor_probe;
 4877|  86.5k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|  86.5k|                              auto value_indicator = after_anchor;
 4880|  86.5k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 83.4k, False: 3.14k]
  |  Branch (4880:61): [True: 4.93k, False: 78.4k]
  ------------------
 4881|  4.93k|                                 key.clear();
 4882|  4.93k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  4.93k|                                 it = value_indicator;
 4884|  4.93k|                                 handled_anchor_only_empty_key = true;
 4885|  4.93k|                              }
 4886|  81.6k|                              else {
 4887|  81.6k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 78.4k, False: 3.14k]
  |  Branch (4887:64): [True: 3.44k, False: 75.0k]
  ------------------
 4888|  3.44k|                                    yaml::skip_comment(value_indicator, end);
 4889|  3.44k|                                 }
 4890|  81.6k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 78.4k, False: 3.14k]
  |  Branch (4890:65): [True: 34.1k, False: 44.3k]
  |  Branch (4890:93): [True: 16.5k, False: 27.8k]
  ------------------
 4891|  50.6k|                                    yaml::skip_newline(value_indicator, end);
 4892|  50.6k|                                    auto value_line = value_indicator;
 4893|  50.6k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  50.6k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 6, False: 50.6k]
  ------------------
 4895|      6|                                       return false;
 4896|  50.6k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 47.6k, False: 3.05k]
  |  Branch (4896:62): [True: 3.37k, False: 44.2k]
  ------------------
 4897|  3.37k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 3.37k, False: 6]
  ------------------
 4898|  3.37k|                                       key.clear();
 4899|  3.37k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  3.37k|                                       it = value_line;
 4901|  3.37k|                                       handled_anchor_only_empty_key = true;
 4902|  3.37k|                                    }
 4903|  47.2k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 44.2k, False: 3.05k]
  |  Branch (4903:67): [True: 6, False: 44.2k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|      6|                                       ctx.error = error_code::syntax_error;
 4908|      6|                                       return false;
 4909|      6|                                    }
 4910|  50.6k|                                 }
 4911|  81.6k|                              }
 4912|  86.5k|                           }
 4913|  86.5k|                        }
 4914|       |
 4915|   298k|                        const bool key_content_spans_lines = [&] {
 4916|   298k|                           auto scan = key_it;
 4917|   298k|                           while (scan != content && scan != end) {
 4918|   298k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   298k|                              ++scan;
 4920|   298k|                           }
 4921|   298k|                           return false;
 4922|   298k|                        }();
 4923|       |
 4924|   298k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 8.31k, False: 290k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  8.31k|                        }
 4927|   290k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 8.29k, False: 281k]
  |  Branch (4927:53): [True: 3.13k, False: 278k]
  |  Branch (4927:72): [True: 2.24k, False: 888]
  ------------------
 4928|  10.5k|                           key.clear();
 4929|  10.5k|                           it = content;
 4930|  10.5k|                        }
 4931|   279k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   279k|                           auto key_node_it = content;
 4937|   279k|                           auto key_node_end = end;
 4938|   279k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   279k|                              auto scan = content;
 4943|  1.23M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 1.16M, False: 76.0k]
  ------------------
 4944|  23.1M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 22.9M, False: 169k]
  |  Branch (4944:56): [True: 22.4M, False: 533k]
  |  Branch (4944:73): [True: 22.0M, False: 458k]
  ------------------
 4945|  22.0M|                                    ++scan;
 4946|  22.0M|                                 }
 4947|  1.16M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 169k, False: 991k]
  ------------------
 4948|   169k|                                    break;
 4949|   169k|                                 }
 4950|       |
 4951|   991k|                                 yaml::skip_newline(scan, end);
 4952|   991k|                                 auto line_start = scan;
 4953|       |
 4954|   991k|                                 int32_t indicator_indent = 0;
 4955|  1.50M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 1.43M, False: 76.0k]
  |  Branch (4955:56): [True: 515k, False: 915k]
  ------------------
 4956|   515k|                                    ++indicator_indent;
 4957|   515k|                                    ++scan;
 4958|   515k|                                 }
 4959|       |
 4960|   991k|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 915k, False: 76.0k]
  |  Branch (4960:53): [True: 77.4k, False: 838k]
  ------------------
 4961|  77.4k|                                    const auto after_colon = scan + 1;
 4962|  77.4k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 1.31k, False: 76.1k]
  ------------------
 4963|  76.1k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 41.3k, False: 34.7k]
  ------------------
 4964|  42.7k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 34.4k, False: 8.28k]
  ------------------
 4965|  34.4k|                                       key_node_end = line_start;
 4966|  34.4k|                                       break;
 4967|  34.4k|                                    }
 4968|  77.4k|                                 }
 4969|   991k|                              }
 4970|   279k|                           }
 4971|       |
 4972|   279k|                           glz::generic key_node{};
 4973|   279k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   279k|                           ctx.explicit_mapping_key_context = true;
 4975|   279k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   279k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   279k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 14.6k, False: 265k]
  ------------------
 4978|  14.6k|                              return false;
 4979|   265k|                           it = key_node_it;
 4980|   265k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 12, False: 264k]
  ------------------
 4981|     12|                              return false;
 4982|   265k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   283k|                     yaml::skip_inline_ws(it, end);
 4993|   298k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   298k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 186k, False: 111k]
  |  Branch (4996:40): [True: 55.5k, False: 131k]
  |  Branch (4996:55): [True: 58.9k, False: 72.3k]
  ------------------
 4997|   114k|                        auto probe = it;
 4998|   114k|                        bool found_value_indicator = false;
 4999|       |
 5000|   182k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 155k, False: 26.6k]
  |  Branch (5000:49): [True: 71.8k, False: 83.8k]
  |  Branch (5000:67): [True: 83.8k, False: 0]
  ------------------
 5001|   155k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   155k|                           auto value_line = probe;
 5004|   155k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   155k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 8, False: 155k]
  ------------------
 5006|      8|                              return false;
 5007|       |
 5008|   155k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 15.5k, False: 140k]
  |  Branch (5008:53): [True: 11.8k, False: 128k]
  |  Branch (5008:76): [True: 11.9k, False: 116k]
  ------------------
 5009|  39.3k|                              probe = value_line;
 5010|  39.3k|                              continue; // blank line
 5011|  39.3k|                           }
 5012|   116k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 28.4k, False: 87.9k]
  ------------------
 5013|  28.4k|                              yaml::skip_comment(value_line, end);
 5014|  28.4k|                              probe = value_line;
 5015|  28.4k|                              continue; // comment-only line
 5016|  28.4k|                           }
 5017|  87.9k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 14.8k, False: 73.1k]
  |  Branch (5017:54): [True: 11.1k, False: 3.70k]
  ------------------
 5018|  11.1k|                              it = value_line;
 5019|  11.1k|                              found_value_indicator = true;
 5020|  11.1k|                           }
 5021|  87.9k|                           break;
 5022|   116k|                        }
 5023|       |
 5024|   114k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 11.1k, False: 103k]
  ------------------
 5025|  11.1k|                           yaml::skip_inline_ws(it, end);
 5026|  11.1k|                        }
 5027|   114k|                     }
 5028|       |
 5029|   298k|                     val_t val{};
 5030|   298k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 186k, False: 111k]
  |  Branch (5030:39): [True: 59.6k, False: 127k]
  ------------------
 5031|  59.6k|                        ++it;
 5032|  59.6k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 59.2k, False: 358]
  |  Branch (5032:42): [True: 6, False: 59.2k]
  ------------------
 5033|      6|                           ctx.error = error_code::syntax_error;
 5034|      6|                           return false;
 5035|      6|                        }
 5036|  59.6k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 59.2k, False: 358]
  |  Branch (5036:43): [True: 4.67k, False: 54.5k]
  |  Branch (5036:58): [True: 2.35k, False: 52.2k]
  ------------------
 5037|  7.02k|                           auto probe = it;
 5038|  7.02k|                           yaml::skip_newline(probe, end);
 5039|  14.4k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 12.2k, False: 2.19k]
  |  Branch (5039:51): [True: 7.42k, False: 4.83k]
  ------------------
 5040|  7.02k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 4.83k, False: 2.19k]
  |  Branch (5040:48): [True: 670, False: 4.16k]
  |  Branch (5040:65): [True: 670, False: 0]
  |  Branch (5040:89): [True: 0, False: 670]
  ------------------
 5041|      0|                              ctx.error = error_code::syntax_error;
 5042|      0|                              return false;
 5043|      0|                           }
 5044|  7.02k|                        }
 5045|  59.6k|                        yaml::skip_inline_ws(it, end);
 5046|  59.6k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 11.1k, False: 48.5k]
  ------------------
 5047|  11.1k|                           return false;
 5048|  59.6k|                     }
 5049|       |
 5050|   287k|                     value.emplace(std::move(key), std::move(val));
 5051|   287k|                     return true;
 5052|   298k|                  }
 5053|       |
 5054|   398k|                  key_t key{};
 5055|   398k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   398k|                     auto key_probe = it;
 5057|   398k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   398k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 398k, False: 0]
  |  Branch (5058:74): [True: 330, False: 398k]
  |  Branch (5058:95): [True: 4.98k, False: 393k]
  ------------------
 5059|   398k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 5.31k, False: 393k]
  ------------------
 5060|  5.31k|                        glz::generic key_node{};
 5061|  5.31k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  5.31k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 3.23k, False: 2.08k]
  ------------------
 5063|  3.23k|                           return false;
 5064|  2.08k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 0, False: 2.08k]
  ------------------
 5065|      0|                           return false;
 5066|  2.08k|                     }
 5067|   393k|                     else {
 5068|   393k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 70.0k, False: 323k]
  ------------------
 5069|  70.0k|                           return false;
 5070|  70.0k|                        }
 5071|   393k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   325k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   398k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 73.3k, False: 325k]
  |  Branch (5081:36): [True: 72, False: 325k]
  ------------------
 5082|    152|                     ctx.error = error_code::syntax_error;
 5083|    152|                     return false;
 5084|    152|                  }
 5085|   398k|                  ++it;
 5086|   398k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   398k|                  val_t val{};
 5089|   398k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 25.0k, False: 373k]
  ------------------
 5090|  25.0k|                     return false;
 5091|       |
 5092|   373k|                  value.emplace(std::move(key), std::move(val));
 5093|   373k|                  return true;
 5094|   398k|               });
_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:
 4915|   298k|                        const bool key_content_spans_lines = [&] {
 4916|   298k|                           auto scan = key_it;
 4917|   324k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 198k, False: 126k]
  |  Branch (4917:54): [True: 198k, False: 0]
  ------------------
 4918|   198k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 119k, False: 78.8k]
  |  Branch (4918:52): [True: 52.9k, False: 25.9k]
  ------------------
 4919|  25.9k|                              ++scan;
 4920|  25.9k|                           }
 4921|   126k|                           return false;
 4922|   298k|                        }();
_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_:
 4858|   265k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   265k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   265k|                        };
_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_:
 4778|   385k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   385k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 368k, False: 16.9k]
  |  Branch (4779:39): [True: 250k, False: 117k]
  ------------------
 4780|   250k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   250k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   250k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 250k, False: 0]
  ------------------
 4788|   250k|                              auto is_line_content_start = [&](auto pos) {
 4789|   250k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   250k|                              };
 4791|       |
 4792|   250k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   250k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   250k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   250k|                                 return line != end && *line == ':';
 4796|   250k|                              };
 4797|       |
 4798|   250k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 250k, False: 0]
  ------------------
 4799|   250k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 11.2k, False: 239k]
  ------------------
 4800|  11.2k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 16, False: 11.2k]
  ------------------
 4801|     16|                                 ctx.error = error_code::syntax_error;
 4802|     16|                                 return false;
 4803|     16|                              }
 4804|   250k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   250k|                           }
 4806|   250k|                        }
 4807|       |
 4808|   250k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 2.48k, False: 248k]
  ------------------
 4809|  2.48k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 626, False: 1.85k]
  |  Branch (4809:49): [True: 614, False: 1.24k]
  ------------------
 4810|  1.24k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 12, False: 1.22k]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|     12|                           ctx.error = error_code::syntax_error;
 4813|     12|                           return false;
 4814|     12|                        }
 4815|       |
 4816|   250k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 250k]
  ------------------
 4817|      0|                           return false;
 4818|   250k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   250k|                        ctx.pop_indent();
 4820|   250k|                     }
 4821|   134k|                     else {
 4822|   134k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   134k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 51.0k, False: 83.5k]
  ------------------
 4824|  51.0k|                           yaml::skip_to_content(it, end);
 4825|  51.0k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 51.0k, False: 0]
  |  Branch (4825:45): [True: 0, False: 51.0k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  51.0k|                           const int32_t value_indent =
 4832|  51.0k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 51.0k]
  ------------------
 4833|  51.0k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 51.0k]
  ------------------
 4834|      0|                              return false;
 4835|  51.0k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  51.0k|                           ctx.pop_indent();
 4837|  51.0k|                        }
 4838|   134k|                     }
 4839|   385k|                     return !bool(ctx.error);
 4840|   385k|                  };
_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_:
 4788|   250k|                              auto is_line_content_start = [&](auto pos) {
 4789|   250k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   250k|                              };
_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_:
 4792|   261k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   261k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   487k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 487k, False: 0]
  |  Branch (4794:57): [True: 221k, False: 266k]
  |  Branch (4794:73): [True: 4.28k, False: 261k]
  ------------------
 4795|   261k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 261k, False: 0]
  |  Branch (4795:56): [True: 81.6k, False: 180k]
  ------------------
 4796|   261k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|   658k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   658k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 658k]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|   658k|            }
_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|  8.57k|      {
  301|  8.57k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 8.57k]
  |  Branch (301:27): [True: 0, False: 8.57k]
  ------------------
  302|       |
  303|  8.57k|         ++it; // skip '*'
  304|  8.57k|         auto name = parse_anchor_name(it, end);
  305|  8.57k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 44, False: 8.52k]
  ------------------
  306|     44|            ctx.error = error_code::syntax_error;
  307|     44|            return true;
  308|     44|         }
  309|       |
  310|  8.52k|         auto anchor_it = ctx.anchors.find(name);
  311|  8.52k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 62, False: 8.46k]
  ------------------
  312|     62|            ctx.error = error_code::syntax_error; // undefined alias
  313|     62|            return true;
  314|     62|         }
  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.46k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  8.46k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 302, False: 8.16k]
  ------------------
  322|    302|            return true;
  323|    302|         }
  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.16k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 852, False: 7.31k]
  ------------------
  329|    852|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    852|            return true;
  331|    852|         }
  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.31k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  7.31k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 7.30k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  7.30k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 7.30k]
  ------------------
  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.30k|         auto replay_it = span.begin;
  348|  7.30k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  7.30k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  7.30k|         ctx.indent_stack.clear();
  353|  7.30k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 5.77k, False: 1.53k]
  ------------------
  354|  5.77k|            ctx.push_indent(span.base_indent - 1);
  355|  5.77k|         }
  356|       |
  357|  7.30k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  7.30k|         using V = std::remove_cvref_t<T>;
  360|  7.30k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  7.30k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  7.30k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  7.30k|         return true;
  367|  7.30k|      }
_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_:
 5205|   438k|      {
 5206|   438k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   438k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   438k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   438k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   438k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 438k, False: 0]
  ------------------
 5216|   438k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   438k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1892|   443k|      {
 1893|   443k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 10.5k, False: 433k]
  ------------------
 1894|  10.5k|            return;
 1895|       |
 1896|   433k|         yaml::node_preamble_state preamble{};
 1897|   433k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 5.16k, False: 428k]
  ------------------
 1898|   433k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  5.16k|            return;
 1900|       |
 1901|   428k|         std::string str;
 1902|   428k|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|   428k|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 428k, False: 0]
  ------------------
 1905|  4.12k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 4.12k, False: 423k]
  ------------------
 1906|  4.12k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|  4.12k|            break;
 1908|  5.75k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 5.75k, False: 422k]
  ------------------
 1909|  5.75k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  5.75k|            break;
 1911|    712|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 712, False: 427k]
  ------------------
 1912|  4.29k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 3.58k, False: 424k]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  4.29k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  4.29k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 892, False: 3.40k]
  ------------------
 1918|  4.29k|            break;
 1919|   413k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 413k, False: 14.1k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|   413k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|   413k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1923:20): [True: 270k, False: 143k]
  ------------------
 1924|   270k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|   270k|               }
 1926|   143k|               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|   143k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|   143k|               }
 1930|       |            }
 1931|       |            else {
 1932|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|       |            }
 1934|   413k|            break;
 1935|   428k|         }
 1936|       |
 1937|   428k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 427k, False: 150]
  ------------------
 1938|   427k|            value = std::move(str);
 1939|   427k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|   427k|         }
 1941|   428k|      }
_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|   433k|      {
  466|   433k|         skip_inline_ws(it, end);
  467|       |
  468|   433k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 433k]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|   433k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   433k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 12, False: 433k]
  ------------------
  477|     12|            ctx.error = error_code::syntax_error;
  478|     12|            return true;
  479|     12|         }
  480|   433k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 433k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|   433k|         skip_inline_ws(it, end);
  486|       |
  487|   433k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 8, False: 433k]
  ------------------
  488|      8|            if constexpr (!AllowEmptyInput) {
  489|      8|               ctx.error = error_code::unexpected_end;
  490|      8|            }
  491|      8|            return true;
  492|      8|         }
  493|       |
  494|   433k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.13k, False: 428k]
  ------------------
  495|  5.13k|            return true;
  496|  5.13k|         }
  497|       |
  498|   428k|         return false;
  499|   433k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1898|   433k|                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|   433k|      {
  409|   433k|         state.has_anchor = false;
  410|   433k|         state.anchor_name.clear();
  411|   433k|         state.anchor_start = nullptr;
  412|   433k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   433k|         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|   433k|            else {
  421|   433k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.09k, False: 428k]
  ------------------
  422|   433k|            }
  423|   433k|         }
  424|       |
  425|   433k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 428k, False: 5.09k]
  |  Branch (425:27): [True: 10.3k, False: 417k]
  ------------------
  426|  10.3k|            ++it;
  427|  10.3k|            auto name = parse_anchor_name(it, end);
  428|  10.3k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 20, False: 10.3k]
  ------------------
  429|     20|               ctx.error = error_code::syntax_error;
  430|     20|               return true;
  431|     20|            }
  432|  10.3k|            skip_inline_ws(it, end);
  433|  10.3k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 16, False: 10.3k]
  ------------------
  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|  10.3k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  10.3k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 6, False: 10.2k]
  ------------------
  441|      6|                  ctx.error = error_code::syntax_error;
  442|      6|                  return true;
  443|      6|               }
  444|  10.3k|            }
  445|  10.2k|            state.has_anchor = true;
  446|  10.3k|            state.anchor_name = std::string(name);
  447|  10.3k|            state.anchor_start = &*it;
  448|  10.3k|         }
  449|       |
  450|   433k|         return false;
  451|   433k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   433k|      {
  301|   433k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 433k]
  |  Branch (301:27): [True: 428k, False: 5.09k]
  ------------------
  302|       |
  303|  5.09k|         ++it; // skip '*'
  304|  5.09k|         auto name = parse_anchor_name(it, end);
  305|  5.09k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 14, False: 5.07k]
  ------------------
  306|     14|            ctx.error = error_code::syntax_error;
  307|     14|            return true;
  308|     14|         }
  309|       |
  310|  5.07k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.07k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 38, False: 5.03k]
  ------------------
  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|  5.03k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.03k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 248, False: 4.79k]
  ------------------
  322|    248|            return true;
  323|    248|         }
  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.79k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 8, False: 4.78k]
  ------------------
  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|  4.78k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.78k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 12, False: 4.77k]
  ------------------
  339|     12|            return true;
  340|       |
  341|  4.77k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.77k]
  ------------------
  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.77k|         auto replay_it = span.begin;
  348|  4.77k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.77k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.77k|         ctx.indent_stack.clear();
  353|  4.77k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.58k, False: 3.18k]
  ------------------
  354|  1.58k|            ctx.push_indent(span.base_indent - 1);
  355|  1.58k|         }
  356|       |
  357|  4.77k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.77k|         using V = std::remove_cvref_t<T>;
  360|  4.77k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.77k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.77k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.77k|         return true;
  367|  4.77k|      }
_ZN3glz4yaml28parse_plain_scalar_multilineINS0_12yaml_contextEPKcS4_EEvRNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERT_RT0_T1_i:
 1147|   758k|      {
 1148|   758k|         value.clear();
 1149|       |
 1150|   185M|         while (it != end) {
  ------------------
  |  Branch (1150:17): [True: 184M, False: 267k]
  ------------------
 1151|   184M|            const char c = *it;
 1152|       |
 1153|       |            // Check for newline - potential continuation
 1154|   184M|            if (c == '\n' || c == '\r') {
  ------------------
  |  Branch (1154:17): [True: 966k, False: 183M]
  |  Branch (1154:30): [True: 346k, False: 183M]
  ------------------
 1155|       |               // Trim trailing whitespace from current line
 1156|  1.45M|               while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1156:23): [True: 1.44M, False: 17.4k]
  |  Branch (1156:42): [True: 95.1k, False: 1.34M]
  |  Branch (1156:65): [True: 50.0k, False: 1.29M]
  ------------------
 1157|   145k|                  value.pop_back();
 1158|   145k|               }
 1159|       |
 1160|       |               // Count consecutive blank lines
 1161|  1.31M|               int blank_lines = 0;
 1162|  1.31M|               auto lookahead = it;
 1163|       |
 1164|  1.62M|               while (lookahead != end) {
  ------------------
  |  Branch (1164:23): [True: 1.49M, False: 122k]
  ------------------
 1165|       |                  // Skip the newline
 1166|  1.49M|                  if (*lookahead == '\r' && (lookahead + 1) != end && *(lookahead + 1) == '\n') {
  ------------------
  |  Branch (1166:23): [True: 446k, False: 1.05M]
  |  Branch (1166:45): [True: 348k, False: 97.3k]
  |  Branch (1166:71): [True: 28.9k, False: 319k]
  ------------------
 1167|  28.9k|                     ++lookahead;
 1168|  28.9k|                  }
 1169|  1.49M|                  if (lookahead != end && (*lookahead == '\n' || *lookahead == '\r')) {
  ------------------
  |  Branch (1169:23): [True: 1.49M, False: 0]
  |  Branch (1169:44): [True: 1.08M, False: 417k]
  |  Branch (1169:66): [True: 417k, False: 0]
  ------------------
 1170|  1.49M|                     ++lookahead;
 1171|  1.49M|                  }
 1172|      0|                  else {
 1173|      0|                     break;
 1174|      0|                  }
 1175|       |
 1176|       |                  // Check if this is a blank line or comment-only line
 1177|  1.49M|                  int32_t line_indent = 0;
 1178|       |
 1179|  1.82M|                  while (lookahead != end && (*lookahead == ' ' || *lookahead == '\t')) {
  ------------------
  |  Branch (1179:26): [True: 1.70M, False: 122k]
  |  Branch (1179:47): [True: 245k, False: 1.45M]
  |  Branch (1179:68): [True: 82.7k, False: 1.37M]
  ------------------
 1180|   327k|                     ++line_indent;
 1181|   327k|                     ++lookahead;
 1182|   327k|                  }
 1183|       |
 1184|  1.49M|                  if (lookahead == end || *lookahead == '\n' || *lookahead == '\r') {
  ------------------
  |  Branch (1184:23): [True: 122k, False: 1.37M]
  |  Branch (1184:43): [True: 86.7k, False: 1.28M]
  |  Branch (1184:65): [True: 100k, False: 1.18M]
  ------------------
 1185|       |                     // Blank line
 1186|   309k|                     ++blank_lines;
 1187|   309k|                     continue;
 1188|   309k|                  }
 1189|       |
 1190|  1.18M|                  if (*lookahead == '#') {
  ------------------
  |  Branch (1190:23): [True: 56.4k, False: 1.13M]
  ------------------
 1191|       |                     // Comments end plain scalars per YAML spec
 1192|  56.4k|                     return;
 1193|  56.4k|                  }
 1194|       |
 1195|       |                  // Found content - check indentation
 1196|       |                  // Continuation lines must not dedent below the parent block.
 1197|  1.13M|                  if (line_indent < base_indent) {
  ------------------
  |  Branch (1197:23): [True: 145k, False: 987k]
  ------------------
 1198|       |                     // Dedented - end of scalar
 1199|   145k|                     return;
 1200|   145k|                  }
 1201|       |
 1202|       |                  // Document boundary markers at column 0 start/stop documents and
 1203|       |                  // must terminate a top-level plain scalar continuation.
 1204|   987k|                  if (line_indent == 0 && (at_document_start(lookahead, end) || at_document_end(lookahead, end))) {
  ------------------
  |  Branch (1204:23): [True: 873k, False: 114k]
  |  Branch (1204:44): [True: 1.73k, False: 871k]
  |  Branch (1204:81): [True: 7.94k, False: 863k]
  ------------------
 1205|  9.67k|                     return;
 1206|  9.67k|                  }
 1207|       |
 1208|       |                  // Sequence indicator (- followed by space/newline/end).
 1209|       |                  // Terminates the scalar when the dash is at or above the
 1210|       |                  // enclosing sequence's indicator column, meaning it starts
 1211|       |                  // a sibling entry.  A dash deeper than the indicator is
 1212|       |                  // plain content (yaml-test-suite AB8U).
 1213|   977k|                  if (*lookahead == '-') {
  ------------------
  |  Branch (1213:23): [True: 39.3k, False: 938k]
  ------------------
 1214|  39.3k|                     auto after_dash = lookahead + 1;
 1215|  39.3k|                     if (after_dash == end || *after_dash == ' ' || *after_dash == '\t' || *after_dash == '\n' ||
  ------------------
  |  Branch (1215:26): [True: 270, False: 39.1k]
  |  Branch (1215:47): [True: 4.01k, False: 35.1k]
  |  Branch (1215:69): [True: 1.76k, False: 33.3k]
  |  Branch (1215:92): [True: 6.91k, False: 26.4k]
  ------------------
 1216|  26.4k|                         *after_dash == '\r') {
  ------------------
  |  Branch (1216:26): [True: 1.73k, False: 24.6k]
  ------------------
 1217|  14.7k|                        if (ctx.sequence_dash_indent < 0 || line_indent <= ctx.sequence_dash_indent) {
  ------------------
  |  Branch (1217:29): [True: 3.75k, False: 10.9k]
  |  Branch (1217:61): [True: 10.4k, False: 486]
  ------------------
 1218|  14.2k|                           return;
 1219|  14.2k|                        }
 1220|  14.7k|                     }
 1221|  39.3k|                  }
 1222|       |
 1223|   963k|                  if (ctx.explicit_mapping_key_context) {
  ------------------
  |  Branch (1223:23): [True: 136k, False: 826k]
  ------------------
 1224|       |                     // In explicit mapping keys ("? key"), a following explicit
 1225|       |                     // key/value indicator starts a new mapping entry.
 1226|   136k|                     if (*lookahead == '?' || *lookahead == ':') {
  ------------------
  |  Branch (1226:26): [True: 51.8k, False: 85.0k]
  |  Branch (1226:47): [True: 7.19k, False: 77.8k]
  ------------------
 1227|  59.0k|                        auto after = lookahead + 1;
 1228|  59.0k|                        if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (1228:29): [True: 386, False: 58.6k]
  |  Branch (1228:45): [True: 20.1k, False: 38.4k]
  |  Branch (1228:62): [True: 2.15k, False: 36.3k]
  |  Branch (1228:80): [True: 8.62k, False: 27.6k]
  |  Branch (1228:98): [True: 2.91k, False: 24.7k]
  ------------------
 1229|  34.2k|                           return;
 1230|  34.2k|                        }
 1231|  59.0k|                     }
 1232|       |
 1233|       |                     // Node-property indicators at the start of a continuation
 1234|       |                     // line begin a new key node in explicit-key context.
 1235|   102k|                     if (*lookahead == '&' || *lookahead == '*' || *lookahead == '!') {
  ------------------
  |  Branch (1235:26): [True: 604, False: 101k]
  |  Branch (1235:47): [True: 16.9k, False: 85.0k]
  |  Branch (1235:68): [True: 498, False: 84.5k]
  ------------------
 1236|  18.0k|                        return;
 1237|  18.0k|                     }
 1238|   102k|                  }
 1239|       |
 1240|       |                  // In a "- item" value context, an anchor/tag/alias at the start
 1241|       |                  // of a continuation candidate starts a new node, not scalar content.
 1242|   911k|                  if (ctx.sequence_item_value_context &&
  ------------------
  |  Branch (1242:23): [True: 25.3k, False: 885k]
  ------------------
 1243|  25.3k|                      (*lookahead == '&' || *lookahead == '*' || *lookahead == '!')) {
  ------------------
  |  Branch (1243:24): [True: 528, False: 24.7k]
  |  Branch (1243:45): [True: 454, False: 24.3k]
  |  Branch (1243:66): [True: 230, False: 24.1k]
  ------------------
 1244|  1.21k|                     return;
 1245|  1.21k|                  }
 1246|       |
 1247|       |                  // Check for mapping key indicator (content followed by : and space)
 1248|       |                  // This is a heuristic - we look for ": " pattern which indicates a mapping key
 1249|   910k|                  {
 1250|   910k|                     auto scan = lookahead;
 1251|  69.1M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (1251:29): [True: 69.0M, False: 59.3k]
  |  Branch (1251:44): [True: 68.3M, False: 727k]
  |  Branch (1251:61): [True: 68.2M, False: 87.2k]
  ------------------
 1252|  68.2M|                        if (*scan == ':') {
  ------------------
  |  Branch (1252:29): [True: 87.3k, False: 68.1M]
  ------------------
 1253|  87.3k|                           auto after_colon = scan + 1;
 1254|  87.3k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (1254:32): [True: 1.99k, False: 85.3k]
  |  Branch (1254:54): [True: 12.7k, False: 72.6k]
  |  Branch (1254:77): [True: 470, False: 72.1k]
  ------------------
 1255|  72.1k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (1255:32): [True: 7.34k, False: 64.7k]
  |  Branch (1255:56): [True: 13.7k, False: 51.0k]
  ------------------
 1256|       |                              // This looks like a mapping key - end the scalar
 1257|  36.3k|                              return;
 1258|  36.3k|                           }
 1259|  87.3k|                        }
 1260|  68.2M|                        ++scan;
 1261|  68.2M|                     }
 1262|   910k|                  }
 1263|       |
 1264|       |                  // This is a continuation line
 1265|       |                  // Add appropriate line breaks for blank lines
 1266|   968k|                  for (int i = 0; i < blank_lines; ++i) {
  ------------------
  |  Branch (1266:35): [True: 94.9k, False: 873k]
  ------------------
 1267|  94.9k|                     value.push_back('\n');
 1268|  94.9k|                  }
 1269|       |
 1270|       |                  // Add a space to fold the newline (unless we added literal newlines for blank lines)
 1271|   873k|                  if (blank_lines == 0 && !value.empty()) {
  ------------------
  |  Branch (1271:23): [True: 838k, False: 35.1k]
  |  Branch (1271:43): [True: 833k, False: 4.74k]
  ------------------
 1272|   833k|                     value.push_back(' ');
 1273|   833k|                  }
 1274|       |
 1275|       |                  // Move iterator to the content position
 1276|   873k|                  it = lookahead;
 1277|   873k|                  break;
 1278|   910k|               }
 1279|       |
 1280|       |               // If we exhausted the lookahead, we're done
 1281|   996k|               if (lookahead == end) {
  ------------------
  |  Branch (1281:20): [True: 122k, False: 873k]
  ------------------
 1282|   122k|                  return;
 1283|   122k|               }
 1284|       |
 1285|   873k|               continue; // Process the character at the new position
 1286|   996k|            }
 1287|       |
 1288|       |            // Per YAML spec: # only starts a comment when preceded by whitespace
 1289|   183M|            if (c == '#') {
  ------------------
  |  Branch (1289:17): [True: 271k, False: 183M]
  ------------------
 1290|   271k|               if (value.empty() || value.back() == ' ' || value.back() == '\t') {
  ------------------
  |  Branch (1290:20): [True: 2.30k, False: 268k]
  |  Branch (1290:37): [True: 19.7k, False: 249k]
  |  Branch (1290:60): [True: 4.59k, False: 244k]
  ------------------
 1291|  26.5k|                  break; // This is a comment
 1292|  26.5k|               }
 1293|   271k|            }
 1294|       |
 1295|       |            // Colon followed by space/newline ends plain scalar (potential nested mapping)
 1296|   183M|            if (c == ':') {
  ------------------
  |  Branch (1296:17): [True: 375k, False: 183M]
  ------------------
 1297|   375k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (1297:20): [True: 3.44k, False: 371k]
  |  Branch (1297:39): [True: 10.3k, False: 361k]
  |  Branch (1297:59): [True: 140, False: 361k]
  |  Branch (1297:80): [True: 3.92k, False: 357k]
  |  Branch (1297:101): [True: 7.66k, False: 349k]
  ------------------
 1298|  25.5k|                  break;
 1299|  25.5k|               }
 1300|   375k|            }
 1301|       |
 1302|   183M|            value.push_back(c);
 1303|   183M|            ++it;
 1304|   183M|         }
 1305|       |
 1306|       |         // Trim trailing whitespace
 1307|   419k|         while (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
  ------------------
  |  Branch (1307:17): [True: 417k, False: 2.36k]
  |  Branch (1307:36): [True: 82.5k, False: 334k]
  |  Branch (1307:59): [True: 17.1k, False: 317k]
  ------------------
 1308|  99.7k|            value.pop_back();
 1309|  99.7k|         }
 1310|   319k|      }
_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_:
 5205|   221k|      {
 5206|   221k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   221k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   221k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   221k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   221k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 221k, False: 0]
  ------------------
 5216|   221k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   221k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2047|   221k|      {
 2048|   221k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 221k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|   221k|         yaml::node_preamble_state preamble{};
 2052|   221k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 5.59k, False: 216k]
  ------------------
 2053|   221k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   221k|                   return yaml::tag_valid_for_float(tag);
 2055|   221k|                }
 2056|   221k|                else {
 2057|   221k|                   return yaml::tag_valid_for_int(tag);
 2058|   221k|                }
 2059|   221k|             }))
 2060|  5.59k|            return;
 2061|       |
 2062|   216k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|   216k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|   216k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|   216k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 31.1k, False: 185k]
  ------------------
 2070|  31.1k|               ++it;
 2071|  31.1k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 29.8k, False: 1.34k]
  |  Branch (2071:38): [True: 5.32k, False: 24.4k]
  |  Branch (2071:74): [True: 254, False: 24.2k]
  ------------------
 2072|  24.2k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 194, False: 24.0k]
  ------------------
 2073|  5.77k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  5.77k|                  it += 3;
 2075|  5.77k|                  finalize();
 2076|  5.77k|                  return;
 2077|  5.77k|               }
 2078|  25.3k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 24.0k, False: 1.34k]
  |  Branch (2078:38): [True: 298, False: 23.7k]
  |  Branch (2078:74): [True: 954, False: 22.7k]
  ------------------
 2079|  22.7k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 132, False: 22.6k]
  ------------------
 2080|  1.38k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  1.38k|                  it += 3;
 2082|  1.38k|                  finalize();
 2083|  1.38k|                  return;
 2084|  1.38k|               }
 2085|  24.0k|               it = start;
 2086|  24.0k|            }
 2087|       |
 2088|   209k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 77.7k, False: 131k]
  |  Branch (2088:31): [True: 45.8k, False: 85.4k]
  ------------------
 2089|   123k|               const char sign = *it;
 2090|   123k|               ++it;
 2091|   123k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 122k, False: 1.42k]
  |  Branch (2091:33): [True: 74.2k, False: 47.9k]
  ------------------
 2092|  74.2k|                  ++it;
 2093|  74.2k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 73.3k, False: 896]
  |  Branch (2093:41): [True: 62.2k, False: 11.0k]
  |  Branch (2093:77): [True: 468, False: 10.5k]
  ------------------
 2094|  63.5k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 832, False: 9.73k]
  ------------------
 2095|  63.5k|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 61.4k, False: 2.14k]
  ------------------
 2096|  61.4k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|  61.4k|                     }
 2098|  2.14k|                     else {
 2099|  2.14k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|  2.14k|                     }
 2101|  63.5k|                     it += 3;
 2102|  63.5k|                     finalize();
 2103|  63.5k|                     return;
 2104|  63.5k|                  }
 2105|  74.2k|               }
 2106|  60.0k|               it = start;
 2107|  60.0k|            }
 2108|   209k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|   145k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  5.31M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 5.21M, False: 95.0k]
  ------------------
 2115|  5.21M|            const char c = *it;
 2116|  5.21M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 65.7k, False: 5.15M]
  |  Branch (2116:29): [True: 11.3k, False: 5.14M]
  |  Branch (2116:42): [True: 10.7k, False: 5.13M]
  |  Branch (2116:55): [True: 8.50k, False: 5.12M]
  |  Branch (2116:68): [True: 902, False: 5.12M]
  |  Branch (2116:80): [True: 476, False: 5.12M]
  |  Branch (2116:92): [True: 782, False: 5.11M]
  |  Branch (2116:104): [True: 11.5k, False: 5.10M]
  ------------------
 2117|   110k|               break;
 2118|   110k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  5.10M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 25.8k, False: 5.08M]
  ------------------
 2121|  25.8k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 892, False: 24.9k]
  |  Branch (2121:39): [True: 2.63k, False: 22.3k]
  |  Branch (2121:59): [True: 248, False: 22.1k]
  |  Branch (2121:80): [True: 4.63k, False: 17.4k]
  |  Branch (2121:101): [True: 2.75k, False: 14.7k]
  ------------------
 2122|  11.1k|                  break;
 2123|  11.1k|               }
 2124|  25.8k|            }
 2125|  5.09M|            ++it;
 2126|  5.09M|         }
 2127|       |
 2128|   216k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|   216k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 2.83k, False: 213k]
  ------------------
 2131|  2.83k|            ctx.error = error_code::parse_number_failure;
 2132|  2.83k|            return;
 2133|  2.83k|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|   213k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|   213k|            bool negative = false;
 2186|   213k|            std::string_view digits = num_str;
 2187|       |
 2188|   213k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 142k, False: 70.7k]
  |  Branch (2188:37): [True: 43.7k, False: 98.9k]
  |  Branch (2188:62): [True: 16.3k, False: 82.6k]
  ------------------
 2189|  60.0k|               negative = (digits.front() == '-');
 2190|  60.0k|               digits.remove_prefix(1);
 2191|  60.0k|            }
 2192|       |
 2193|   213k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 99.3k, False: 114k]
  |  Branch (2193:38): [True: 37.2k, False: 62.0k]
  ------------------
 2194|  37.2k|               int base = 10;
 2195|  37.2k|               size_t offset = 0;
 2196|       |
 2197|  37.2k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 25.4k, False: 11.8k]
  |  Branch (2197:40): [True: 404, False: 11.4k]
  ------------------
 2198|  25.8k|                  base = 16;
 2199|  25.8k|                  offset = 2;
 2200|  25.8k|               }
 2201|  11.4k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 1.20k, False: 10.2k]
  |  Branch (2201:45): [True: 500, False: 9.76k]
  ------------------
 2202|  1.70k|                  base = 8;
 2203|  1.70k|                  offset = 2;
 2204|  1.70k|               }
 2205|  9.76k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 4.40k, False: 5.35k]
  |  Branch (2205:45): [True: 380, False: 4.97k]
  ------------------
 2206|  4.78k|                  base = 2;
 2207|  4.78k|                  offset = 2;
 2208|  4.78k|               }
 2209|       |
 2210|  37.2k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 32.3k, False: 4.97k]
  ------------------
 2211|  32.3k|                  auto raw_digits = digits.substr(offset);
 2212|  32.3k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  32.3k|                  std::string clean_storage;
 2215|  32.3k|                  std::string_view clean_view;
 2216|  32.3k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 3.39k, False: 28.9k]
  ------------------
 2217|  3.39k|                     clean_storage.reserve(raw_digits.size());
 2218|  66.2k|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 66.2k, False: 3.39k]
  ------------------
 2219|  66.2k|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 62.0k, False: 4.28k]
  ------------------
 2220|  62.0k|                           clean_storage.push_back(c);
 2221|  62.0k|                        }
 2222|  66.2k|                     }
 2223|  3.39k|                     clean_view = clean_storage;
 2224|  3.39k|                  }
 2225|  28.9k|                  else {
 2226|  28.9k|                     clean_view = raw_digits;
 2227|  28.9k|                  }
 2228|       |
 2229|  32.3k|                  uint64_t parsed_int{};
 2230|  32.3k|                  auto [ptr, ec] =
 2231|  32.3k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  32.3k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 15.1k, False: 17.1k]
  |  Branch (2232:44): [True: 1.35k, False: 15.7k]
  ------------------
 2233|  16.5k|                     ctx.error = error_code::parse_number_failure;
 2234|  16.5k|                     finalize();
 2235|  16.5k|                     return;
 2236|  16.5k|                  }
 2237|       |
 2238|  15.7k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  15.7k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 4.54k, False: 11.2k]
  ------------------
 2240|  15.7k|                  finalize();
 2241|  15.7k|                  return;
 2242|  32.3k|               }
 2243|  37.2k|            }
 2244|   213k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|   181k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|   213k|         std::string clean_storage;
 2250|   213k|         std::string_view clean_view;
 2251|       |
 2252|   213k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 4.55k, False: 208k]
  ------------------
 2253|  4.55k|            clean_storage.reserve(num_str.size());
 2254|  2.81M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 2.81M, False: 4.55k]
  ------------------
 2255|  2.81M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 2.81M, False: 5.30k]
  ------------------
 2256|  2.81M|                  clean_storage.push_back(c);
 2257|  2.81M|               }
 2258|  2.81M|            }
 2259|  4.55k|            clean_view = clean_storage;
 2260|  4.55k|         }
 2261|   208k|         else {
 2262|   208k|            clean_view = num_str;
 2263|   208k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|   213k|         auto parse_view = clean_view;
 2268|   213k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 110k, False: 103k]
  |  Branch (2268:37): [True: 43.7k, False: 66.5k]
  ------------------
 2269|  43.7k|            parse_view.remove_prefix(1);
 2270|  43.7k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 12.6k, False: 31.0k]
  ------------------
 2271|  12.6k|               ctx.error = error_code::parse_number_failure;
 2272|  12.6k|               return;
 2273|  12.6k|            }
 2274|  43.7k|         }
 2275|       |
 2276|   200k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|   200k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|   200k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 151k, False: 48.8k]
  |  Branch (2279:45): [True: 23.0k, False: 25.7k]
  ------------------
 2280|  71.8k|               ctx.error = error_code::parse_number_failure;
 2281|  71.8k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|   200k|         finalize();
 2292|   200k|      }
_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|   221k|      {
  466|   221k|         skip_inline_ws(it, end);
  467|       |
  468|   221k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 692, False: 221k]
  ------------------
  469|    692|            if constexpr (!AllowEmptyInput) {
  470|    692|               ctx.error = error_code::unexpected_end;
  471|    692|            }
  472|    692|            return true;
  473|    692|         }
  474|       |
  475|   221k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   221k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 10, False: 221k]
  ------------------
  477|     10|            ctx.error = error_code::syntax_error;
  478|     10|            return true;
  479|     10|         }
  480|   221k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 90, False: 221k]
  ------------------
  481|     90|            ctx.error = error_code::syntax_error;
  482|     90|            return true;
  483|     90|         }
  484|       |
  485|   221k|         skip_inline_ws(it, end);
  486|       |
  487|   221k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 221k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   221k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 4.79k, False: 216k]
  ------------------
  495|  4.79k|            return true;
  496|  4.79k|         }
  497|       |
  498|   216k|         return false;
  499|   221k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2052|   221k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|   221k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   221k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|   221k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   221k|      {
  409|   221k|         state.has_anchor = false;
  410|   221k|         state.anchor_name.clear();
  411|   221k|         state.anchor_start = nullptr;
  412|   221k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   221k|         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|   221k|            else {
  421|   221k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.79k, False: 217k]
  ------------------
  422|   221k|            }
  423|   221k|         }
  424|       |
  425|   221k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 217k, False: 3.79k]
  |  Branch (425:27): [True: 20.1k, False: 197k]
  ------------------
  426|  20.1k|            ++it;
  427|  20.1k|            auto name = parse_anchor_name(it, end);
  428|  20.1k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 458, False: 19.7k]
  ------------------
  429|    458|               ctx.error = error_code::syntax_error;
  430|    458|               return true;
  431|    458|            }
  432|  19.7k|            skip_inline_ws(it, end);
  433|  19.7k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 544, False: 19.1k]
  ------------------
  434|    544|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    544|                  ctx.error = error_code::unexpected_end;
  436|    544|               }
  437|    544|               return true;
  438|    544|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  19.1k|            state.has_anchor = true;
  446|  19.1k|            state.anchor_name = std::string(name);
  447|  19.1k|            state.anchor_start = &*it;
  448|  19.1k|         }
  449|       |
  450|   220k|         return false;
  451|   221k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   221k|      {
  301|   221k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 221k]
  |  Branch (301:27): [True: 217k, False: 3.79k]
  ------------------
  302|       |
  303|  3.79k|         ++it; // skip '*'
  304|  3.79k|         auto name = parse_anchor_name(it, end);
  305|  3.79k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 1.30k, False: 2.48k]
  ------------------
  306|  1.30k|            ctx.error = error_code::syntax_error;
  307|  1.30k|            return true;
  308|  1.30k|         }
  309|       |
  310|  2.48k|         auto anchor_it = ctx.anchors.find(name);
  311|  2.48k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 1.51k, False: 972]
  ------------------
  312|  1.51k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  1.51k|            return true;
  314|  1.51k|         }
  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|    972|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|    972|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 32, False: 940]
  ------------------
  322|     32|            return true;
  323|     32|         }
  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|    940|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 278, False: 662]
  ------------------
  329|    278|            ctx.error = error_code::syntax_error; // cyclic alias
  330|    278|            return true;
  331|    278|         }
  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|    662|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    662|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 12, False: 650]
  ------------------
  339|     12|            return true;
  340|       |
  341|    650|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 650]
  ------------------
  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|    650|         auto replay_it = span.begin;
  348|    650|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    650|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    650|         ctx.indent_stack.clear();
  353|    650|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 246, False: 404]
  ------------------
  354|    246|            ctx.push_indent(span.base_indent - 1);
  355|    246|         }
  356|       |
  357|    650|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    650|         using V = std::remove_cvref_t<T>;
  360|    650|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    650|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    650|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    650|         return true;
  367|    650|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|   200k|         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_:
 5205|  15.5k|      {
 5206|  15.5k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  15.5k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  15.5k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  15.5k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  15.5k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 15.5k, False: 0]
  ------------------
 5216|  15.5k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  15.5k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2012|  15.5k|      {
 2013|  15.5k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 15.5k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  15.5k|         yaml::node_preamble_state preamble{};
 2017|  15.5k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 236, False: 15.3k]
  ------------------
 2018|  15.5k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|    236|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  15.3k|         std::string str;
 2023|  15.3k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  15.3k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 1.99k, False: 13.3k]
  |  Branch (2025:31): [True: 2.64k, False: 10.7k]
  |  Branch (2025:48): [True: 218, False: 10.4k]
  |  Branch (2025:65): [True: 738, False: 9.75k]
  |  Branch (2025:81): [True: 210, False: 9.54k]
  |  Branch (2025:97): [True: 62, False: 9.48k]
  ------------------
 2026|  9.48k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 202, False: 9.28k]
  |  Branch (2026:29): [True: 138, False: 9.14k]
  |  Branch (2026:44): [True: 138, False: 9.00k]
  ------------------
 2027|  6.33k|            value = true;
 2028|  6.33k|         }
 2029|  9.00k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 4.81k, False: 4.19k]
  |  Branch (2029:37): [True: 276, False: 3.92k]
  |  Branch (2029:55): [True: 454, False: 3.46k]
  |  Branch (2029:73): [True: 294, False: 3.17k]
  |  Branch (2029:88): [True: 66, False: 3.10k]
  |  Branch (2029:103): [True: 62, False: 3.04k]
  ------------------
 2030|  8.76k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 116, False: 2.93k]
  |  Branch (2030:35): [True: 86, False: 2.84k]
  |  Branch (2030:51): [True: 2.60k, False: 242]
  ------------------
 2031|  8.76k|            value = false;
 2032|  8.76k|         }
 2033|    242|         else {
 2034|    242|            ctx.error = error_code::expected_true_or_false;
 2035|    242|         }
 2036|       |
 2037|  15.3k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  15.3k|      }
_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|  15.5k|      {
  466|  15.5k|         skip_inline_ws(it, end);
  467|       |
  468|  15.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 14, False: 15.5k]
  ------------------
  469|     14|            if constexpr (!AllowEmptyInput) {
  470|     14|               ctx.error = error_code::unexpected_end;
  471|     14|            }
  472|     14|            return true;
  473|     14|         }
  474|       |
  475|  15.5k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  15.5k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 6, False: 15.5k]
  ------------------
  477|      6|            ctx.error = error_code::syntax_error;
  478|      6|            return true;
  479|      6|         }
  480|  15.5k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 6, False: 15.5k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  484|       |
  485|  15.5k|         skip_inline_ws(it, end);
  486|       |
  487|  15.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 15.5k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|  15.5k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 204, False: 15.3k]
  ------------------
  495|    204|            return true;
  496|    204|         }
  497|       |
  498|  15.3k|         return false;
  499|  15.5k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2018|  15.5k|                                             [](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|  15.5k|      {
  409|  15.5k|         state.has_anchor = false;
  410|  15.5k|         state.anchor_name.clear();
  411|  15.5k|         state.anchor_start = nullptr;
  412|  15.5k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  15.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|  15.5k|            else {
  421|  15.5k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 180, False: 15.3k]
  ------------------
  422|  15.5k|            }
  423|  15.5k|         }
  424|       |
  425|  15.5k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 15.3k, False: 180]
  |  Branch (425:27): [True: 1.44k, False: 13.9k]
  ------------------
  426|  1.44k|            ++it;
  427|  1.44k|            auto name = parse_anchor_name(it, end);
  428|  1.44k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 8, False: 1.43k]
  ------------------
  429|      8|               ctx.error = error_code::syntax_error;
  430|      8|               return true;
  431|      8|            }
  432|  1.43k|            skip_inline_ws(it, end);
  433|  1.43k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 16, False: 1.41k]
  ------------------
  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|  1.41k|            state.has_anchor = true;
  446|  1.41k|            state.anchor_name = std::string(name);
  447|  1.41k|            state.anchor_start = &*it;
  448|  1.41k|         }
  449|       |
  450|  15.5k|         return false;
  451|  15.5k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  15.5k|      {
  301|  15.5k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 15.5k]
  |  Branch (301:27): [True: 15.3k, False: 180]
  ------------------
  302|       |
  303|    180|         ++it; // skip '*'
  304|    180|         auto name = parse_anchor_name(it, end);
  305|    180|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 20, False: 160]
  ------------------
  306|     20|            ctx.error = error_code::syntax_error;
  307|     20|            return true;
  308|     20|         }
  309|       |
  310|    160|         auto anchor_it = ctx.anchors.find(name);
  311|    160|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 50, False: 110]
  ------------------
  312|     50|            ctx.error = error_code::syntax_error; // undefined alias
  313|     50|            return true;
  314|     50|         }
  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|    110|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|    110|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 26, False: 84]
  ------------------
  322|     26|            return true;
  323|     26|         }
  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|     84|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 18, False: 66]
  ------------------
  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|     66|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|     66|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 66]
  ------------------
  339|      0|            return true;
  340|       |
  341|     66|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 66]
  ------------------
  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|     66|         auto replay_it = span.begin;
  348|     66|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|     66|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|     66|         ctx.indent_stack.clear();
  353|     66|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 10, False: 56]
  ------------------
  354|     10|            ctx.push_indent(span.base_indent - 1);
  355|     10|         }
  356|       |
  357|     66|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|     66|         using V = std::remove_cvref_t<T>;
  360|     66|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|     66|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|     66|         ctx.indent_stack = std::move(saved_indent_stack);
  366|     66|         return true;
  367|     66|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2398|  10.8k|      {
 2399|  10.8k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 10.8k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  10.8k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  10.8k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 6, False: 10.7k]
  ------------------
 2405|      6|            ctx.error = error_code::unexpected_end;
 2406|      6|            return;
 2407|      6|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  10.7k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 370, False: 10.4k]
  ------------------
 2411|    370|            ++it;
 2412|    370|            return;
 2413|    370|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  10.4k|         auto start = it;
 2417|  47.7k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 47.1k, False: 578]
  |  Branch (2417:30): [True: 37.2k, False: 9.84k]
  ------------------
 2418|  37.2k|            ++it;
 2419|  37.2k|         }
 2420|       |
 2421|  10.4k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  10.4k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 66, False: 10.3k]
  ------------------
 2423|     66|            ctx.error = error_code::syntax_error;
 2424|     66|         }
 2425|  10.4k|      }
_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_:
 5205|   423k|      {
 5206|   423k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   423k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   423k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   423k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   423k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 423k, False: 0]
  ------------------
 5216|   423k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   423k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4098|   426k|      {
 4099|   426k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 426k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|   426k|         auto peek = it;
 4104|   426k|         yaml::node_preamble_state preamble{};
 4105|   426k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 2.56k, False: 423k]
  ------------------
 4106|   426k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  2.56k|            it = peek;
 4108|  2.56k|            return;
 4109|  2.56k|         }
 4110|       |
 4111|   423k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 34.9k, False: 388k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|  34.9k|            it = peek;
 4114|  34.9k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|  34.9k|         }
 4116|   388k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 388k, False: 86]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|   388k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 1.84k, False: 386k]
  |  Branch (4119:57): [True: 2.40k, False: 384k]
  ------------------
 4120|  4.25k|               it = peek;
 4121|  4.25k|            }
 4122|   388k|            int32_t seq_indent = ctx.current_indent();
 4123|   388k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 388k, False: 198]
  |  Branch (4123:31): [True: 105k, False: 283k]
  ------------------
 4124|   105k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 14.5k, False: 90.4k]
  |  Branch (4124:62): [True: 13.0k, False: 1.58k]
  ------------------
 4125|   105k|                                                          : (ctx.current_indent() + 1);
 4126|   105k|            }
 4127|   388k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|   388k|         }
 4129|     86|         else {
 4130|     86|            ctx.error = error_code::syntax_error;
 4131|     86|         }
 4132|       |
 4133|   423k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|   423k|      }
_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|   426k|      {
  466|   426k|         skip_inline_ws(it, end);
  467|       |
  468|   426k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 18, False: 426k]
  ------------------
  469|     18|            if constexpr (!AllowEmptyInput) {
  470|     18|               ctx.error = error_code::unexpected_end;
  471|     18|            }
  472|     18|            return true;
  473|     18|         }
  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: 6, False: 426k]
  ------------------
  481|      6|            ctx.error = error_code::syntax_error;
  482|      6|            return true;
  483|      6|         }
  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: 2.52k, False: 423k]
  ------------------
  495|  2.52k|            return true;
  496|  2.52k|         }
  497|       |
  498|   423k|         return false;
  499|   426k|      }
_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_:
 4106|   426k|                                             [](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|   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: 2.49k, False: 423k]
  ------------------
  422|   426k|            }
  423|   426k|         }
  424|       |
  425|   426k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 423k, False: 2.49k]
  |  Branch (425:27): [True: 3.46k, False: 420k]
  ------------------
  426|  3.46k|            ++it;
  427|  3.46k|            auto name = parse_anchor_name(it, end);
  428|  3.46k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 12, False: 3.45k]
  ------------------
  429|     12|               ctx.error = error_code::syntax_error;
  430|     12|               return true;
  431|     12|            }
  432|  3.45k|            skip_inline_ws(it, end);
  433|  3.45k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 20, False: 3.43k]
  ------------------
  434|     20|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     20|                  ctx.error = error_code::unexpected_end;
  436|     20|               }
  437|     20|               return true;
  438|     20|            }
  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|   426k|         return false;
  451|   426k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_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: 423k, False: 2.49k]
  ------------------
  302|       |
  303|  2.49k|         ++it; // skip '*'
  304|  2.49k|         auto name = parse_anchor_name(it, end);
  305|  2.49k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 18, False: 2.47k]
  ------------------
  306|     18|            ctx.error = error_code::syntax_error;
  307|     18|            return true;
  308|     18|         }
  309|       |
  310|  2.47k|         auto anchor_it = ctx.anchors.find(name);
  311|  2.47k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 40, False: 2.43k]
  ------------------
  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|  2.43k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.43k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 70, False: 2.36k]
  ------------------
  322|     70|            return true;
  323|     70|         }
  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.36k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 22, False: 2.34k]
  ------------------
  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|  2.34k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.34k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 12, False: 2.33k]
  ------------------
  339|     12|            return true;
  340|       |
  341|  2.33k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.33k]
  ------------------
  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.33k|         auto replay_it = span.begin;
  348|  2.33k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.33k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.33k|         ctx.indent_stack.clear();
  353|  2.33k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 694, False: 1.63k]
  ------------------
  354|    694|            ctx.push_indent(span.base_indent - 1);
  355|    694|         }
  356|       |
  357|  2.33k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.33k|         using V = std::remove_cvref_t<T>;
  360|  2.33k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.33k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.33k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.33k|         return true;
  367|  2.33k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|  34.9k|      {
 2597|  34.9k|         using V = std::remove_cvref_t<T>;
 2598|  34.9k|         using value_type = typename V::value_type;
 2599|       |
 2600|  34.9k|         struct sequence_container_adapter
 2601|  34.9k|         {
 2602|  34.9k|            size_t index = 0;
 2603|       |
 2604|  34.9k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|  34.9k|            {
 2606|  34.9k|               if constexpr (!resizable<V>) {
 2607|  34.9k|                  return index >= container.size();
 2608|  34.9k|               }
 2609|  34.9k|               else {
 2610|  34.9k|                  (void)container;
 2611|  34.9k|                  return false;
 2612|  34.9k|               }
 2613|  34.9k|            }
 2614|       |
 2615|  34.9k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|  34.9k|            inline void append(V& container, value_type&& element) noexcept
 2618|  34.9k|            {
 2619|  34.9k|               if constexpr (emplace_backable<V>) {
 2620|  34.9k|                  container.emplace_back(std::move(element));
 2621|  34.9k|               }
 2622|  34.9k|               else if constexpr (emplaceable<V>) {
 2623|  34.9k|                  container.emplace(std::move(element));
 2624|  34.9k|               }
 2625|  34.9k|            }
 2626|  34.9k|         };
 2627|       |
 2628|  34.9k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 34.9k]
  |  Branch (2628:27): [True: 0, False: 34.9k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|  34.9k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|  34.9k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|  34.9k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|  34.9k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 6, False: 34.9k]
  ------------------
 2641|      6|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|  34.9k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 34.1k, False: 720]
  |  Branch (2644:27): [True: 3.20k, False: 30.9k]
  ------------------
 2645|  3.20k|            ++it;
 2646|  3.20k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  3.20k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 6, False: 3.19k]
  ------------------
 2648|      6|               return;
 2649|  3.19k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|  3.19k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2650:20): [True: 636, False: 2.56k]
  ------------------
 2651|    636|                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|    636|               }
 2653|  3.19k|            }
 2654|  3.19k|            return;
 2655|  3.20k|         }
 2656|       |
 2657|  31.7k|         bool just_saw_comma = false;
 2658|  31.7k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  31.7k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|  60.2k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 55.2k, False: 4.98k]
  ------------------
 2663|  55.2k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|  55.2k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 55.2k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|  55.2k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 55.2k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|  55.2k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 4.06k, False: 51.1k]
  ------------------
 2673|  4.06k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 4.06k, False: 0]
  ------------------
 2674|  4.06k|                     ++it;
 2675|  4.06k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  4.06k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 10, False: 4.05k]
  ------------------
 2677|     10|                        return;
 2678|  4.05k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|  4.05k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2679:29): [True: 516, False: 3.54k]
  ------------------
 2680|    516|                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|    516|                        }
 2682|  4.05k|                     }
 2683|  4.05k|                     return;
 2684|  4.06k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  4.06k|               }
 2688|       |
 2689|  51.1k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 6, False: 51.1k]
  |  Branch (2689:34): [True: 6, False: 51.1k]
  ------------------
 2690|     12|                  ctx.error = error_code::syntax_error;
 2691|     12|                  return;
 2692|     12|               }
 2693|  51.1k|               just_saw_comma = false;
 2694|       |
 2695|  51.1k|               value_type element{};
 2696|  51.1k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|  51.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 12.3k, False: 38.8k]
  ------------------
 2699|  12.3k|                  return;
 2700|       |
 2701|  38.8k|               bool saw_line_break_before_separator = false;
 2702|  38.8k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|  38.8k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 6, False: 38.8k]
  ------------------
 2704|      6|                  return;
 2705|       |
 2706|  38.8k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 37.3k, False: 1.46k]
  |  Branch (2706:33): [True: 12.3k, False: 25.0k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  12.3k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 6, False: 12.3k]
  ------------------
 2709|      6|                     ctx.error = error_code::syntax_error;
 2710|      6|                     return;
 2711|      6|                  }
 2712|  12.3k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  12.3k|                     glz::generic key_node = std::move(element);
 2714|  12.3k|                     ++it;
 2715|  12.3k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  12.3k|                     glz::generic mapped{};
 2718|  12.3k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  12.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 972, False: 11.3k]
  ------------------
 2720|    972|                        return;
 2721|       |
 2722|  11.3k|                     std::string key;
 2723|  11.3k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 0, False: 11.3k]
  ------------------
 2724|      0|                        return;
 2725|       |
 2726|  11.3k|                     glz::generic pair{};
 2727|  11.3k|                     pair[key] = std::move(mapped);
 2728|  11.3k|                     element = std::move(pair);
 2729|       |
 2730|  11.3k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  11.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 2, False: 11.3k]
  ------------------
 2732|      2|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  12.3k|               }
 2739|       |
 2740|  38.8k|               adapter.append(value, std::move(element));
 2741|       |
 2742|  38.8k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 1.47k, False: 37.3k]
  ------------------
 2743|  1.47k|                  ctx.error = error_code::unexpected_end;
 2744|  1.47k|                  return;
 2745|  1.47k|               }
 2746|       |
 2747|  37.3k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 7.53k, False: 29.8k]
  ------------------
 2748|  7.53k|                  ++it;
 2749|  7.53k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  7.53k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 12, False: 7.52k]
  ------------------
 2751|     12|                     return;
 2752|  7.52k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|  7.52k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2753:26): [True: 458, False: 7.06k]
  ------------------
 2754|    458|                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|    458|                     }
 2756|  7.52k|                  }
 2757|  7.52k|                  return;
 2758|  7.53k|               }
 2759|  29.8k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 28.5k, False: 1.30k]
  ------------------
 2760|  28.5k|                  ++it;
 2761|  28.5k|                  just_saw_comma = true;
 2762|  28.5k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  28.5k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 6, False: 28.5k]
  ------------------
 2764|      6|                     return;
 2765|  28.5k|               }
 2766|  1.30k|               else {
 2767|  1.30k|                  ctx.error = error_code::syntax_error;
 2768|  1.30k|                  return;
 2769|  1.30k|               }
 2770|  37.3k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  31.7k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|   423k|      {
 2581|   423k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|   423k|            if constexpr (!check_append_arrays(Opts)) {
 2584|   423k|               value.clear();
 2585|   423k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|   423k|      }
_ZN3glz4yaml35validate_root_flow_tail_after_closeINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_:
  955|  3.12k|      {
  956|  3.12k|         auto is_document_start = [&](auto pos) {
  957|  3.12k|            if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  958|  3.12k|               auto after = pos + 3;
  959|  3.12k|               return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  960|  3.12k|                      *after == '#';
  961|  3.12k|            }
  962|  3.12k|            return false;
  963|  3.12k|         };
  964|       |
  965|  3.12k|         bool at_line_start = false;
  966|  3.12k|         auto tail = it;
  967|  6.74k|         while (tail != end) {
  ------------------
  |  Branch (967:17): [True: 4.82k, False: 1.91k]
  ------------------
  968|  4.82k|            auto line = tail;
  969|  4.82k|            skip_inline_ws(line, end);
  970|       |
  971|  4.82k|            if (line == end) {
  ------------------
  |  Branch (971:17): [True: 84, False: 4.74k]
  ------------------
  972|     84|               return;
  973|     84|            }
  974|       |
  975|  4.74k|            if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (975:17): [True: 730, False: 4.01k]
  |  Branch (975:34): [True: 1.56k, False: 2.44k]
  ------------------
  976|  2.29k|               tail = line;
  977|  2.29k|               skip_newline(tail, end);
  978|  2.29k|               at_line_start = true;
  979|  2.29k|               continue;
  980|  2.29k|            }
  981|       |
  982|  2.44k|            if (*line == '#') {
  ------------------
  |  Branch (982:17): [True: 1.42k, False: 1.02k]
  ------------------
  983|  1.42k|               if (!at_line_start && line == it) {
  ------------------
  |  Branch (983:20): [True: 214, False: 1.20k]
  |  Branch (983:38): [True: 44, False: 170]
  ------------------
  984|     44|                  ctx.error = error_code::syntax_error;
  985|     44|                  return;
  986|     44|               }
  987|  1.37k|               tail = line;
  988|  1.37k|               skip_comment(tail, end);
  989|  1.37k|               if (tail != end && (*tail == '\n' || *tail == '\r')) {
  ------------------
  |  Branch (989:20): [True: 1.32k, False: 48]
  |  Branch (989:36): [True: 532, False: 796]
  |  Branch (989:53): [True: 796, False: 0]
  ------------------
  990|  1.32k|                  skip_newline(tail, end);
  991|  1.32k|                  at_line_start = true;
  992|  1.32k|                  continue;
  993|  1.32k|               }
  994|     48|               return;
  995|  1.37k|            }
  996|       |
  997|  1.02k|            if (at_line_start && (at_document_end(line, end) || is_document_start(line))) {
  ------------------
  |  Branch (997:17): [True: 640, False: 388]
  |  Branch (997:35): [True: 316, False: 324]
  |  Branch (997:65): [True: 38, False: 286]
  ------------------
  998|    354|               return;
  999|    354|            }
 1000|       |
 1001|    674|            ctx.error = error_code::syntax_error;
 1002|    674|            return;
 1003|  1.02k|         }
 1004|  3.12k|      }
_ZZN3glz4yaml35validate_root_flow_tail_after_closeINS0_12yaml_contextEPKcS4_EEvRT_RT0_T1_ENKUlS5_E_clIS4_EEDaS5_:
  956|    324|         auto is_document_start = [&](auto pos) {
  957|    324|            if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (957:17): [True: 232, False: 92]
  |  Branch (957:35): [True: 66, False: 166]
  |  Branch (957:52): [True: 58, False: 8]
  |  Branch (957:69): [True: 44, False: 14]
  ------------------
  958|     44|               auto after = pos + 3;
  959|     44|               return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (959:23): [True: 2, False: 42]
  |  Branch (959:39): [True: 14, False: 28]
  |  Branch (959:56): [True: 6, False: 22]
  |  Branch (959:74): [True: 6, False: 16]
  |  Branch (959:92): [True: 6, False: 10]
  ------------------
  960|     10|                      *after == '#';
  ------------------
  |  Branch (960:23): [True: 4, False: 6]
  ------------------
  961|     44|            }
  962|    280|            return false;
  963|    324|         };
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|  37.8k|            {
 2619|  37.8k|               if constexpr (emplace_backable<V>) {
 2620|  37.8k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|  37.8k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|   388k|      {
 3082|   388k|         using V = std::remove_cvref_t<T>;
 3083|   388k|         using value_type = typename V::value_type;
 3084|       |
 3085|   388k|         struct sequence_container_adapter
 3086|   388k|         {
 3087|   388k|            size_t index = 0;
 3088|       |
 3089|   388k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|   388k|            {
 3091|   388k|               if constexpr (!resizable<V>) {
 3092|   388k|                  return index >= container.size();
 3093|   388k|               }
 3094|   388k|               else {
 3095|   388k|                  (void)container;
 3096|   388k|                  return false;
 3097|   388k|               }
 3098|   388k|            }
 3099|       |
 3100|   388k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|   388k|            inline void append(V& container, value_type&& element) noexcept
 3103|   388k|            {
 3104|   388k|               if constexpr (emplace_backable<V>) {
 3105|   388k|                  container.emplace_back(std::move(element));
 3106|   388k|               }
 3107|   388k|               else if constexpr (emplaceable<V>) {
 3108|   388k|                  container.emplace(std::move(element));
 3109|   388k|               }
 3110|   388k|            }
 3111|   388k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|   388k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|   388k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|   388k|         bool first_item = true;
 3122|   388k|         bool has_pending_item_anchor = false;
 3123|   388k|         std::string pending_item_anchor_name{};
 3124|   388k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|   809k|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 649k, False: 160k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|   649k|            int32_t line_indent = 0;
 3137|   649k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|   649k|            auto line_start = it;
 3139|       |
 3140|   918k|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 897k, False: 21.0k]
  ------------------
 3141|   897k|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 35.1k, False: 862k]
  ------------------
 3142|  35.1k|                  skip_comment(it, end);
 3143|  35.1k|                  skip_newline(it, end);
 3144|  35.1k|                  line_start = it;
 3145|  35.1k|                  line_indent = 0;
 3146|  35.1k|               }
 3147|   862k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 119k, False: 742k]
  |  Branch (3147:40): [True: 70.5k, False: 672k]
  ------------------
 3148|   190k|                  skip_newline(it, end);
 3149|   190k|                  line_start = it;
 3150|   190k|                  line_indent = 0;
 3151|   190k|               }
 3152|   672k|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 146k, False: 525k]
  ------------------
 3153|   146k|                  line_start = it;
 3154|   146k|                  line_indent = 0;
 3155|   327k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 323k, False: 4.13k]
  |  Branch (3155:39): [True: 180k, False: 142k]
  ------------------
 3156|   180k|                     ++line_indent;
 3157|   180k|                     ++it;
 3158|   180k|                  }
 3159|       |
 3160|   146k|                  bool saw_tab = false;
 3161|   162k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 156k, False: 5.72k]
  |  Branch (3161:40): [True: 6.16k, False: 150k]
  |  Branch (3161:54): [True: 9.10k, False: 141k]
  ------------------
 3162|  15.2k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 7.32k, False: 7.93k]
  |  Branch (3162:43): [True: 7.93k, False: 0]
  ------------------
 3163|  15.2k|                     ++it;
 3164|  15.2k|                  }
 3165|       |
 3166|   146k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 5.72k, False: 141k]
  |  Branch (3166:36): [True: 4.48k, False: 136k]
  |  Branch (3166:51): [True: 2.03k, False: 134k]
  |  Branch (3166:66): [True: 18.0k, False: 116k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|  30.2k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 24.5k, False: 5.72k]
  |  Branch (3168:39): [True: 18.0k, False: 6.51k]
  ------------------
 3169|  18.0k|                        skip_comment(it, end);
 3170|  18.0k|                     }
 3171|  30.2k|                     line_indent = 0;
 3172|  30.2k|                     continue;
 3173|  30.2k|                  }
 3174|       |
 3175|   116k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 22, False: 116k]
  ------------------
 3176|     22|                     ctx.error = error_code::syntax_error;
 3177|     22|                     return;
 3178|     22|                  }
 3179|   116k|                  break; // Found content
 3180|   116k|               }
 3181|   525k|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 13.8k, False: 511k]
  ------------------
 3182|  13.8k|                  line_start = it;
 3183|  33.4k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 30.2k, False: 3.28k]
  |  Branch (3183:40): [True: 5.20k, False: 25.0k]
  |  Branch (3183:54): [True: 14.4k, False: 10.5k]
  ------------------
 3184|  13.8k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 3.28k, False: 10.5k]
  |  Branch (3184:36): [True: 1.21k, False: 9.35k]
  |  Branch (3184:51): [True: 7.37k, False: 1.98k]
  |  Branch (3184:66): [True: 1.95k, False: 30]
  ------------------
 3185|  13.8k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 10.5k, False: 3.28k]
  |  Branch (3185:39): [True: 1.95k, False: 8.59k]
  ------------------
 3186|  1.95k|                        skip_comment(it, end);
 3187|  1.95k|                     }
 3188|  13.8k|                     line_indent = 0;
 3189|  13.8k|                     continue;
 3190|  13.8k|                  }
 3191|     30|                  ctx.error = error_code::syntax_error;
 3192|     30|                  return;
 3193|  13.8k|               }
 3194|   511k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|   511k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 388k, False: 122k]
  |  Branch (3198:37): [True: 388k, False: 198]
  ------------------
 3199|   388k|                     line_indent = sequence_indent;
 3200|   388k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|   388k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 388k, False: 0]
  |  Branch (3201:49): [True: 388k, False: 0]
  ------------------
 3202|   388k|                           auto probe = it;
 3203|   388k|                           int32_t leading_ws = 0;
 3204|   388k|                           bool saw_tab = false;
 3205|   800k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 800k, False: 0]
  |  Branch (3205:64): [True: 397k, False: 402k]
  |  Branch (3205:87): [True: 14.0k, False: 388k]
  ------------------
 3206|   411k|                              --probe;
 3207|   411k|                              ++leading_ws;
 3208|   411k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 11.9k, False: 399k]
  |  Branch (3208:52): [True: 2.27k, False: 397k]
  ------------------
 3209|   411k|                           }
 3210|   388k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 0, False: 388k]
  |  Branch (3210:61): [True: 11.4k, False: 376k]
  |  Branch (3210:85): [True: 23.5k, False: 353k]
  ------------------
 3211|  34.9k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 10, False: 34.9k]
  ------------------
 3212|     10|                                 ctx.error = error_code::syntax_error;
 3213|     10|                                 return;
 3214|     10|                              }
 3215|  34.9k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|  34.9k|                           }
 3217|   388k|                        }
 3218|   388k|                     }
 3219|   388k|                  }
 3220|   388k|                  break;
 3221|   511k|               }
 3222|   897k|            }
 3223|       |
 3224|   649k|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 21.0k, False: 627k]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|   627k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 8.72k, False: 619k]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|   619k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 36.6k, False: 582k]
  ------------------
 3231|  36.6k|               it = line_start;
 3232|  36.6k|               return;
 3233|  36.6k|            }
 3234|       |
 3235|   582k|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 9.20k, False: 573k]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  9.20k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 46, False: 9.15k]
  ------------------
 3240|     46|                  ctx.error = error_code::syntax_error;
 3241|     46|                  return;
 3242|     46|               }
 3243|       |
 3244|  9.15k|               ++it;
 3245|  9.15k|               auto pending_name = parse_anchor_name(it, end);
 3246|  9.15k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 6, False: 9.14k]
  ------------------
 3247|      6|                  ctx.error = error_code::syntax_error;
 3248|      6|                  return;
 3249|      6|               }
 3250|  9.14k|               skip_inline_ws(it, end);
 3251|  9.14k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 9.13k, False: 14]
  |  Branch (3251:33): [True: 2.63k, False: 6.49k]
  ------------------
 3252|  2.63k|                  skip_comment(it, end);
 3253|  2.63k|               }
 3254|       |
 3255|  9.14k|               has_pending_item_anchor = true;
 3256|  9.14k|               pending_item_anchor_name = std::string(pending_name);
 3257|  9.14k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  9.14k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 14, False: 9.13k]
  |  Branch (3259:34): [True: 4.15k, False: 4.98k]
  |  Branch (3259:49): [True: 44, False: 4.10k]
  ------------------
 3260|     58|                  ctx.error = error_code::syntax_error;
 3261|     58|                  return;
 3262|     58|               }
 3263|       |
 3264|  9.09k|               skip_newline(it, end);
 3265|  9.09k|               continue;
 3266|  9.14k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|   573k|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 154k, False: 419k]
  ------------------
 3270|   154k|               it = line_start;
 3271|   154k|               return;
 3272|   154k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|   419k|            dash_col = line_indent;
 3278|   419k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   419k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 419k, False: 10]
  ------------------
 3280|   419k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|   419k|               }
 3282|   419k|            }
 3283|       |
 3284|   419k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|   419k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 408k, False: 10.7k]
  |  Branch (3287:30): [True: 4.15k, False: 404k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  4.15k|               it = line_start;
 3290|  4.15k|               return;
 3291|  4.15k|            }
 3292|       |
 3293|   414k|            bool saw_tab_after_dash = false;
 3294|  1.10M|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 1.09M, False: 12.1k]
  |  Branch (3294:34): [True: 512k, False: 579k]
  |  Branch (3294:48): [True: 176k, False: 402k]
  ------------------
 3295|   688k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 140k, False: 548k]
  |  Branch (3295:59): [True: 104k, False: 444k]
  ------------------
 3296|   688k|               ++it;
 3297|   688k|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|   414k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 104k, False: 310k]
  |  Branch (3299:39): [True: 103k, False: 832]
  |  Branch (3299:52): [True: 5.68k, False: 98.0k]
  ------------------
 3300|  5.68k|               const auto after_dash = it + 1;
 3301|  5.68k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 6, False: 5.67k]
  |  Branch (3301:41): [True: 6, False: 5.66k]
  ------------------
 3302|     12|                  ctx.error = error_code::syntax_error;
 3303|     12|                  return;
 3304|     12|               }
 3305|  5.68k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|   414k|            auto parse_element = [&](auto& element) {
 3309|   414k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|   414k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   414k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|   414k|                     return;
 3319|   414k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   414k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   414k|                  ctx.sequence_item_value_context = true;
 3322|   414k|                  ctx.sequence_dash_indent = dash_col;
 3323|   414k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   414k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   414k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   414k|                  ctx.pop_indent();
 3327|   414k|               }
 3328|   414k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   414k|                  skip_ws_and_comment(it, end);
 3331|   414k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   414k|                  auto nested_start = it;
 3335|   414k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   414k|                  if (bool(ctx.error)) [[unlikely]]
 3337|   414k|                     return;
 3338|   414k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   414k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|   414k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|   414k|                     const int32_t element_indent =
 3350|   414k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|   414k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|   414k|                        return;
 3353|   414k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|   414k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|   414k|                     ctx.sequence_item_value_context = true;
 3356|   414k|                     ctx.sequence_dash_indent = dash_col;
 3357|   414k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|   414k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|   414k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|   414k|                     ctx.pop_indent();
 3361|   414k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   414k|               }
 3364|       |
 3365|   414k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|   414k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|   414k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|   414k|                                                                      pending_item_anchor_indent};
 3369|   414k|                  has_pending_item_anchor = false;
 3370|   414k|               }
 3371|   414k|            };
 3372|       |
 3373|   414k|            if constexpr (emplace_backable<V>) {
 3374|   414k|               auto& element = value.emplace_back();
 3375|   414k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|   414k|            first_item = false;
 3394|       |
 3395|   414k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 3.09k, False: 411k]
  ------------------
 3396|  3.09k|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|   414k|         }
 3401|   388k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj10ELb1ELb0ELb0ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|   414k|            auto parse_element = [&](auto& element) {
 3309|   414k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 402k, False: 12.1k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|   414k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 402k, False: 12.1k]
  |  Branch (3312:33): [True: 365k, False: 36.9k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   365k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 365k]
  ------------------
 3318|      0|                     return;
 3319|   365k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   365k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   365k|                  ctx.sequence_item_value_context = true;
 3322|   365k|                  ctx.sequence_dash_indent = dash_col;
 3323|   365k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   365k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   365k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   365k|                  ctx.pop_indent();
 3327|   365k|               }
 3328|  49.1k|               else {
 3329|       |                  // Value on next line - nested block
 3330|  49.1k|                  skip_ws_and_comment(it, end);
 3331|  49.1k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  49.1k|                  auto nested_start = it;
 3335|  49.1k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  49.1k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 10, False: 49.1k]
  ------------------
 3337|     10|                     return;
 3338|  49.1k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  49.1k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 13.2k, False: 35.8k]
  ------------------
 3344|  49.1k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 14.0k, False: 35.0k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  14.0k|                     const int32_t element_indent =
 3350|  14.0k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 14.0k]
  ------------------
 3351|  14.0k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 14.0k]
  ------------------
 3352|      0|                        return;
 3353|  14.0k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  14.0k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  14.0k|                     ctx.sequence_item_value_context = true;
 3356|  14.0k|                     ctx.sequence_dash_indent = dash_col;
 3357|  14.0k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  14.0k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  14.0k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  14.0k|                     ctx.pop_indent();
 3361|  14.0k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  49.1k|               }
 3364|       |
 3365|   414k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 4.79k, False: 410k]
  |  Branch (3365:47): [True: 4.72k, False: 72]
  ------------------
 3366|  4.72k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 3.89k, False: 828]
  ------------------
 3367|  4.72k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  4.72k|                                                                      pending_item_anchor_indent};
 3369|  4.72k|                  has_pending_item_anchor = false;
 3370|  4.72k|               }
 3371|   414k|            };
_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_:
 5423|   550k|   {
 5424|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|       |            int depth = 0;
 5432|       |            while (pos != stop) {
 5433|       |               const char c = *pos;
 5434|       |               if (c == '"' || c == '\'') {
 5435|       |                  const char quote = c;
 5436|       |                  ++pos;
 5437|       |                  while (pos != stop && *pos != quote) {
 5438|       |                     if (*pos == '\\' && quote == '"') {
 5439|       |                        ++pos;
 5440|       |                        if (pos != stop) ++pos;
 5441|       |                     }
 5442|       |                     else {
 5443|       |                        ++pos;
 5444|       |                     }
 5445|       |                  }
 5446|       |                  if (pos != stop) ++pos;
 5447|       |                  continue;
 5448|       |               }
 5449|       |               if (c == '[' || c == '{') {
 5450|       |                  ++depth;
 5451|       |                  ++pos;
 5452|       |                  continue;
 5453|       |               }
 5454|       |               if (c == ']' || c == '}') {
 5455|       |                  if (depth == 0) return false;
 5456|       |                  --depth;
 5457|       |                  ++pos;
 5458|       |                  continue;
 5459|       |               }
 5460|       |               if (c == ',' && depth == 0) return false;
 5461|       |               if (c == ':' && depth == 0) {
 5462|       |                  auto next = pos + 1;
 5463|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|       |               }
 5465|       |               ++pos;
 5466|       |            }
 5467|       |            return false;
 5468|       |         };
 5469|       |
 5470|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5471|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5472|       |               return;
 5473|       |            }
 5474|       |            if (bool(ctx.error)) {
 5475|       |               return;
 5476|       |            }
 5477|       |         }
 5478|       |
 5479|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|       |         return;
 5481|       |      }
 5482|       |
 5483|   550k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 136k, False: 414k]
  ------------------
 5484|   136k|         return;
 5485|   136k|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|   414k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 38.5k, False: 375k]
  ------------------
 5488|  38.5k|         return;
 5489|  38.5k|      }
 5490|   375k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|   375k|   }
_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_:
 5848|  35.4k|            auto is_word_boundary = [&](const auto ptr) {
 5849|  35.4k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 1.48k, False: 33.9k]
  ------------------
 5850|  1.48k|                  return true;
 5851|  1.48k|               }
 5852|  33.9k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 11.2k, False: 22.7k]
  ------------------
 5853|  11.2k|                  auto next = ptr + 1;
 5854|  11.2k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 1.94k, False: 9.31k]
  |  Branch (5854:43): [True: 2.26k, False: 7.05k]
  |  Branch (5854:59): [True: 1.04k, False: 6.00k]
  |  Branch (5854:76): [True: 1.53k, False: 4.46k]
  |  Branch (5854:93): [True: 3.13k, False: 1.33k]
  ------------------
 5855|  11.2k|               }
 5856|  22.7k|               return is_plain_scalar_boundary(*ptr);
 5857|  33.9k|            };
_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:
 5774|  22.7k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  22.7k|               switch (ch) {
 5776|  9.71k|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 9.71k, False: 13.0k]
  ------------------
 5777|  10.3k|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 620, False: 22.1k]
  ------------------
 5778|  16.7k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 6.44k, False: 16.2k]
  ------------------
 5779|  18.4k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 1.69k, False: 21.0k]
  ------------------
 5780|  18.4k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 6, False: 22.7k]
  ------------------
 5781|  18.5k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 24, False: 22.7k]
  ------------------
 5782|  18.5k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 22, False: 22.7k]
  ------------------
 5783|  18.5k|                  return true;
 5784|  4.19k|               default:
  ------------------
  |  Branch (5784:16): [True: 4.19k, False: 18.5k]
  ------------------
 5785|  4.19k|                  return false;
 5786|  22.7k|               }
 5787|  22.7k|            };
_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_:
 5789|  29.9k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5791|       |                  return false;
 5792|       |               }
 5793|  29.9k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 14.7k, False: 15.1k]
  ------------------
 5794|  14.7k|                  return false;
 5795|  14.7k|               }
 5796|  15.1k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 810, False: 14.3k]
  |  Branch (5796:40): [True: 7.91k, False: 6.44k]
  |  Branch (5796:61): [True: 6.56k, False: 1.34k]
  ------------------
 5797|  7.37k|                  return false;
 5798|  7.37k|               }
 5799|       |
 5800|  7.79k|               auto look = word_end;
 5801|  7.79k|               yaml::skip_newline(look, end);
 5802|  24.7k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 23.6k, False: 1.14k]
  ------------------
 5803|  23.6k|                  int32_t line_indent = 0;
 5804|  36.2k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 35.5k, False: 642]
  |  Branch (5804:41): [True: 12.5k, False: 22.9k]
  ------------------
 5805|  12.5k|                     ++line_indent;
 5806|  12.5k|                     ++look;
 5807|  12.5k|                  }
 5808|  23.6k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 22.9k, False: 642]
  |  Branch (5808:38): [True: 642, False: 22.3k]
  ------------------
 5809|    642|                     return false;
 5810|    642|                  }
 5811|  22.9k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 642, False: 22.3k]
  |  Branch (5811:38): [True: 3.73k, False: 18.6k]
  |  Branch (5811:55): [True: 7.47k, False: 11.1k]
  ------------------
 5812|  11.8k|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 11.2k, False: 642]
  ------------------
 5813|  11.2k|                        yaml::skip_newline(look, end);
 5814|  11.2k|                        continue;
 5815|  11.2k|                     }
 5816|    642|                     return false;
 5817|  11.8k|                  }
 5818|  11.1k|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 5.95k, False: 5.17k]
  ------------------
 5819|  5.95k|                     yaml::skip_comment(look, end);
 5820|  5.95k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 5.76k, False: 190]
  |  Branch (5820:42): [True: 3.02k, False: 2.73k]
  |  Branch (5820:59): [True: 2.73k, False: 0]
  ------------------
 5821|  5.76k|                        yaml::skip_newline(look, end);
 5822|  5.76k|                        continue;
 5823|  5.76k|                     }
 5824|    190|                     return false;
 5825|  5.95k|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  5.17k|                  {
 5831|  5.17k|                     auto scan = look;
 5832|   187k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 187k, False: 798]
  |  Branch (5832:44): [True: 186k, False: 736]
  |  Branch (5832:61): [True: 185k, False: 776]
  ------------------
 5833|   185k|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 30.7k, False: 154k]
  ------------------
 5834|  30.7k|                           auto after_colon = scan + 1;
 5835|  30.7k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 194, False: 30.5k]
  |  Branch (5835:54): [True: 2.17k, False: 28.3k]
  |  Branch (5835:77): [True: 50, False: 28.3k]
  ------------------
 5836|  28.3k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 90, False: 28.2k]
  |  Branch (5836:56): [True: 352, False: 27.8k]
  ------------------
 5837|  2.86k|                              return false;
 5838|  2.86k|                           }
 5839|  30.7k|                        }
 5840|   182k|                        ++scan;
 5841|   182k|                     }
 5842|  5.17k|                  }
 5843|       |
 5844|  2.31k|                  return line_indent > ctx.current_indent();
 5845|  5.17k|               }
 5846|  1.14k|               return false;
 5847|  7.79k|            };
_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_:
 5377|   614k|   {
 5378|   614k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   614k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   614k|         const bool could_be_mapping = [&] {
 5386|   614k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   614k|               return line_could_be_flow_mapping(it, end);
 5388|   614k|            }
 5389|   614k|            else {
 5390|   614k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   614k|            }
 5392|   614k|         }();
 5393|   614k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 415k, False: 198k]
  ------------------
 5394|   415k|            return false;
 5395|   415k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   198k|         auto temp_ctx = ctx.make_speculative();
 5398|   198k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   198k|                                                                                               end);
 5400|   198k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   198k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   198k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 146k, False: 51.9k]
  ------------------
 5403|   146k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   146k|            return true;
 5405|   146k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  51.9k|         ctx.error = temp_ctx.error;
 5410|  51.9k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  51.9k|         return false;
 5412|   198k|      }
 5413|   614k|   }
_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:
 5385|   614k|         const bool could_be_mapping = [&] {
 5386|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5387|       |               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|   614k|            else {
 5390|   614k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   614k|            }
 5392|   614k|         }();
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|   159k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|   159k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   159k|                     val = glz::generic{};
 4665|   159k|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|   159k|               };
_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_:
 3633|   273k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   273k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 273k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   273k|         const int32_t parent_indent = ctx.current_indent();
 3644|   273k|         const bool discover_indent = (mapping_indent < 0);
 3645|   273k|         bool first_key = !discover_indent;
 3646|   273k|         bool discovered_first_key_mid_line = false;
 3647|   273k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|   697k|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 529k, False: 167k]
  ------------------
 3650|   529k|            auto line_start = it;
 3651|   529k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 529k]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|   590k|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 584k, False: 6.28k]
  ------------------
 3655|   584k|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 13.2k, False: 571k]
  ------------------
 3656|  13.2k|                  skip_comment(it, end);
 3657|  13.2k|                  skip_newline(it, end);
 3658|  13.2k|                  first_key = false;
 3659|  13.2k|                  line_indent = 0;
 3660|  13.2k|               }
 3661|   571k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 8.80k, False: 562k]
  |  Branch (3661:40): [True: 28.1k, False: 534k]
  ------------------
 3662|  36.9k|                  skip_newline(it, end);
 3663|  36.9k|                  first_key = false;
 3664|  36.9k|                  line_indent = 0;
 3665|  36.9k|               }
 3666|   534k|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 201k, False: 332k]
  ------------------
 3667|   201k|                  line_start = it;
 3668|   201k|                  line_indent = 0;
 3669|   540k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 539k, False: 809]
  |  Branch (3669:39): [True: 338k, False: 201k]
  ------------------
 3670|   338k|                     ++line_indent;
 3671|   338k|                     ++it;
 3672|   338k|                  }
 3673|       |
 3674|   201k|                  bool saw_tab = false;
 3675|   204k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 203k, False: 833]
  |  Branch (3675:40): [True: 1.12k, False: 202k]
  |  Branch (3675:54): [True: 1.46k, False: 201k]
  ------------------
 3676|  2.58k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 1.55k, False: 1.03k]
  |  Branch (3676:43): [True: 1.03k, False: 0]
  ------------------
 3677|  2.58k|                     ++it;
 3678|  2.58k|                  }
 3679|       |
 3680|   201k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 833, False: 201k]
  |  Branch (3680:36): [True: 2.28k, False: 198k]
  |  Branch (3680:51): [True: 1.88k, False: 196k]
  |  Branch (3680:66): [True: 4.43k, False: 192k]
  ------------------
 3681|  9.43k|                     first_key = false;
 3682|  9.43k|                     line_indent = 0;
 3683|  9.43k|                     continue; // Blank or comment line
 3684|  9.43k|                  }
 3685|       |
 3686|   192k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 43, False: 192k]
  ------------------
 3687|     43|                     ctx.error = error_code::syntax_error;
 3688|     43|                     return;
 3689|     43|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|   192k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 191k, False: 1.23k]
  |  Branch (3692:46): [True: 294, False: 190k]
  ------------------
 3693|    294|                     it = line_start;
 3694|    294|                     return;
 3695|    294|                  }
 3696|       |
 3697|   192k|                  first_key = false;
 3698|   192k|                  break; // Found content
 3699|   192k|               }
 3700|   332k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 1.29k, False: 331k]
  ------------------
 3701|  1.29k|                  line_start = it;
 3702|  4.64k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 4.53k, False: 105]
  |  Branch (3702:40): [True: 916, False: 3.62k]
  |  Branch (3702:54): [True: 2.42k, False: 1.19k]
  ------------------
 3703|  1.29k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 105, False: 1.19k]
  |  Branch (3703:36): [True: 195, False: 997]
  |  Branch (3703:51): [True: 557, False: 440]
  |  Branch (3703:66): [True: 394, False: 46]
  ------------------
 3704|  1.25k|                     first_key = false;
 3705|  1.25k|                     line_indent = 0;
 3706|  1.25k|                     continue; // Blank or comment-only line with tab indentation
 3707|  1.25k|                  }
 3708|     46|                  ctx.error = error_code::syntax_error;
 3709|     46|                  return;
 3710|  1.29k|               }
 3711|   331k|               else {
 3712|   331k|                  line_start = it;
 3713|   331k|                  break; // Content at column 0
 3714|   331k|               }
 3715|   584k|            }
 3716|       |
 3717|   529k|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 6.28k, False: 523k]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|   523k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 1.98k, False: 521k]
  |  Branch (3721:45): [True: 471, False: 520k]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|   520k|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 520k, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|   520k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 520k, False: 0]
  |  Branch (3728:39): [True: 248k, False: 272k]
  |  Branch (3728:62): [True: 115k, False: 132k]
  |  Branch (3728:84): [True: 76.7k, False: 38.7k]
  ------------------
 3729|  76.7k|                  it = line_start;
 3730|  76.7k|                  return;
 3731|  76.7k|               }
 3732|   444k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 171k, False: 272k]
  |  Branch (3732:43): [True: 15, False: 171k]
  ------------------
 3733|     15|                  it = line_start;
 3734|     15|                  return;
 3735|     15|               }
 3736|   444k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   444k|            bool established_mapping_indent_this_line = false;
 3740|   444k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 272k, False: 171k]
  ------------------
 3741|   272k|               mapping_indent = line_indent;
 3742|   272k|               established_mapping_indent_this_line = true;
 3743|   272k|               discovered_first_key_visual_indent = line_indent;
 3744|   272k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   272k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 272k, False: 0]
  |  Branch (3745:43): [True: 269k, False: 3.41k]
  ------------------
 3746|   269k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   269k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 240, False: 268k]
  ------------------
 3748|    240|                        ctx.error = error_code::syntax_error;
 3749|    240|                        return;
 3750|    240|                     }
 3751|       |
 3752|   268k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   268k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 267k, False: 1.23k]
  |  Branch (3753:49): [True: 203k, False: 64.7k]
  ------------------
 3754|   203k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   203k|                     }
 3756|   268k|                  }
 3757|   272k|               }
 3758|   272k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   444k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 443k, False: 240]
  |  Branch (3762:36): [True: 443k, False: 0]
  |  Branch (3762:59): [True: 171k, False: 272k]
  ------------------
 3763|   171k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 31.3k, False: 140k]
  ------------------
 3764|  31.3k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 31.0k, False: 328]
  |  Branch (3764:43): [True: 16.2k, False: 14.8k]
  ------------------
 3765|  16.2k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 25, False: 16.1k]
  ------------------
 3766|     25|                     ctx.error = error_code::syntax_error;
 3767|     25|                     return;
 3768|     25|                  }
 3769|  16.1k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 708, False: 15.4k]
  ------------------
 3770|    708|                     it = line_start;
 3771|    708|                     return;
 3772|    708|                  }
 3773|  16.1k|               }
 3774|  15.1k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 1.13k, False: 14.0k]
  ------------------
 3775|  1.13k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 158, False: 975]
  |  Branch (3775:47): [True: 1, False: 974]
  ------------------
 3776|    974|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 974, False: 0]
  |  Branch (3776:49): [True: 974, False: 0]
  |  Branch (3776:72): [True: 7, False: 967]
  ------------------
 3777|    166|                  ctx.error = error_code::syntax_error;
 3778|    166|                  return;
 3779|    166|               }
 3780|  31.3k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   443k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 443k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   443k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 443k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   443k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 240, False: 442k]
  |  Branch (3798:32): [True: 0, False: 442k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   443k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 247k, False: 195k]
  |  Branch (3807:53): [True: 80.2k, False: 167k]
  |  Branch (3807:94): [True: 19.7k, False: 60.5k]
  ------------------
 3808|  19.7k|               const auto after_colon = it + 1;
 3809|  19.7k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 17.3k, False: 2.44k]
  ------------------
 3810|  19.7k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 18, False: 19.7k]
  |  Branch (3810:43): [True: 17.3k, False: 2.42k]
  ------------------
 3811|  17.3k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 246, False: 17.0k]
  ------------------
 3812|    246|                  it = line_start;
 3813|    246|                  return;
 3814|    246|               }
 3815|  19.7k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   442k|            int32_t effective_line_indent = line_indent;
 3819|   442k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 442k, False: 240]
  |  Branch (3819:36): [True: 272k, False: 170k]
  ------------------
 3820|   272k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 203k, False: 69.3k]
  ------------------
 3821|   203k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 178k, False: 24.6k]
  |  Branch (3821:52): [True: 10.8k, False: 167k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   192k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   192k|            }
 3834|       |
 3835|   442k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 19.1k, False: 423k]
  ------------------
 3836|  19.1k|               return;
 3837|  19.1k|            }
 3838|   423k|            first_key = false;
 3839|       |
 3840|   423k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 423k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|       |               auto flow_end = it;
 3847|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|       |               if (bool(ctx.error)) [[unlikely]]
 3849|       |                  return;
 3850|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3851|       |                  it = flow_end;
 3852|       |                  return;
 3853|       |               }
 3854|       |            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   423k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 299k, False: 123k]
  ------------------
 3860|   299k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 169k, False: 130k]
  |  Branch (3860:34): [True: 1.57k, False: 128k]
  ------------------
 3861|   171k|                  auto peek = it;
 3862|   171k|                  skip_inline_ws(peek, end);
 3863|   171k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 170k, False: 148]
  |  Branch (3863:38): [True: 169k, False: 990]
  |  Branch (3863:55): [True: 168k, False: 1.06k]
  |  Branch (3863:72): [True: 166k, False: 2.25k]
  ------------------
 3864|   166k|                     continue; // At leading indent of new line
 3865|   166k|                  }
 3866|   171k|               }
 3867|   133k|               skip_inline_ws(it, end);
 3868|   133k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 133k, False: 148]
  |  Branch (3868:33): [True: 7.90k, False: 125k]
  ------------------
 3869|  7.90k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  7.90k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 7.90k, False: 0]
  ------------------
 3871|  7.90k|                        const char prev = *(it - 1);
 3872|  7.90k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 2.90k, False: 5.00k]
  |  Branch (3872:44): [True: 970, False: 1.93k]
  |  Branch (3872:60): [True: 440, False: 530]
  |  Branch (3872:76): [True: 10, False: 430]
  ------------------
 3873|     10|                           ctx.error = error_code::syntax_error;
 3874|     10|                           return;
 3875|     10|                        }
 3876|  7.90k|                     }
 3877|  7.90k|                  }
 3878|  7.90k|               }
 3879|  7.89k|               skip_comment(it, end);
 3880|   133k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 132k, False: 338]
  |  Branch (3880:34): [True: 39.8k, False: 92.9k]
  |  Branch (3880:49): [True: 59.5k, False: 33.3k]
  ------------------
 3881|  99.4k|                  skip_newline(it, end);
 3882|  99.4k|               }
 3883|  33.7k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 33.3k, False: 338]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|  33.3k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|  33.3k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 536, False: 32.8k]
  ------------------
 3890|    536|                        ctx.error = error_code::syntax_error;
 3891|    536|                        return;
 3892|    536|                     }
 3893|  33.3k|                  }
 3894|  33.3k|               }
 3895|   133k|            }
 3896|   423k|         }
 3897|   273k|      }
_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:
 4777|   442k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   442k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   442k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   442k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   442k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   442k|                           if (ctx.stream_begin) {
 4788|   442k|                              auto is_line_content_start = [&](auto pos) {
 4789|   442k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   442k|                              };
 4791|       |
 4792|   442k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   442k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   442k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   442k|                                 return line != end && *line == ':';
 4796|   442k|                              };
 4797|       |
 4798|   442k|                              if (!is_line_content_start(it) &&
 4799|   442k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   442k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   442k|                                 ctx.error = error_code::syntax_error;
 4802|   442k|                                 return false;
 4803|   442k|                              }
 4804|   442k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   442k|                           }
 4806|   442k|                        }
 4807|       |
 4808|   442k|                        if (*it == '-' &&
 4809|   442k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   442k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   442k|                           ctx.error = error_code::syntax_error;
 4813|   442k|                           return false;
 4814|   442k|                        }
 4815|       |
 4816|   442k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   442k|                           return false;
 4818|   442k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   442k|                        ctx.pop_indent();
 4820|   442k|                     }
 4821|   442k|                     else {
 4822|   442k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   442k|                        if (nested_indent >= 0) {
 4824|   442k|                           yaml::skip_to_content(it, end);
 4825|   442k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   442k|                              ctx.error = error_code::syntax_error;
 4827|   442k|                              return false;
 4828|   442k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   442k|                           const int32_t value_indent =
 4832|   442k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   442k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   442k|                              return false;
 4835|   442k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   442k|                           ctx.pop_indent();
 4837|   442k|                        }
 4838|   442k|                     }
 4839|   442k|                     return !bool(ctx.error);
 4840|   442k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   442k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 157k, False: 285k]
  |  Branch (4845:37): [True: 156k, False: 349]
  |  Branch (4845:58): [True: 5, False: 156k]
  ------------------
 4846|      5|                     ctx.error = error_code::syntax_error;
 4847|      5|                     return false;
 4848|      5|                  }
 4849|   442k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 157k, False: 285k]
  |  Branch (4849:38): [True: 349, False: 156k]
  |  Branch (4849:57): [True: 48.0k, False: 108k]
  |  Branch (4849:77): [True: 97.7k, False: 10.9k]
  |  Branch (4849:98): [True: 7.38k, False: 3.52k]
  ------------------
 4850|   153k|                     ++it; // skip '?'
 4851|   153k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   153k|                     const int32_t explicit_value_indicator_indent =
 4854|   153k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 39.8k, False: 113k]
  ------------------
 4855|       |
 4856|   153k|                     key_t key{};
 4857|   153k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   153k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   153k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   153k|                        };
 4861|       |
 4862|   153k|                        auto key_it = it;
 4863|   153k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   153k|                        auto content = key_it;
 4866|   153k|                        yaml::skip_to_content(content, end);
 4867|   153k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   153k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 152k, False: 1.31k]
  |  Branch (4872:47): [True: 47.7k, False: 104k]
  ------------------
 4873|  47.7k|                           auto anchor_probe = content + 1;
 4874|  47.7k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|  47.7k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 47.7k, False: 11]
  ------------------
 4876|  47.7k|                              auto after_anchor = anchor_probe;
 4877|  47.7k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|  47.7k|                              auto value_indicator = after_anchor;
 4880|  47.7k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 45.4k, False: 2.28k]
  |  Branch (4880:61): [True: 1.71k, False: 43.7k]
  ------------------
 4881|  1.71k|                                 key.clear();
 4882|  1.71k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  1.71k|                                 it = value_indicator;
 4884|  1.71k|                                 handled_anchor_only_empty_key = true;
 4885|  1.71k|                              }
 4886|  46.0k|                              else {
 4887|  46.0k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 43.7k, False: 2.28k]
  |  Branch (4887:64): [True: 1.16k, False: 42.6k]
  ------------------
 4888|  1.16k|                                    yaml::skip_comment(value_indicator, end);
 4889|  1.16k|                                 }
 4890|  46.0k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 43.7k, False: 2.28k]
  |  Branch (4890:65): [True: 5.28k, False: 38.4k]
  |  Branch (4890:93): [True: 4.63k, False: 33.8k]
  ------------------
 4891|  9.92k|                                    yaml::skip_newline(value_indicator, end);
 4892|  9.92k|                                    auto value_line = value_indicator;
 4893|  9.92k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  9.92k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 1, False: 9.92k]
  ------------------
 4895|      1|                                       return false;
 4896|  9.92k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 8.81k, False: 1.10k]
  |  Branch (4896:62): [True: 954, False: 7.86k]
  ------------------
 4897|    954|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 939, False: 15]
  ------------------
 4898|    939|                                       key.clear();
 4899|    939|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|    939|                                       it = value_line;
 4901|    939|                                       handled_anchor_only_empty_key = true;
 4902|    939|                                    }
 4903|  8.98k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 7.88k, False: 1.10k]
  |  Branch (4903:67): [True: 15, False: 7.86k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|     15|                                       ctx.error = error_code::syntax_error;
 4908|     15|                                       return false;
 4909|     15|                                    }
 4910|  9.92k|                                 }
 4911|  46.0k|                              }
 4912|  47.7k|                           }
 4913|  47.7k|                        }
 4914|       |
 4915|   153k|                        const bool key_content_spans_lines = [&] {
 4916|   153k|                           auto scan = key_it;
 4917|   153k|                           while (scan != content && scan != end) {
 4918|   153k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   153k|                              ++scan;
 4920|   153k|                           }
 4921|   153k|                           return false;
 4922|   153k|                        }();
 4923|       |
 4924|   153k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 2.64k, False: 150k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  2.64k|                        }
 4927|   150k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 1.31k, False: 149k]
  |  Branch (4927:53): [True: 2.60k, False: 146k]
  |  Branch (4927:72): [True: 1.47k, False: 1.12k]
  ------------------
 4928|  2.79k|                           key.clear();
 4929|  2.79k|                           it = content;
 4930|  2.79k|                        }
 4931|   148k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   148k|                           auto key_node_it = content;
 4937|   148k|                           auto key_node_end = end;
 4938|   148k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   148k|                              auto scan = content;
 4943|  1.81M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 1.72M, False: 81.4k]
  ------------------
 4944|   288M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 288M, False: 31.7k]
  |  Branch (4944:56): [True: 287M, False: 945k]
  |  Branch (4944:73): [True: 286M, False: 752k]
  ------------------
 4945|   286M|                                    ++scan;
 4946|   286M|                                 }
 4947|  1.72M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 31.7k, False: 1.69M]
  ------------------
 4948|  31.7k|                                    break;
 4949|  31.7k|                                 }
 4950|       |
 4951|  1.69M|                                 yaml::skip_newline(scan, end);
 4952|  1.69M|                                 auto line_start = scan;
 4953|       |
 4954|  1.69M|                                 int32_t indicator_indent = 0;
 4955|  2.53M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 2.45M, False: 81.4k]
  |  Branch (4955:56): [True: 834k, False: 1.61M]
  ------------------
 4956|   834k|                                    ++indicator_indent;
 4957|   834k|                                    ++scan;
 4958|   834k|                                 }
 4959|       |
 4960|  1.69M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 1.61M, False: 81.4k]
  |  Branch (4960:53): [True: 265k, False: 1.35M]
  ------------------
 4961|   265k|                                    const auto after_colon = scan + 1;
 4962|   265k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 554, False: 264k]
  ------------------
 4963|   264k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 212k, False: 51.9k]
  ------------------
 4964|   213k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 34.8k, False: 178k]
  ------------------
 4965|  34.8k|                                       key_node_end = line_start;
 4966|  34.8k|                                       break;
 4967|  34.8k|                                    }
 4968|   265k|                                 }
 4969|  1.69M|                              }
 4970|   148k|                           }
 4971|       |
 4972|   148k|                           glz::generic key_node{};
 4973|   148k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   148k|                           ctx.explicit_mapping_key_context = true;
 4975|   148k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   148k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   148k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 3.29k, False: 144k]
  ------------------
 4978|  3.29k|                              return false;
 4979|   144k|                           it = key_node_it;
 4980|   144k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 38, False: 144k]
  ------------------
 4981|     38|                              return false;
 4982|   144k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   150k|                     yaml::skip_inline_ws(it, end);
 4993|   153k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   153k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 102k, False: 50.6k]
  |  Branch (4996:40): [True: 12.5k, False: 90.3k]
  |  Branch (4996:55): [True: 40.8k, False: 49.5k]
  ------------------
 4997|  53.3k|                        auto probe = it;
 4998|  53.3k|                        bool found_value_indicator = false;
 4999|       |
 5000|   109k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 71.9k, False: 37.7k]
  |  Branch (5000:49): [True: 17.4k, False: 54.4k]
  |  Branch (5000:67): [True: 54.4k, False: 0]
  ------------------
 5001|  71.9k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|  71.9k|                           auto value_line = probe;
 5004|  71.9k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|  71.9k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 14, False: 71.9k]
  ------------------
 5006|     14|                              return false;
 5007|       |
 5008|  71.9k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 37.6k, False: 34.2k]
  |  Branch (5008:53): [True: 2.89k, False: 31.3k]
  |  Branch (5008:76): [True: 12.8k, False: 18.4k]
  ------------------
 5009|  53.4k|                              probe = value_line;
 5010|  53.4k|                              continue; // blank line
 5011|  53.4k|                           }
 5012|  18.4k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 2.86k, False: 15.6k]
  ------------------
 5013|  2.86k|                              yaml::skip_comment(value_line, end);
 5014|  2.86k|                              probe = value_line;
 5015|  2.86k|                              continue; // comment-only line
 5016|  2.86k|                           }
 5017|  15.6k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 3.70k, False: 11.9k]
  |  Branch (5017:54): [True: 667, False: 3.03k]
  ------------------
 5018|    667|                              it = value_line;
 5019|    667|                              found_value_indicator = true;
 5020|    667|                           }
 5021|  15.6k|                           break;
 5022|  18.4k|                        }
 5023|       |
 5024|  53.3k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 667, False: 52.6k]
  ------------------
 5025|    667|                           yaml::skip_inline_ws(it, end);
 5026|    667|                        }
 5027|  53.3k|                     }
 5028|       |
 5029|   153k|                     val_t val{};
 5030|   153k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 102k, False: 50.6k]
  |  Branch (5030:39): [True: 43.1k, False: 59.7k]
  ------------------
 5031|  43.1k|                        ++it;
 5032|  43.1k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 42.3k, False: 822]
  |  Branch (5032:42): [True: 2, False: 42.3k]
  ------------------
 5033|      2|                           ctx.error = error_code::syntax_error;
 5034|      2|                           return false;
 5035|      2|                        }
 5036|  43.1k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 42.3k, False: 822]
  |  Branch (5036:43): [True: 934, False: 41.4k]
  |  Branch (5036:58): [True: 2.73k, False: 38.6k]
  ------------------
 5037|  3.66k|                           auto probe = it;
 5038|  3.66k|                           yaml::skip_newline(probe, end);
 5039|  7.54k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 6.90k, False: 631]
  |  Branch (5039:51): [True: 3.87k, False: 3.03k]
  ------------------
 5040|  3.66k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 3.03k, False: 631]
  |  Branch (5040:48): [True: 454, False: 2.58k]
  |  Branch (5040:65): [True: 446, False: 8]
  |  Branch (5040:89): [True: 1, False: 445]
  ------------------
 5041|      1|                              ctx.error = error_code::syntax_error;
 5042|      1|                              return false;
 5043|      1|                           }
 5044|  3.66k|                        }
 5045|  43.1k|                        yaml::skip_inline_ws(it, end);
 5046|  43.1k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 479, False: 42.6k]
  ------------------
 5047|    479|                           return false;
 5048|  43.1k|                     }
 5049|       |
 5050|   153k|                     value.emplace(std::move(key), std::move(val));
 5051|   153k|                     return true;
 5052|   153k|                  }
 5053|       |
 5054|   289k|                  key_t key{};
 5055|   289k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   289k|                     auto key_probe = it;
 5057|   289k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   289k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 289k, False: 0]
  |  Branch (5058:74): [True: 967, False: 288k]
  |  Branch (5058:95): [True: 1.10k, False: 287k]
  ------------------
 5059|   289k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 2.06k, False: 287k]
  ------------------
 5060|  2.06k|                        glz::generic key_node{};
 5061|  2.06k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  2.06k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 454, False: 1.61k]
  ------------------
 5063|    454|                           return false;
 5064|  1.61k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 1, False: 1.61k]
  ------------------
 5065|      1|                           return false;
 5066|  1.61k|                     }
 5067|   287k|                     else {
 5068|   287k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 1.28k, False: 285k]
  ------------------
 5069|  1.28k|                           return false;
 5070|  1.28k|                        }
 5071|   287k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   287k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   289k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 2.68k, False: 286k]
  |  Branch (5081:36): [True: 869, False: 285k]
  ------------------
 5082|  1.81k|                     ctx.error = error_code::syntax_error;
 5083|  1.81k|                     return false;
 5084|  1.81k|                  }
 5085|   287k|                  ++it;
 5086|   287k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   287k|                  val_t val{};
 5089|   287k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 11.7k, False: 275k]
  ------------------
 5090|  11.7k|                     return false;
 5091|       |
 5092|   275k|                  value.emplace(std::move(key), std::move(val));
 5093|   275k|                  return true;
 5094|   287k|               });
_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:
 4915|   153k|                        const bool key_content_spans_lines = [&] {
 4916|   153k|                           auto scan = key_it;
 4917|   165k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 119k, False: 46.0k]
  |  Branch (4917:54): [True: 119k, False: 0]
  ------------------
 4918|   119k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 98.8k, False: 20.8k]
  |  Branch (4918:52): [True: 8.61k, False: 12.2k]
  ------------------
 4919|  12.2k|                              ++scan;
 4920|  12.2k|                           }
 4921|  46.0k|                           return false;
 4922|   153k|                        }();
_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_:
 4858|   144k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   144k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   144k|                        };
_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_:
 4778|   328k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   328k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 325k, False: 3.62k]
  |  Branch (4779:39): [True: 241k, False: 83.0k]
  ------------------
 4780|   241k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   241k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   241k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 241k, False: 0]
  ------------------
 4788|   241k|                              auto is_line_content_start = [&](auto pos) {
 4789|   241k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   241k|                              };
 4791|       |
 4792|   241k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   241k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   241k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   241k|                                 return line != end && *line == ':';
 4796|   241k|                              };
 4797|       |
 4798|   241k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 241k, False: 0]
  ------------------
 4799|   241k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 17.3k, False: 224k]
  ------------------
 4800|  17.3k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 764, False: 16.5k]
  ------------------
 4801|    764|                                 ctx.error = error_code::syntax_error;
 4802|    764|                                 return false;
 4803|    764|                              }
 4804|   241k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   241k|                           }
 4806|   241k|                        }
 4807|       |
 4808|   241k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 986, False: 241k]
  ------------------
 4809|    986|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 9, False: 977]
  |  Branch (4809:49): [True: 125, False: 852]
  ------------------
 4810|    134|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 9, False: 125]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|      9|                           ctx.error = error_code::syntax_error;
 4813|      9|                           return false;
 4814|      9|                        }
 4815|       |
 4816|   241k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 241k]
  ------------------
 4817|      0|                           return false;
 4818|   241k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   241k|                        ctx.pop_indent();
 4820|   241k|                     }
 4821|  86.7k|                     else {
 4822|  86.7k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|  86.7k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 13.5k, False: 73.1k]
  ------------------
 4824|  13.5k|                           yaml::skip_to_content(it, end);
 4825|  13.5k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 13.5k, False: 0]
  |  Branch (4825:45): [True: 0, False: 13.5k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  13.5k|                           const int32_t value_indent =
 4832|  13.5k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 13.5k]
  ------------------
 4833|  13.5k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 13.5k]
  ------------------
 4834|      0|                              return false;
 4835|  13.5k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  13.5k|                           ctx.pop_indent();
 4837|  13.5k|                        }
 4838|  86.7k|                     }
 4839|   328k|                     return !bool(ctx.error);
 4840|   328k|                  };
_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_:
 4788|   241k|                              auto is_line_content_start = [&](auto pos) {
 4789|   241k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   241k|                              };
_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_:
 4792|   258k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   258k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   542k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 542k, False: 0]
  |  Branch (4794:57): [True: 283k, False: 259k]
  |  Branch (4794:73): [True: 627, False: 258k]
  ------------------
 4795|   258k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 258k, False: 0]
  |  Branch (4795:56): [True: 141k, False: 117k]
  ------------------
 4796|   258k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS5_TkNS_10is_contextERNS_4yaml12yaml_contextESA_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|   298k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   298k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 298k]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|   298k|            }
_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|  64.5k|      {
  301|  64.5k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 64.5k]
  |  Branch (301:27): [True: 0, False: 64.5k]
  ------------------
  302|       |
  303|  64.5k|         ++it; // skip '*'
  304|  64.5k|         auto name = parse_anchor_name(it, end);
  305|  64.5k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 54, False: 64.5k]
  ------------------
  306|     54|            ctx.error = error_code::syntax_error;
  307|     54|            return true;
  308|     54|         }
  309|       |
  310|  64.5k|         auto anchor_it = ctx.anchors.find(name);
  311|  64.5k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 238, False: 64.2k]
  ------------------
  312|    238|            ctx.error = error_code::syntax_error; // undefined alias
  313|    238|            return true;
  314|    238|         }
  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|  64.2k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  64.2k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.00k, False: 63.2k]
  ------------------
  322|  1.00k|            return true;
  323|  1.00k|         }
  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|  63.2k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 43, False: 63.2k]
  ------------------
  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|  63.2k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  63.2k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 63.2k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  63.2k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 6, False: 63.2k]
  ------------------
  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|  63.2k|         auto replay_it = span.begin;
  348|  63.2k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  63.2k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  63.2k|         ctx.indent_stack.clear();
  353|  63.2k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 53.0k, False: 10.2k]
  ------------------
  354|  53.0k|            ctx.push_indent(span.base_indent - 1);
  355|  53.0k|         }
  356|       |
  357|  63.2k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  63.2k|         using V = std::remove_cvref_t<T>;
  360|  63.2k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  63.2k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  63.2k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  63.2k|         return true;
  367|  63.2k|      }
_ZN3glz4yaml15skip_to_contentIPKcS3_EEvRT_T0_:
 3559|  3.01M|      {
 3560|  4.99M|         while (it != end) {
  ------------------
  |  Branch (3560:17): [True: 4.92M, False: 65.2k]
  ------------------
 3561|  4.92M|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3561:17): [True: 1.23M, False: 3.69M]
  |  Branch (3561:32): [True: 628k, False: 3.06M]
  ------------------
 3562|  1.86M|               skip_newline(it, end);
 3563|  1.86M|            }
 3564|  3.06M|            else if (*it == '#') {
  ------------------
  |  Branch (3564:22): [True: 40.6k, False: 3.02M]
  ------------------
 3565|  40.6k|               skip_comment(it, end);
 3566|  40.6k|            }
 3567|  3.02M|            else if (*it == ' ') {
  ------------------
  |  Branch (3567:22): [True: 851k, False: 2.17M]
  ------------------
 3568|   851k|               auto line_start = it;
 3569|  2.30M|               while (it != end && *it == ' ') ++it;
  ------------------
  |  Branch (3569:23): [True: 2.30M, False: 7.10k]
  |  Branch (3569:36): [True: 1.45M, False: 844k]
  ------------------
 3570|   851k|               if (it == end || *it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3570:20): [True: 7.10k, False: 844k]
  |  Branch (3570:33): [True: 9.73k, False: 834k]
  |  Branch (3570:48): [True: 10.6k, False: 823k]
  ------------------
 3571|  27.5k|                  continue; // blank line with trailing spaces
 3572|  27.5k|               }
 3573|   823k|               if (*it == '#') {
  ------------------
  |  Branch (3573:20): [True: 52.0k, False: 771k]
  ------------------
 3574|  52.0k|                  skip_comment(it, end);
 3575|  52.0k|                  continue; // comment-only line
 3576|  52.0k|               }
 3577|   771k|               it = line_start; // content found, restore to start of indent
 3578|   771k|               return;
 3579|   823k|            }
 3580|  2.17M|            else {
 3581|  2.17M|               return; // content at column 0
 3582|  2.17M|            }
 3583|  4.92M|         }
 3584|  3.01M|      }
_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_:
 5205|  93.9k|      {
 5206|  93.9k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  93.9k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  93.9k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  93.9k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  93.9k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 93.9k, False: 0]
  ------------------
 5216|  93.9k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  93.9k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_:
 1892|  96.1k|      {
 1893|  96.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 4.98k, False: 91.2k]
  ------------------
 1894|  4.98k|            return;
 1895|       |
 1896|  91.2k|         yaml::node_preamble_state preamble{};
 1897|  91.2k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 2.76k, False: 88.4k]
  ------------------
 1898|  91.2k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  2.76k|            return;
 1900|       |
 1901|  88.4k|         std::string str;
 1902|  88.4k|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|  88.4k|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 88.4k, False: 0]
  ------------------
 1905|    425|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 425, False: 88.0k]
  ------------------
 1906|    425|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|    425|            break;
 1908|  1.09k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 1.09k, False: 87.3k]
  ------------------
 1909|  1.09k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  1.09k|            break;
 1911|    949|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 949, False: 87.4k]
  ------------------
 1912|  1.53k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 589, False: 87.8k]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  1.53k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  1.53k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 401, False: 1.13k]
  ------------------
 1918|  1.53k|            break;
 1919|  85.3k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 85.3k, False: 3.06k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|  85.3k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|  85.3k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1923:20): [True: 74.1k, False: 11.2k]
  ------------------
 1924|  74.1k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|  74.1k|               }
 1926|  11.2k|               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|  11.2k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|  11.2k|               }
 1930|       |            }
 1931|       |            else {
 1932|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|       |            }
 1934|  85.3k|            break;
 1935|  88.4k|         }
 1936|       |
 1937|  88.4k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 88.2k, False: 175]
  ------------------
 1938|  88.2k|            value = std::move(str);
 1939|  88.2k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|  88.2k|         }
 1941|  88.4k|      }
_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|  91.2k|      {
  466|  91.2k|         skip_inline_ws(it, end);
  467|       |
  468|  91.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 4, False: 91.2k]
  ------------------
  469|      4|            if constexpr (!AllowEmptyInput) {
  470|      4|               ctx.error = error_code::unexpected_end;
  471|      4|            }
  472|      4|            return true;
  473|      4|         }
  474|       |
  475|  91.2k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  91.2k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 5, False: 91.2k]
  ------------------
  477|      5|            ctx.error = error_code::syntax_error;
  478|      5|            return true;
  479|      5|         }
  480|  91.2k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 9, False: 91.1k]
  ------------------
  481|      9|            ctx.error = error_code::syntax_error;
  482|      9|            return true;
  483|      9|         }
  484|       |
  485|  91.1k|         skip_inline_ws(it, end);
  486|       |
  487|  91.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 11, False: 91.1k]
  ------------------
  488|     11|            if constexpr (!AllowEmptyInput) {
  489|     11|               ctx.error = error_code::unexpected_end;
  490|     11|            }
  491|     11|            return true;
  492|     11|         }
  493|       |
  494|  91.1k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 2.73k, False: 88.4k]
  ------------------
  495|  2.73k|            return true;
  496|  2.73k|         }
  497|       |
  498|  88.4k|         return false;
  499|  91.1k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS7_TkNS_10is_contextERNS_4yaml12yaml_contextESC_EEvOT1_OT2_OT0_T3_ENKUlNSF_8yaml_tagEE_clESP_:
 1898|  91.2k|                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|  91.1k|      {
  409|  91.1k|         state.has_anchor = false;
  410|  91.1k|         state.anchor_name.clear();
  411|  91.1k|         state.anchor_start = nullptr;
  412|  91.1k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  91.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|  91.1k|            else {
  421|  91.1k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 2.70k, False: 88.4k]
  ------------------
  422|  91.1k|            }
  423|  91.1k|         }
  424|       |
  425|  91.1k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 88.4k, False: 2.70k]
  |  Branch (425:27): [True: 2.08k, False: 86.3k]
  ------------------
  426|  2.08k|            ++it;
  427|  2.08k|            auto name = parse_anchor_name(it, end);
  428|  2.08k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 2.07k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  2.07k|            skip_inline_ws(it, end);
  433|  2.07k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 27, False: 2.05k]
  ------------------
  434|     27|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     27|                  ctx.error = error_code::unexpected_end;
  436|     27|               }
  437|     27|               return true;
  438|     27|            }
  439|  2.05k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  2.05k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 1, False: 2.05k]
  ------------------
  441|      1|                  ctx.error = error_code::syntax_error;
  442|      1|                  return true;
  443|      1|               }
  444|  2.05k|            }
  445|  2.05k|            state.has_anchor = true;
  446|  2.05k|            state.anchor_name = std::string(name);
  447|  2.05k|            state.anchor_start = &*it;
  448|  2.05k|         }
  449|       |
  450|  91.1k|         return false;
  451|  91.1k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|  91.1k|      {
  301|  91.1k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 91.1k]
  |  Branch (301:27): [True: 88.4k, False: 2.70k]
  ------------------
  302|       |
  303|  2.70k|         ++it; // skip '*'
  304|  2.70k|         auto name = parse_anchor_name(it, end);
  305|  2.70k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 4, False: 2.70k]
  ------------------
  306|      4|            ctx.error = error_code::syntax_error;
  307|      4|            return true;
  308|      4|         }
  309|       |
  310|  2.70k|         auto anchor_it = ctx.anchors.find(name);
  311|  2.70k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 19, False: 2.68k]
  ------------------
  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|  2.68k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.68k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 448, False: 2.23k]
  ------------------
  322|    448|            return true;
  323|    448|         }
  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.23k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 13, False: 2.22k]
  ------------------
  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|  2.22k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.22k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 2.22k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  2.22k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.22k]
  ------------------
  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.22k|         auto replay_it = span.begin;
  348|  2.22k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.22k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.22k|         ctx.indent_stack.clear();
  353|  2.22k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.03k, False: 185]
  ------------------
  354|  2.03k|            ctx.push_indent(span.base_indent - 1);
  355|  2.03k|         }
  356|       |
  357|  2.22k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.22k|         using V = std::remove_cvref_t<T>;
  360|  2.22k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.22k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.22k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.22k|         return true;
  367|  2.22k|      }
_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_:
 5205|  21.5k|      {
 5206|  21.5k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  21.5k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  21.5k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  21.5k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  21.5k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 21.5k, False: 0]
  ------------------
 5216|  21.5k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  21.5k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2047|  22.5k|      {
 2048|  22.5k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 22.5k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|  22.5k|         yaml::node_preamble_state preamble{};
 2052|  22.5k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 2.88k, False: 19.6k]
  ------------------
 2053|  22.5k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  22.5k|                   return yaml::tag_valid_for_float(tag);
 2055|  22.5k|                }
 2056|  22.5k|                else {
 2057|  22.5k|                   return yaml::tag_valid_for_int(tag);
 2058|  22.5k|                }
 2059|  22.5k|             }))
 2060|  2.88k|            return;
 2061|       |
 2062|  19.6k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|  19.6k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|  19.6k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|  19.6k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 5.15k, False: 14.4k]
  ------------------
 2070|  5.15k|               ++it;
 2071|  5.15k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 4.75k, False: 405]
  |  Branch (2071:38): [True: 693, False: 4.05k]
  |  Branch (2071:74): [True: 85, False: 3.97k]
  ------------------
 2072|  3.97k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 22, False: 3.95k]
  ------------------
 2073|    800|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|    800|                  it += 3;
 2075|    800|                  finalize();
 2076|    800|                  return;
 2077|    800|               }
 2078|  4.35k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 3.95k, False: 405]
  |  Branch (2078:38): [True: 126, False: 3.82k]
  |  Branch (2078:74): [True: 95, False: 3.73k]
  ------------------
 2079|  3.73k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 7, False: 3.72k]
  ------------------
 2080|    228|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|    228|                  it += 3;
 2082|    228|                  finalize();
 2083|    228|                  return;
 2084|    228|               }
 2085|  4.12k|               it = start;
 2086|  4.12k|            }
 2087|       |
 2088|  18.6k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 1.11k, False: 17.4k]
  |  Branch (2088:31): [True: 2.07k, False: 15.4k]
  ------------------
 2089|  3.19k|               const char sign = *it;
 2090|  3.19k|               ++it;
 2091|  3.19k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 3.08k, False: 110]
  |  Branch (2091:33): [True: 1.32k, False: 1.76k]
  ------------------
 2092|  1.32k|                  ++it;
 2093|  1.32k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 959, False: 366]
  |  Branch (2093:41): [True: 204, False: 755]
  |  Branch (2093:77): [True: 173, False: 582]
  ------------------
 2094|    678|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 301, False: 281]
  ------------------
 2095|    678|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 378, False: 300]
  ------------------
 2096|    378|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|    378|                     }
 2098|    300|                     else {
 2099|    300|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|    300|                     }
 2101|    678|                     it += 3;
 2102|    678|                     finalize();
 2103|    678|                     return;
 2104|    678|                  }
 2105|  1.32k|               }
 2106|  2.51k|               it = start;
 2107|  2.51k|            }
 2108|  18.6k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|  17.9k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  11.4M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 11.4M, False: 4.00k]
  ------------------
 2115|  11.4M|            const char c = *it;
 2116|  11.4M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 4.59k, False: 11.4M]
  |  Branch (2116:29): [True: 1.27k, False: 11.4M]
  |  Branch (2116:42): [True: 1.91k, False: 11.4M]
  |  Branch (2116:55): [True: 904, False: 11.4M]
  |  Branch (2116:68): [True: 920, False: 11.4M]
  |  Branch (2116:80): [True: 284, False: 11.4M]
  |  Branch (2116:92): [True: 932, False: 11.4M]
  |  Branch (2116:104): [True: 2.16k, False: 11.4M]
  ------------------
 2117|  12.9k|               break;
 2118|  12.9k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  11.4M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 12.1k, False: 11.3M]
  ------------------
 2121|  12.1k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 484, False: 11.6k]
  |  Branch (2121:39): [True: 1.67k, False: 9.96k]
  |  Branch (2121:59): [True: 101, False: 9.86k]
  |  Branch (2121:80): [True: 205, False: 9.65k]
  |  Branch (2121:101): [True: 177, False: 9.47k]
  ------------------
 2122|  2.64k|                  break;
 2123|  2.64k|               }
 2124|  12.1k|            }
 2125|  11.4M|            ++it;
 2126|  11.4M|         }
 2127|       |
 2128|  19.6k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|  19.6k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 1.05k, False: 18.5k]
  ------------------
 2131|  1.05k|            ctx.error = error_code::parse_number_failure;
 2132|  1.05k|            return;
 2133|  1.05k|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|  18.5k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|  18.5k|            bool negative = false;
 2186|  18.5k|            std::string_view digits = num_str;
 2187|       |
 2188|  18.5k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 16.8k, False: 1.70k]
  |  Branch (2188:37): [True: 1.77k, False: 15.1k]
  |  Branch (2188:62): [True: 740, False: 14.3k]
  ------------------
 2189|  2.51k|               negative = (digits.front() == '-');
 2190|  2.51k|               digits.remove_prefix(1);
 2191|  2.51k|            }
 2192|       |
 2193|  18.5k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 12.7k, False: 5.84k]
  |  Branch (2193:38): [True: 4.95k, False: 7.80k]
  ------------------
 2194|  4.95k|               int base = 10;
 2195|  4.95k|               size_t offset = 0;
 2196|       |
 2197|  4.95k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 1.89k, False: 3.05k]
  |  Branch (2197:40): [True: 569, False: 2.48k]
  ------------------
 2198|  2.46k|                  base = 16;
 2199|  2.46k|                  offset = 2;
 2200|  2.46k|               }
 2201|  2.48k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 82, False: 2.40k]
  |  Branch (2201:45): [True: 212, False: 2.19k]
  ------------------
 2202|    294|                  base = 8;
 2203|    294|                  offset = 2;
 2204|    294|               }
 2205|  2.19k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 93, False: 2.10k]
  |  Branch (2205:45): [True: 438, False: 1.66k]
  ------------------
 2206|    531|                  base = 2;
 2207|    531|                  offset = 2;
 2208|    531|               }
 2209|       |
 2210|  4.95k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 3.29k, False: 1.66k]
  ------------------
 2211|  3.29k|                  auto raw_digits = digits.substr(offset);
 2212|  3.29k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  3.29k|                  std::string clean_storage;
 2215|  3.29k|                  std::string_view clean_view;
 2216|  3.29k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 1.59k, False: 1.69k]
  ------------------
 2217|  1.59k|                     clean_storage.reserve(raw_digits.size());
 2218|  2.03M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 2.03M, False: 1.59k]
  ------------------
 2219|  2.03M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 2.03M, False: 2.77k]
  ------------------
 2220|  2.03M|                           clean_storage.push_back(c);
 2221|  2.03M|                        }
 2222|  2.03M|                     }
 2223|  1.59k|                     clean_view = clean_storage;
 2224|  1.59k|                  }
 2225|  1.69k|                  else {
 2226|  1.69k|                     clean_view = raw_digits;
 2227|  1.69k|                  }
 2228|       |
 2229|  3.29k|                  uint64_t parsed_int{};
 2230|  3.29k|                  auto [ptr, ec] =
 2231|  3.29k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  3.29k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 1.50k, False: 1.78k]
  |  Branch (2232:44): [True: 849, False: 933]
  ------------------
 2233|  2.35k|                     ctx.error = error_code::parse_number_failure;
 2234|  2.35k|                     finalize();
 2235|  2.35k|                     return;
 2236|  2.35k|                  }
 2237|       |
 2238|    933|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|    933|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 482, False: 451]
  ------------------
 2240|    933|                  finalize();
 2241|    933|                  return;
 2242|  3.29k|               }
 2243|  4.95k|            }
 2244|  18.5k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|  15.3k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|  18.5k|         std::string clean_storage;
 2250|  18.5k|         std::string_view clean_view;
 2251|       |
 2252|  18.5k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 989, False: 17.6k]
  ------------------
 2253|    989|            clean_storage.reserve(num_str.size());
 2254|   961k|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 961k, False: 989]
  ------------------
 2255|   961k|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 958k, False: 2.30k]
  ------------------
 2256|   958k|                  clean_storage.push_back(c);
 2257|   958k|               }
 2258|   961k|            }
 2259|    989|            clean_view = clean_storage;
 2260|    989|         }
 2261|  17.6k|         else {
 2262|  17.6k|            clean_view = num_str;
 2263|  17.6k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|  18.5k|         auto parse_view = clean_view;
 2268|  18.5k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 13.5k, False: 5.09k]
  |  Branch (2268:37): [True: 1.77k, False: 11.7k]
  ------------------
 2269|  1.77k|            parse_view.remove_prefix(1);
 2270|  1.77k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 296, False: 1.48k]
  ------------------
 2271|    296|               ctx.error = error_code::parse_number_failure;
 2272|    296|               return;
 2273|    296|            }
 2274|  1.77k|         }
 2275|       |
 2276|  18.2k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|  18.2k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|  18.2k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 10.6k, False: 7.68k]
  |  Branch (2279:45): [True: 5.34k, False: 2.33k]
  ------------------
 2280|  10.9k|               ctx.error = error_code::parse_number_failure;
 2281|  10.9k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|  18.2k|         finalize();
 2292|  18.2k|      }
_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|  22.5k|      {
  466|  22.5k|         skip_inline_ws(it, end);
  467|       |
  468|  22.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 143, False: 22.3k]
  ------------------
  469|    143|            if constexpr (!AllowEmptyInput) {
  470|    143|               ctx.error = error_code::unexpected_end;
  471|    143|            }
  472|    143|            return true;
  473|    143|         }
  474|       |
  475|  22.3k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  22.3k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 324, False: 22.0k]
  ------------------
  477|    324|            ctx.error = error_code::syntax_error;
  478|    324|            return true;
  479|    324|         }
  480|  22.0k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 108, False: 21.9k]
  ------------------
  481|    108|            ctx.error = error_code::syntax_error;
  482|    108|            return true;
  483|    108|         }
  484|       |
  485|  21.9k|         skip_inline_ws(it, end);
  486|       |
  487|  21.9k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 60, False: 21.8k]
  ------------------
  488|     60|            if constexpr (!AllowEmptyInput) {
  489|     60|               ctx.error = error_code::unexpected_end;
  490|     60|            }
  491|     60|            return true;
  492|     60|         }
  493|       |
  494|  21.8k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 2.25k, False: 19.6k]
  ------------------
  495|  2.25k|            return true;
  496|  2.25k|         }
  497|       |
  498|  19.6k|         return false;
  499|  21.8k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2052|  22.0k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|  22.0k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  22.0k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|  22.0k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  21.8k|      {
  409|  21.8k|         state.has_anchor = false;
  410|  21.8k|         state.anchor_name.clear();
  411|  21.8k|         state.anchor_start = nullptr;
  412|  21.8k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  21.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|  21.8k|            else {
  421|  21.8k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 1.83k, False: 20.0k]
  ------------------
  422|  21.8k|            }
  423|  21.8k|         }
  424|       |
  425|  21.8k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 20.0k, False: 1.83k]
  |  Branch (425:27): [True: 1.98k, False: 18.0k]
  ------------------
  426|  1.98k|            ++it;
  427|  1.98k|            auto name = parse_anchor_name(it, end);
  428|  1.98k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 175, False: 1.80k]
  ------------------
  429|    175|               ctx.error = error_code::syntax_error;
  430|    175|               return true;
  431|    175|            }
  432|  1.80k|            skip_inline_ws(it, end);
  433|  1.80k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 242, False: 1.56k]
  ------------------
  434|    242|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    242|                  ctx.error = error_code::unexpected_end;
  436|    242|               }
  437|    242|               return true;
  438|    242|            }
  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.56k|            state.has_anchor = true;
  446|  1.56k|            state.anchor_name = std::string(name);
  447|  1.56k|            state.anchor_start = &*it;
  448|  1.56k|         }
  449|       |
  450|  21.4k|         return false;
  451|  21.8k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  21.8k|      {
  301|  21.8k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 21.8k]
  |  Branch (301:27): [True: 20.0k, False: 1.83k]
  ------------------
  302|       |
  303|  1.83k|         ++it; // skip '*'
  304|  1.83k|         auto name = parse_anchor_name(it, end);
  305|  1.83k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 317, False: 1.51k]
  ------------------
  306|    317|            ctx.error = error_code::syntax_error;
  307|    317|            return true;
  308|    317|         }
  309|       |
  310|  1.51k|         auto anchor_it = ctx.anchors.find(name);
  311|  1.51k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 473, False: 1.04k]
  ------------------
  312|    473|            ctx.error = error_code::syntax_error; // undefined alias
  313|    473|            return true;
  314|    473|         }
  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.04k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.04k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 73, False: 970]
  ------------------
  322|     73|            return true;
  323|     73|         }
  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|    970|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 8, False: 962]
  ------------------
  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|    962|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    962|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 960]
  ------------------
  339|      2|            return true;
  340|       |
  341|    960|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 960]
  ------------------
  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|    960|         auto replay_it = span.begin;
  348|    960|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    960|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    960|         ctx.indent_stack.clear();
  353|    960|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 704, False: 256]
  ------------------
  354|    704|            ctx.push_indent(span.base_indent - 1);
  355|    704|         }
  356|       |
  357|    960|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    960|         using V = std::remove_cvref_t<T>;
  360|    960|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    960|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    960|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    960|         return true;
  367|    960|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRdTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|  18.2k|         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_:
 5205|  5.90k|      {
 5206|  5.90k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  5.90k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  5.90k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  5.90k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  5.90k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 5.90k, False: 0]
  ------------------
 5216|  5.90k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  5.90k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2012|  6.21k|      {
 2013|  6.21k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 6.21k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  6.21k|         yaml::node_preamble_state preamble{};
 2017|  6.21k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 692, False: 5.52k]
  ------------------
 2018|  6.21k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|    692|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  5.52k|         std::string str;
 2023|  5.52k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  5.52k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 1.66k, False: 3.85k]
  |  Branch (2025:31): [True: 1.05k, False: 2.80k]
  |  Branch (2025:48): [True: 26, False: 2.77k]
  |  Branch (2025:65): [True: 123, False: 2.65k]
  |  Branch (2025:81): [True: 136, False: 2.51k]
  |  Branch (2025:97): [True: 2, False: 2.51k]
  ------------------
 2026|  3.48k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 328, False: 2.18k]
  |  Branch (2026:29): [True: 57, False: 2.13k]
  |  Branch (2026:44): [True: 90, False: 2.04k]
  ------------------
 2027|  3.48k|            value = true;
 2028|  3.48k|         }
 2029|  2.04k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 295, False: 1.74k]
  |  Branch (2029:37): [True: 218, False: 1.52k]
  |  Branch (2029:55): [True: 449, False: 1.07k]
  |  Branch (2029:73): [True: 588, False: 491]
  |  Branch (2029:88): [True: 309, False: 182]
  |  Branch (2029:103): [True: 14, False: 168]
  ------------------
 2030|  1.90k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 19, False: 149]
  |  Branch (2030:35): [True: 2, False: 147]
  |  Branch (2030:51): [True: 11, False: 136]
  ------------------
 2031|  1.90k|            value = false;
 2032|  1.90k|         }
 2033|    136|         else {
 2034|    136|            ctx.error = error_code::expected_true_or_false;
 2035|    136|         }
 2036|       |
 2037|  5.52k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  5.52k|      }
_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|  6.21k|      {
  466|  6.21k|         skip_inline_ws(it, end);
  467|       |
  468|  6.21k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 3, False: 6.21k]
  ------------------
  469|      3|            if constexpr (!AllowEmptyInput) {
  470|      3|               ctx.error = error_code::unexpected_end;
  471|      3|            }
  472|      3|            return true;
  473|      3|         }
  474|       |
  475|  6.21k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  6.21k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 6.20k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|  6.20k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 1, False: 6.20k]
  ------------------
  481|      1|            ctx.error = error_code::syntax_error;
  482|      1|            return true;
  483|      1|         }
  484|       |
  485|  6.20k|         skip_inline_ws(it, end);
  486|       |
  487|  6.20k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 6.20k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|  6.20k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 684, False: 5.52k]
  ------------------
  495|    684|            return true;
  496|    684|         }
  497|       |
  498|  5.52k|         return false;
  499|  6.20k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRbTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESI_:
 2018|  6.20k|                                             [](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|  6.20k|      {
  409|  6.20k|         state.has_anchor = false;
  410|  6.20k|         state.anchor_name.clear();
  411|  6.20k|         state.anchor_start = nullptr;
  412|  6.20k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  6.20k|         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|  6.20k|            else {
  421|  6.20k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 670, False: 5.53k]
  ------------------
  422|  6.20k|            }
  423|  6.20k|         }
  424|       |
  425|  6.20k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 5.53k, False: 670]
  |  Branch (425:27): [True: 692, False: 4.84k]
  ------------------
  426|    692|            ++it;
  427|    692|            auto name = parse_anchor_name(it, end);
  428|    692|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 3, False: 689]
  ------------------
  429|      3|               ctx.error = error_code::syntax_error;
  430|      3|               return true;
  431|      3|            }
  432|    689|            skip_inline_ws(it, end);
  433|    689|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 11, False: 678]
  ------------------
  434|     11|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     11|                  ctx.error = error_code::unexpected_end;
  436|     11|               }
  437|     11|               return true;
  438|     11|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|    678|            state.has_anchor = true;
  446|    678|            state.anchor_name = std::string(name);
  447|    678|            state.anchor_start = &*it;
  448|    678|         }
  449|       |
  450|  6.19k|         return false;
  451|  6.20k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  6.20k|      {
  301|  6.20k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 6.20k]
  |  Branch (301:27): [True: 5.53k, False: 670]
  ------------------
  302|       |
  303|    670|         ++it; // skip '*'
  304|    670|         auto name = parse_anchor_name(it, end);
  305|    670|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 3, False: 667]
  ------------------
  306|      3|            ctx.error = error_code::syntax_error;
  307|      3|            return true;
  308|      3|         }
  309|       |
  310|    667|         auto anchor_it = ctx.anchors.find(name);
  311|    667|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 19, False: 648]
  ------------------
  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|    648|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|    648|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 332, False: 316]
  ------------------
  322|    332|            return true;
  323|    332|         }
  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|    316|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 2, False: 314]
  ------------------
  329|      2|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      2|            return true;
  331|      2|         }
  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|    314|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    314|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 313]
  ------------------
  339|      1|            return true;
  340|       |
  341|    313|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 313]
  ------------------
  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|    313|         auto replay_it = span.begin;
  348|    313|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    313|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    313|         ctx.indent_stack.clear();
  353|    313|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 292, False: 21]
  ------------------
  354|    292|            ctx.push_indent(span.base_indent - 1);
  355|    292|         }
  356|       |
  357|    313|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    313|         using V = std::remove_cvref_t<T>;
  360|    313|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    313|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    313|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    313|         return true;
  367|    313|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRDnTkNS_10is_contextERNS_4yaml12yaml_contextES5_EEvOT1_OT2_OT0_T3_:
 2398|  1.43k|      {
 2399|  1.43k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 1.43k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  1.43k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  1.43k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 12, False: 1.41k]
  ------------------
 2405|     12|            ctx.error = error_code::unexpected_end;
 2406|     12|            return;
 2407|     12|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  1.41k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 383, False: 1.03k]
  ------------------
 2411|    383|            ++it;
 2412|    383|            return;
 2413|    383|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  1.03k|         auto start = it;
 2417|  4.80k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 4.63k, False: 164]
  |  Branch (2417:30): [True: 3.76k, False: 871]
  ------------------
 2418|  3.76k|            ++it;
 2419|  3.76k|         }
 2420|       |
 2421|  1.03k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  1.03k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 25, False: 1.01k]
  ------------------
 2423|     25|            ctx.error = error_code::syntax_error;
 2424|     25|         }
 2425|  1.03k|      }
_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_:
 5205|  73.7k|      {
 5206|  73.7k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  73.7k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  73.7k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  73.7k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  73.7k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 73.7k, False: 0]
  ------------------
 5216|  73.7k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  73.7k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERPKcRS9_TkNS_10is_contextERNS_4yaml12yaml_contextESE_EEvOT1_OT2_OT0_T3_:
 4098|  75.1k|      {
 4099|  75.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 75.1k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|  75.1k|         auto peek = it;
 4104|  75.1k|         yaml::node_preamble_state preamble{};
 4105|  75.1k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 1.74k, False: 73.3k]
  ------------------
 4106|  75.1k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  1.74k|            it = peek;
 4108|  1.74k|            return;
 4109|  1.74k|         }
 4110|       |
 4111|  73.3k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 26.1k, False: 47.1k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|  26.1k|            it = peek;
 4114|  26.1k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|  26.1k|         }
 4116|  47.1k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 47.1k, False: 80]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|  47.1k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 30, False: 47.0k]
  |  Branch (4119:57): [True: 1.14k, False: 45.9k]
  ------------------
 4120|  1.17k|               it = peek;
 4121|  1.17k|            }
 4122|  47.1k|            int32_t seq_indent = ctx.current_indent();
 4123|  47.1k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 47.0k, False: 58]
  |  Branch (4123:31): [True: 43.2k, False: 3.84k]
  ------------------
 4124|  43.2k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 32.2k, False: 10.9k]
  |  Branch (4124:62): [True: 16.4k, False: 15.8k]
  ------------------
 4125|  43.2k|                                                          : (ctx.current_indent() + 1);
 4126|  43.2k|            }
 4127|  47.1k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|  47.1k|         }
 4129|     80|         else {
 4130|     80|            ctx.error = error_code::syntax_error;
 4131|     80|         }
 4132|       |
 4133|  73.3k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|  73.3k|      }
_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|  75.1k|      {
  466|  75.1k|         skip_inline_ws(it, end);
  467|       |
  468|  75.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 4, False: 75.1k]
  ------------------
  469|      4|            if constexpr (!AllowEmptyInput) {
  470|      4|               ctx.error = error_code::unexpected_end;
  471|      4|            }
  472|      4|            return true;
  473|      4|         }
  474|       |
  475|  75.1k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  75.1k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 75.1k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|  75.1k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 75.1k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  75.1k|         skip_inline_ws(it, end);
  486|       |
  487|  75.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 75.1k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|  75.1k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 1.73k, False: 73.3k]
  ------------------
  495|  1.73k|            return true;
  496|  1.73k|         }
  497|       |
  498|  73.3k|         return false;
  499|  75.1k|      }
_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_:
 4106|  75.1k|                                             [](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|  75.1k|      {
  409|  75.1k|         state.has_anchor = false;
  410|  75.1k|         state.anchor_name.clear();
  411|  75.1k|         state.anchor_start = nullptr;
  412|  75.1k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  75.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|  75.1k|            else {
  421|  75.1k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 1.71k, False: 73.4k]
  ------------------
  422|  75.1k|            }
  423|  75.1k|         }
  424|       |
  425|  75.1k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 73.4k, False: 1.71k]
  |  Branch (425:27): [True: 1.53k, False: 71.8k]
  ------------------
  426|  1.53k|            ++it;
  427|  1.53k|            auto name = parse_anchor_name(it, end);
  428|  1.53k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 6, False: 1.52k]
  ------------------
  429|      6|               ctx.error = error_code::syntax_error;
  430|      6|               return true;
  431|      6|            }
  432|  1.52k|            skip_inline_ws(it, end);
  433|  1.52k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 13, False: 1.51k]
  ------------------
  434|     13|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     13|                  ctx.error = error_code::unexpected_end;
  436|     13|               }
  437|     13|               return true;
  438|     13|            }
  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.51k|            state.has_anchor = true;
  446|  1.51k|            state.anchor_name = std::string(name);
  447|  1.51k|            state.anchor_start = &*it;
  448|  1.51k|         }
  449|       |
  450|  75.1k|         return false;
  451|  75.1k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|  75.1k|      {
  301|  75.1k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 75.1k]
  |  Branch (301:27): [True: 73.4k, False: 1.71k]
  ------------------
  302|       |
  303|  1.71k|         ++it; // skip '*'
  304|  1.71k|         auto name = parse_anchor_name(it, end);
  305|  1.71k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 3, False: 1.71k]
  ------------------
  306|      3|            ctx.error = error_code::syntax_error;
  307|      3|            return true;
  308|      3|         }
  309|       |
  310|  1.71k|         auto anchor_it = ctx.anchors.find(name);
  311|  1.71k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 20, False: 1.69k]
  ------------------
  312|     20|            ctx.error = error_code::syntax_error; // undefined alias
  313|     20|            return true;
  314|     20|         }
  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.69k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.69k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 351, False: 1.34k]
  ------------------
  322|    351|            return true;
  323|    351|         }
  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.34k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 1, False: 1.34k]
  ------------------
  329|      1|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      1|            return true;
  331|      1|         }
  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.34k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.34k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 1.34k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  1.34k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.34k]
  ------------------
  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.34k|         auto replay_it = span.begin;
  348|  1.34k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.34k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.34k|         ctx.indent_stack.clear();
  353|  1.34k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.21k, False: 132]
  ------------------
  354|  1.21k|            ctx.push_indent(span.base_indent - 1);
  355|  1.21k|         }
  356|       |
  357|  1.34k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.34k|         using V = std::remove_cvref_t<T>;
  360|  1.34k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.34k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.34k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.34k|         return true;
  367|  1.34k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|  26.1k|      {
 2597|  26.1k|         using V = std::remove_cvref_t<T>;
 2598|  26.1k|         using value_type = typename V::value_type;
 2599|       |
 2600|  26.1k|         struct sequence_container_adapter
 2601|  26.1k|         {
 2602|  26.1k|            size_t index = 0;
 2603|       |
 2604|  26.1k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|  26.1k|            {
 2606|  26.1k|               if constexpr (!resizable<V>) {
 2607|  26.1k|                  return index >= container.size();
 2608|  26.1k|               }
 2609|  26.1k|               else {
 2610|  26.1k|                  (void)container;
 2611|  26.1k|                  return false;
 2612|  26.1k|               }
 2613|  26.1k|            }
 2614|       |
 2615|  26.1k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|  26.1k|            inline void append(V& container, value_type&& element) noexcept
 2618|  26.1k|            {
 2619|  26.1k|               if constexpr (emplace_backable<V>) {
 2620|  26.1k|                  container.emplace_back(std::move(element));
 2621|  26.1k|               }
 2622|  26.1k|               else if constexpr (emplaceable<V>) {
 2623|  26.1k|                  container.emplace(std::move(element));
 2624|  26.1k|               }
 2625|  26.1k|            }
 2626|  26.1k|         };
 2627|       |
 2628|  26.1k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 26.1k]
  |  Branch (2628:27): [True: 0, False: 26.1k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|  26.1k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|  26.1k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|  26.1k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|  26.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 8, False: 26.1k]
  ------------------
 2641|      8|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|  26.1k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 25.5k, False: 615]
  |  Branch (2644:27): [True: 2.80k, False: 22.7k]
  ------------------
 2645|  2.80k|            ++it;
 2646|  2.80k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  2.80k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 9, False: 2.79k]
  ------------------
 2648|      9|               return;
 2649|  2.79k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|  2.79k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2650:20): [True: 85, False: 2.70k]
  ------------------
 2651|     85|                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|     85|               }
 2653|  2.79k|            }
 2654|  2.79k|            return;
 2655|  2.80k|         }
 2656|       |
 2657|  23.3k|         bool just_saw_comma = false;
 2658|  23.3k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  23.3k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|  43.7k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 42.1k, False: 1.60k]
  ------------------
 2663|  42.1k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|  42.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 42.1k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|  42.1k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 42.1k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|  42.1k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 3.04k, False: 39.1k]
  ------------------
 2673|  3.04k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 3.04k, False: 0]
  ------------------
 2674|  3.04k|                     ++it;
 2675|  3.04k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  3.04k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 3, False: 3.03k]
  ------------------
 2677|      3|                        return;
 2678|  3.03k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|  3.03k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2679:29): [True: 76, False: 2.96k]
  ------------------
 2680|     76|                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|     76|                        }
 2682|  3.03k|                     }
 2683|  3.03k|                     return;
 2684|  3.04k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  3.04k|               }
 2688|       |
 2689|  39.1k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 260, False: 38.8k]
  |  Branch (2689:34): [True: 14, False: 38.8k]
  ------------------
 2690|    274|                  ctx.error = error_code::syntax_error;
 2691|    274|                  return;
 2692|    274|               }
 2693|  38.8k|               just_saw_comma = false;
 2694|       |
 2695|  38.8k|               value_type element{};
 2696|  38.8k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|  38.8k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 12.3k, False: 26.4k]
  ------------------
 2699|  12.3k|                  return;
 2700|       |
 2701|  26.4k|               bool saw_line_break_before_separator = false;
 2702|  26.4k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|  26.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 8, False: 26.4k]
  ------------------
 2704|      8|                  return;
 2705|       |
 2706|  26.4k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 24.1k, False: 2.28k]
  |  Branch (2706:33): [True: 6.05k, False: 18.1k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  6.05k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 34, False: 6.02k]
  ------------------
 2709|     34|                     ctx.error = error_code::syntax_error;
 2710|     34|                     return;
 2711|     34|                  }
 2712|  6.02k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  6.02k|                     glz::generic key_node = std::move(element);
 2714|  6.02k|                     ++it;
 2715|  6.02k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  6.02k|                     glz::generic mapped{};
 2718|  6.02k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  6.02k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 342, False: 5.68k]
  ------------------
 2720|    342|                        return;
 2721|       |
 2722|  5.68k|                     std::string key;
 2723|  5.68k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 1, False: 5.67k]
  ------------------
 2724|      1|                        return;
 2725|       |
 2726|  5.67k|                     glz::generic pair{};
 2727|  5.67k|                     pair[key] = std::move(mapped);
 2728|  5.67k|                     element = std::move(pair);
 2729|       |
 2730|  5.67k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  5.67k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 3, False: 5.67k]
  ------------------
 2732|      3|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  6.02k|               }
 2739|       |
 2740|  26.4k|               adapter.append(value, std::move(element));
 2741|       |
 2742|  26.4k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 2.39k, False: 24.0k]
  ------------------
 2743|  2.39k|                  ctx.error = error_code::unexpected_end;
 2744|  2.39k|                  return;
 2745|  2.39k|               }
 2746|       |
 2747|  24.0k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 2.58k, False: 21.4k]
  ------------------
 2748|  2.58k|                  ++it;
 2749|  2.58k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  2.58k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 44, False: 2.54k]
  ------------------
 2751|     44|                     return;
 2752|  2.54k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|  2.54k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2753:26): [True: 193, False: 2.34k]
  ------------------
 2754|    193|                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|    193|                     }
 2756|  2.54k|                  }
 2757|  2.54k|                  return;
 2758|  2.58k|               }
 2759|  21.4k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 20.3k, False: 1.07k]
  ------------------
 2760|  20.3k|                  ++it;
 2761|  20.3k|                  just_saw_comma = true;
 2762|  20.3k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  20.3k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 4, False: 20.3k]
  ------------------
 2764|      4|                     return;
 2765|  20.3k|               }
 2766|  1.07k|               else {
 2767|  1.07k|                  ctx.error = error_code::syntax_error;
 2768|  1.07k|                  return;
 2769|  1.07k|               }
 2770|  24.0k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  23.3k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|  73.3k|      {
 2581|  73.3k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|  73.3k|            if constexpr (!check_append_arrays(Opts)) {
 2584|  73.3k|               value.clear();
 2585|  73.3k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|  73.3k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|  26.1k|            {
 2619|  26.1k|               if constexpr (emplace_backable<V>) {
 2620|  26.1k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|  26.1k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|  47.1k|      {
 3082|  47.1k|         using V = std::remove_cvref_t<T>;
 3083|  47.1k|         using value_type = typename V::value_type;
 3084|       |
 3085|  47.1k|         struct sequence_container_adapter
 3086|  47.1k|         {
 3087|  47.1k|            size_t index = 0;
 3088|       |
 3089|  47.1k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|  47.1k|            {
 3091|  47.1k|               if constexpr (!resizable<V>) {
 3092|  47.1k|                  return index >= container.size();
 3093|  47.1k|               }
 3094|  47.1k|               else {
 3095|  47.1k|                  (void)container;
 3096|  47.1k|                  return false;
 3097|  47.1k|               }
 3098|  47.1k|            }
 3099|       |
 3100|  47.1k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|  47.1k|            inline void append(V& container, value_type&& element) noexcept
 3103|  47.1k|            {
 3104|  47.1k|               if constexpr (emplace_backable<V>) {
 3105|  47.1k|                  container.emplace_back(std::move(element));
 3106|  47.1k|               }
 3107|  47.1k|               else if constexpr (emplaceable<V>) {
 3108|  47.1k|                  container.emplace(std::move(element));
 3109|  47.1k|               }
 3110|  47.1k|            }
 3111|  47.1k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|  47.1k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|  47.1k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|  47.1k|         bool first_item = true;
 3122|  47.1k|         bool has_pending_item_anchor = false;
 3123|  47.1k|         std::string pending_item_anchor_name{};
 3124|  47.1k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|   130k|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 98.9k, False: 31.4k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|  98.9k|            int32_t line_indent = 0;
 3137|  98.9k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|  98.9k|            auto line_start = it;
 3139|       |
 3140|   143k|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 141k, False: 2.32k]
  ------------------
 3141|   141k|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 11.5k, False: 130k]
  ------------------
 3142|  11.5k|                  skip_comment(it, end);
 3143|  11.5k|                  skip_newline(it, end);
 3144|  11.5k|                  line_start = it;
 3145|  11.5k|                  line_indent = 0;
 3146|  11.5k|               }
 3147|   130k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 14.3k, False: 115k]
  |  Branch (3147:40): [True: 11.4k, False: 104k]
  ------------------
 3148|  25.8k|                  skip_newline(it, end);
 3149|  25.8k|                  line_start = it;
 3150|  25.8k|                  line_indent = 0;
 3151|  25.8k|               }
 3152|   104k|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 17.6k, False: 86.5k]
  ------------------
 3153|  17.6k|                  line_start = it;
 3154|  17.6k|                  line_indent = 0;
 3155|  43.2k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 43.0k, False: 281]
  |  Branch (3155:39): [True: 25.5k, False: 17.4k]
  ------------------
 3156|  25.5k|                     ++line_indent;
 3157|  25.5k|                     ++it;
 3158|  25.5k|                  }
 3159|       |
 3160|  17.6k|                  bool saw_tab = false;
 3161|  18.7k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 18.4k, False: 297]
  |  Branch (3161:40): [True: 436, False: 17.9k]
  |  Branch (3161:54): [True: 567, False: 17.4k]
  ------------------
 3162|  1.00k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 875, False: 128]
  |  Branch (3162:43): [True: 128, False: 0]
  ------------------
 3163|  1.00k|                     ++it;
 3164|  1.00k|                  }
 3165|       |
 3166|  17.6k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 297, False: 17.4k]
  |  Branch (3166:36): [True: 335, False: 17.0k]
  |  Branch (3166:51): [True: 530, False: 16.5k]
  |  Branch (3166:66): [True: 5.13k, False: 11.4k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|  6.29k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 6.00k, False: 297]
  |  Branch (3168:39): [True: 5.13k, False: 865]
  ------------------
 3169|  5.13k|                        skip_comment(it, end);
 3170|  5.13k|                     }
 3171|  6.29k|                     line_indent = 0;
 3172|  6.29k|                     continue;
 3173|  6.29k|                  }
 3174|       |
 3175|  11.4k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 7, False: 11.3k]
  ------------------
 3176|      7|                     ctx.error = error_code::syntax_error;
 3177|      7|                     return;
 3178|      7|                  }
 3179|  11.3k|                  break; // Found content
 3180|  11.4k|               }
 3181|  86.5k|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 1.32k, False: 85.2k]
  ------------------
 3182|  1.32k|                  line_start = it;
 3183|  4.88k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 4.79k, False: 86]
  |  Branch (3183:40): [True: 630, False: 4.16k]
  |  Branch (3183:54): [True: 2.93k, False: 1.23k]
  ------------------
 3184|  1.32k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 86, False: 1.23k]
  |  Branch (3184:36): [True: 269, False: 966]
  |  Branch (3184:51): [True: 423, False: 543]
  |  Branch (3184:66): [True: 527, False: 16]
  ------------------
 3185|  1.30k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 1.21k, False: 86]
  |  Branch (3185:39): [True: 527, False: 692]
  ------------------
 3186|    527|                        skip_comment(it, end);
 3187|    527|                     }
 3188|  1.30k|                     line_indent = 0;
 3189|  1.30k|                     continue;
 3190|  1.30k|                  }
 3191|     16|                  ctx.error = error_code::syntax_error;
 3192|     16|                  return;
 3193|  1.32k|               }
 3194|  85.2k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|  85.2k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 47.1k, False: 38.1k]
  |  Branch (3198:37): [True: 47.0k, False: 58]
  ------------------
 3199|  47.0k|                     line_indent = sequence_indent;
 3200|  47.0k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|  47.0k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 47.0k, False: 0]
  |  Branch (3201:49): [True: 46.7k, False: 347]
  ------------------
 3202|  46.7k|                           auto probe = it;
 3203|  46.7k|                           int32_t leading_ws = 0;
 3204|  46.7k|                           bool saw_tab = false;
 3205|  88.9k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 88.8k, False: 69]
  |  Branch (3205:64): [True: 38.0k, False: 50.8k]
  |  Branch (3205:87): [True: 4.21k, False: 46.6k]
  ------------------
 3206|  42.2k|                              --probe;
 3207|  42.2k|                              ++leading_ws;
 3208|  42.2k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 3.99k, False: 38.2k]
  |  Branch (3208:52): [True: 270, False: 37.9k]
  ------------------
 3209|  42.2k|                           }
 3210|  46.7k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 69, False: 46.6k]
  |  Branch (3210:61): [True: 16.4k, False: 30.1k]
  |  Branch (3210:85): [True: 5.29k, False: 24.8k]
  ------------------
 3211|  21.8k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 20, False: 21.8k]
  ------------------
 3212|     20|                                 ctx.error = error_code::syntax_error;
 3213|     20|                                 return;
 3214|     20|                              }
 3215|  21.8k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|  21.8k|                           }
 3217|  46.7k|                        }
 3218|  47.0k|                     }
 3219|  47.0k|                  }
 3220|  47.0k|                  break;
 3221|  85.2k|               }
 3222|   141k|            }
 3223|       |
 3224|  98.9k|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 2.32k, False: 96.6k]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|  96.6k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 1.68k, False: 94.9k]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|  94.9k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 6.25k, False: 88.7k]
  ------------------
 3231|  6.25k|               it = line_start;
 3232|  6.25k|               return;
 3233|  6.25k|            }
 3234|       |
 3235|  88.7k|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 12.3k, False: 76.3k]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  12.3k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 10, False: 12.3k]
  ------------------
 3240|     10|                  ctx.error = error_code::syntax_error;
 3241|     10|                  return;
 3242|     10|               }
 3243|       |
 3244|  12.3k|               ++it;
 3245|  12.3k|               auto pending_name = parse_anchor_name(it, end);
 3246|  12.3k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 8, False: 12.3k]
  ------------------
 3247|      8|                  ctx.error = error_code::syntax_error;
 3248|      8|                  return;
 3249|      8|               }
 3250|  12.3k|               skip_inline_ws(it, end);
 3251|  12.3k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 12.3k, False: 27]
  |  Branch (3251:33): [True: 6.28k, False: 6.07k]
  ------------------
 3252|  6.28k|                  skip_comment(it, end);
 3253|  6.28k|               }
 3254|       |
 3255|  12.3k|               has_pending_item_anchor = true;
 3256|  12.3k|               pending_item_anchor_name = std::string(pending_name);
 3257|  12.3k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  12.3k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 37, False: 12.3k]
  |  Branch (3259:34): [True: 5.43k, False: 6.91k]
  |  Branch (3259:49): [True: 19, False: 5.41k]
  ------------------
 3260|     56|                  ctx.error = error_code::syntax_error;
 3261|     56|                  return;
 3262|     56|               }
 3263|       |
 3264|  12.3k|               skip_newline(it, end);
 3265|  12.3k|               continue;
 3266|  12.3k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|  76.3k|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 3.91k, False: 72.3k]
  ------------------
 3270|  3.91k|               it = line_start;
 3271|  3.91k|               return;
 3272|  3.91k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|  72.3k|            dash_col = line_indent;
 3278|  72.3k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|  72.3k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 72.3k, False: 20]
  ------------------
 3280|  72.3k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|  72.3k|               }
 3282|  72.3k|            }
 3283|       |
 3284|  72.3k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|  72.3k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 70.8k, False: 1.53k]
  |  Branch (3287:30): [True: 966, False: 69.8k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|    966|               it = line_start;
 3290|    966|               return;
 3291|    966|            }
 3292|       |
 3293|  71.4k|            bool saw_tab_after_dash = false;
 3294|   115k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 113k, False: 1.61k]
  |  Branch (3294:34): [True: 39.6k, False: 74.2k]
  |  Branch (3294:48): [True: 4.41k, False: 69.8k]
  ------------------
 3295|  44.0k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 898, False: 43.1k]
  |  Branch (3295:59): [True: 3.69k, False: 39.4k]
  ------------------
 3296|  44.0k|               ++it;
 3297|  44.0k|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|  71.4k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 3.69k, False: 67.7k]
  |  Branch (3299:39): [True: 3.67k, False: 28]
  |  Branch (3299:52): [True: 1.58k, False: 2.08k]
  ------------------
 3300|  1.58k|               const auto after_dash = it + 1;
 3301|  1.58k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 3, False: 1.58k]
  |  Branch (3301:41): [True: 1, False: 1.58k]
  ------------------
 3302|      4|                  ctx.error = error_code::syntax_error;
 3303|      4|                  return;
 3304|      4|               }
 3305|  1.58k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|  71.4k|            auto parse_element = [&](auto& element) {
 3309|  71.4k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|  71.4k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  71.4k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|  71.4k|                     return;
 3319|  71.4k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  71.4k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  71.4k|                  ctx.sequence_item_value_context = true;
 3322|  71.4k|                  ctx.sequence_dash_indent = dash_col;
 3323|  71.4k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  71.4k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  71.4k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  71.4k|                  ctx.pop_indent();
 3327|  71.4k|               }
 3328|  71.4k|               else {
 3329|       |                  // Value on next line - nested block
 3330|  71.4k|                  skip_ws_and_comment(it, end);
 3331|  71.4k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  71.4k|                  auto nested_start = it;
 3335|  71.4k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  71.4k|                  if (bool(ctx.error)) [[unlikely]]
 3337|  71.4k|                     return;
 3338|  71.4k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  71.4k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|  71.4k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  71.4k|                     const int32_t element_indent =
 3350|  71.4k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|  71.4k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|  71.4k|                        return;
 3353|  71.4k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  71.4k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  71.4k|                     ctx.sequence_item_value_context = true;
 3356|  71.4k|                     ctx.sequence_dash_indent = dash_col;
 3357|  71.4k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  71.4k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  71.4k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  71.4k|                     ctx.pop_indent();
 3361|  71.4k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  71.4k|               }
 3364|       |
 3365|  71.4k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|  71.4k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|  71.4k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  71.4k|                                                                      pending_item_anchor_indent};
 3369|  71.4k|                  has_pending_item_anchor = false;
 3370|  71.4k|               }
 3371|  71.4k|            };
 3372|       |
 3373|  71.4k|            if constexpr (emplace_backable<V>) {
 3374|  71.4k|               auto& element = value.emplace_back();
 3375|  71.4k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|  71.4k|            first_item = false;
 3394|       |
 3395|  71.4k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 458, False: 70.9k]
  ------------------
 3396|    458|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|  71.4k|         }
 3401|  47.1k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|  71.4k|            auto parse_element = [&](auto& element) {
 3309|  71.4k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 69.8k, False: 1.59k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|  71.4k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 69.8k, False: 1.59k]
  |  Branch (3312:33): [True: 34.5k, False: 35.2k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  34.5k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 34.5k]
  ------------------
 3318|      0|                     return;
 3319|  34.5k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  34.5k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  34.5k|                  ctx.sequence_item_value_context = true;
 3322|  34.5k|                  ctx.sequence_dash_indent = dash_col;
 3323|  34.5k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  34.5k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  34.5k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  34.5k|                  ctx.pop_indent();
 3327|  34.5k|               }
 3328|  36.8k|               else {
 3329|       |                  // Value on next line - nested block
 3330|  36.8k|                  skip_ws_and_comment(it, end);
 3331|  36.8k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  36.8k|                  auto nested_start = it;
 3335|  36.8k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  36.8k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 3, False: 36.8k]
  ------------------
 3337|      3|                     return;
 3338|  36.8k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  36.8k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 418, False: 36.4k]
  ------------------
 3344|  36.8k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 17.2k, False: 19.5k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  17.2k|                     const int32_t element_indent =
 3350|  17.2k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 17.2k]
  ------------------
 3351|  17.2k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 17.2k]
  ------------------
 3352|      0|                        return;
 3353|  17.2k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  17.2k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  17.2k|                     ctx.sequence_item_value_context = true;
 3356|  17.2k|                     ctx.sequence_dash_indent = dash_col;
 3357|  17.2k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  17.2k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  17.2k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  17.2k|                     ctx.pop_indent();
 3361|  17.2k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  36.8k|               }
 3364|       |
 3365|  71.3k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 7.22k, False: 64.1k]
  |  Branch (3365:47): [True: 7.17k, False: 45]
  ------------------
 3366|  7.17k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 6.13k, False: 1.03k]
  ------------------
 3367|  7.17k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  7.17k|                                                                      pending_item_anchor_indent};
 3369|  7.17k|                  has_pending_item_anchor = false;
 3370|  7.17k|               }
 3371|  71.3k|            };
_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_:
 5423|   167k|   {
 5424|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|       |            int depth = 0;
 5432|       |            while (pos != stop) {
 5433|       |               const char c = *pos;
 5434|       |               if (c == '"' || c == '\'') {
 5435|       |                  const char quote = c;
 5436|       |                  ++pos;
 5437|       |                  while (pos != stop && *pos != quote) {
 5438|       |                     if (*pos == '\\' && quote == '"') {
 5439|       |                        ++pos;
 5440|       |                        if (pos != stop) ++pos;
 5441|       |                     }
 5442|       |                     else {
 5443|       |                        ++pos;
 5444|       |                     }
 5445|       |                  }
 5446|       |                  if (pos != stop) ++pos;
 5447|       |                  continue;
 5448|       |               }
 5449|       |               if (c == '[' || c == '{') {
 5450|       |                  ++depth;
 5451|       |                  ++pos;
 5452|       |                  continue;
 5453|       |               }
 5454|       |               if (c == ']' || c == '}') {
 5455|       |                  if (depth == 0) return false;
 5456|       |                  --depth;
 5457|       |                  ++pos;
 5458|       |                  continue;
 5459|       |               }
 5460|       |               if (c == ',' && depth == 0) return false;
 5461|       |               if (c == ':' && depth == 0) {
 5462|       |                  auto next = pos + 1;
 5463|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|       |               }
 5465|       |               ++pos;
 5466|       |            }
 5467|       |            return false;
 5468|       |         };
 5469|       |
 5470|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5471|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5472|       |               return;
 5473|       |            }
 5474|       |            if (bool(ctx.error)) {
 5475|       |               return;
 5476|       |            }
 5477|       |         }
 5478|       |
 5479|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|       |         return;
 5481|       |      }
 5482|       |
 5483|   167k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 84.2k, False: 82.9k]
  ------------------
 5484|  84.2k|         return;
 5485|  84.2k|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|  82.9k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 5.56k, False: 77.4k]
  ------------------
 5488|  5.56k|         return;
 5489|  5.56k|      }
 5490|  77.4k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|  77.4k|   }
_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_:
 5848|  15.9k|            auto is_word_boundary = [&](const auto ptr) {
 5849|  15.9k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 376, False: 15.5k]
  ------------------
 5850|    376|                  return true;
 5851|    376|               }
 5852|  15.5k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 10.1k, False: 5.47k]
  ------------------
 5853|  10.1k|                  auto next = ptr + 1;
 5854|  10.1k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 673, False: 9.42k]
  |  Branch (5854:43): [True: 6.99k, False: 2.43k]
  |  Branch (5854:59): [True: 1.04k, False: 1.38k]
  |  Branch (5854:76): [True: 632, False: 752]
  |  Branch (5854:93): [True: 483, False: 269]
  ------------------
 5855|  10.1k|               }
 5856|  5.47k|               return is_plain_scalar_boundary(*ptr);
 5857|  15.5k|            };
_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:
 5774|  5.47k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  5.47k|               switch (ch) {
 5776|    316|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 316, False: 5.15k]
  ------------------
 5777|    699|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 383, False: 5.09k]
  ------------------
 5778|  2.43k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 1.73k, False: 3.73k]
  ------------------
 5779|  4.52k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 2.08k, False: 3.38k]
  ------------------
 5780|  4.52k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 3, False: 5.47k]
  ------------------
 5781|  4.53k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 11, False: 5.46k]
  ------------------
 5782|  4.54k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 12, False: 5.46k]
  ------------------
 5783|  4.54k|                  return true;
 5784|    927|               default:
  ------------------
  |  Branch (5784:16): [True: 927, False: 4.54k]
  ------------------
 5785|    927|                  return false;
 5786|  5.47k|               }
 5787|  5.47k|            };
_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_:
 5789|  14.7k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5791|       |                  return false;
 5792|       |               }
 5793|  14.7k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 702, False: 14.0k]
  ------------------
 5794|    702|                  return false;
 5795|    702|               }
 5796|  14.0k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 290, False: 13.7k]
  |  Branch (5796:40): [True: 12.0k, False: 1.72k]
  |  Branch (5796:61): [True: 9.95k, False: 2.08k]
  ------------------
 5797|  10.2k|                  return false;
 5798|  10.2k|               }
 5799|       |
 5800|  3.81k|               auto look = word_end;
 5801|  3.81k|               yaml::skip_newline(look, end);
 5802|  13.0k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 12.3k, False: 715]
  ------------------
 5803|  12.3k|                  int32_t line_indent = 0;
 5804|  18.7k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 18.6k, False: 50]
  |  Branch (5804:41): [True: 6.36k, False: 12.3k]
  ------------------
 5805|  6.36k|                     ++line_indent;
 5806|  6.36k|                     ++look;
 5807|  6.36k|                  }
 5808|  12.3k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 12.3k, False: 50]
  |  Branch (5808:38): [True: 371, False: 11.9k]
  ------------------
 5809|    371|                     return false;
 5810|    371|                  }
 5811|  12.0k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 50, False: 11.9k]
  |  Branch (5811:38): [True: 1.30k, False: 10.6k]
  |  Branch (5811:55): [True: 3.95k, False: 6.69k]
  ------------------
 5812|  5.30k|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 5.25k, False: 50]
  ------------------
 5813|  5.25k|                        yaml::skip_newline(look, end);
 5814|  5.25k|                        continue;
 5815|  5.25k|                     }
 5816|     50|                     return false;
 5817|  5.30k|                  }
 5818|  6.69k|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 4.03k, False: 2.66k]
  ------------------
 5819|  4.03k|                     yaml::skip_comment(look, end);
 5820|  4.03k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 4.02k, False: 10]
  |  Branch (5820:42): [True: 3.05k, False: 962]
  |  Branch (5820:59): [True: 962, False: 0]
  ------------------
 5821|  4.02k|                        yaml::skip_newline(look, end);
 5822|  4.02k|                        continue;
 5823|  4.02k|                     }
 5824|     10|                     return false;
 5825|  4.03k|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  2.66k|                  {
 5831|  2.66k|                     auto scan = look;
 5832|   276k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 276k, False: 79]
  |  Branch (5832:44): [True: 276k, False: 234]
  |  Branch (5832:61): [True: 276k, False: 150]
  ------------------
 5833|   276k|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 9.82k, False: 266k]
  ------------------
 5834|  9.82k|                           auto after_colon = scan + 1;
 5835|  9.82k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 31, False: 9.79k]
  |  Branch (5835:54): [True: 1.14k, False: 8.65k]
  |  Branch (5835:77): [True: 445, False: 8.20k]
  ------------------
 5836|  8.20k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 119, False: 8.08k]
  |  Branch (5836:56): [True: 467, False: 7.62k]
  ------------------
 5837|  2.20k|                              return false;
 5838|  2.20k|                           }
 5839|  9.82k|                        }
 5840|   273k|                        ++scan;
 5841|   273k|                     }
 5842|  2.66k|                  }
 5843|       |
 5844|    463|                  return line_indent > ctx.current_indent();
 5845|  2.66k|               }
 5846|    715|               return false;
 5847|  3.81k|            };
_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_:
 5377|   206k|   {
 5378|   206k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   206k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   206k|         const bool could_be_mapping = [&] {
 5386|   206k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   206k|               return line_could_be_flow_mapping(it, end);
 5388|   206k|            }
 5389|   206k|            else {
 5390|   206k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   206k|            }
 5392|   206k|         }();
 5393|   206k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 85.0k, False: 121k]
  ------------------
 5394|  85.0k|            return false;
 5395|  85.0k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   121k|         auto temp_ctx = ctx.make_speculative();
 5398|   121k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   121k|                                                                                               end);
 5400|   121k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   121k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   121k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 110k, False: 10.6k]
  ------------------
 5403|   110k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   110k|            return true;
 5405|   110k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  10.6k|         ctx.error = temp_ctx.error;
 5410|  10.6k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  10.6k|         return false;
 5412|   121k|      }
 5413|   206k|   }
_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:
 5385|   206k|         const bool could_be_mapping = [&] {
 5386|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5387|       |               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|   206k|            else {
 5390|   206k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   206k|            }
 5392|   206k|         }();
_ZZN3glz5parseILj450EE2opITnDaXtlNS_4optsELj450ELb0ELb0ELb1ELb1EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS_4yaml12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_ENKUlT_E_clISD_EEDaSM_:
  145|    347|               auto is_document_start = [&](auto pos) {
  146|    347|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (146:23): [True: 262, False: 85]
  |  Branch (146:41): [True: 125, False: 137]
  |  Branch (146:58): [True: 111, False: 14]
  |  Branch (146:75): [True: 108, False: 3]
  ------------------
  147|    108|                     auto after = pos + 3;
  148|    108|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (148:29): [True: 11, False: 97]
  |  Branch (148:45): [True: 24, False: 73]
  |  Branch (148:62): [True: 50, False: 23]
  |  Branch (148:80): [True: 12, False: 11]
  |  Branch (148:98): [True: 9, False: 2]
  ------------------
  149|      2|                            *after == '#';
  ------------------
  |  Branch (149:29): [True: 1, False: 1]
  ------------------
  150|    108|                  }
  151|    239|                  return false;
  152|    347|               };
_ZN3glz9read_yamlITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERKNSt3__16vectorIcNS8_9allocatorIcEEEEEENS_9error_ctxEOT0_OT1_:
 6606|  65.6k|   {
 6607|  65.6k|      if (buffer.empty()) {
  ------------------
  |  Branch (6607:11): [True: 0, False: 65.6k]
  ------------------
 6608|      0|         using V = std::remove_cvref_t<T>;
 6609|      0|         if constexpr (requires { value = nullptr; }) {
 6610|      0|            value = nullptr;
 6611|      0|            return {};
 6612|       |         }
 6613|       |         else if constexpr (nullable_like<V>) {
 6614|       |            value = {};
 6615|       |            return {};
 6616|       |         }
 6617|      0|      }
 6618|      0|      yaml::yaml_context ctx{};
 6619|  65.6k|      return read<set_yaml<Opts>()>(std::forward<T>(value), std::forward<Buffer>(buffer), ctx);
 6620|  65.6k|   }
_ZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   69|  65.6k|      {
   70|  65.6k|         if constexpr (requires { ctx.stream_begin; }) {
   71|  65.6k|            if (!ctx.stream_begin && it != end) {
  ------------------
  |  Branch (71:17): [True: 65.6k, False: 0]
  |  Branch (71:38): [True: 65.6k, False: 0]
  ------------------
   72|  65.6k|               ctx.stream_begin = &*it;
   73|       |               // The line memo holds pointers into whatever buffer filled it, so a reused
   74|       |               // context must not carry a previous read's into this one.
   75|  65.6k|               if constexpr (requires { ctx.reset_line_memo(); }) {
   76|  65.6k|                  ctx.reset_line_memo();
   77|  65.6k|               }
   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|  65.6k|               if constexpr (requires { ctx.alias_expansion_budget; } && requires { size_t(end - it); }) {
   82|  65.6k|                  const size_t scaled = size_t(end - it) * yaml::max_alias_expansion_factor;
   83|  65.6k|                  ctx.alias_expansion_budget =
   84|  65.6k|                     scaled > yaml::min_alias_expansion_bytes ? scaled : yaml::min_alias_expansion_bytes;
  ------------------
  |  Branch (84:22): [True: 324, False: 65.3k]
  ------------------
   85|  65.6k|               }
   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|  65.6k|               if constexpr (requires { ctx.key_expansion_budget; } && requires { size_t(end - it); }) {
   89|  65.6k|                  const size_t scaled = size_t(end - it) * yaml::max_key_expansion_factor;
   90|  65.6k|                  ctx.key_expansion_budget =
   91|  65.6k|                     scaled > yaml::min_key_expansion_bytes ? scaled : yaml::min_key_expansion_bytes;
  ------------------
  |  Branch (91:22): [True: 324, False: 65.3k]
  ------------------
   92|  65.6k|               }
   93|  65.6k|            }
   94|  65.6k|         }
   95|       |         // Skip YAML directives and document start marker (---) if present
   96|  65.6k|         yaml::skip_document_start(it, end, ctx);
   97|  65.6k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (97:14): [True: 513, False: 65.1k]
  ------------------
   98|    513|            return;
   99|    513|         }
  100|       |
  101|  65.1k|         using V = std::remove_cvref_t<T>;
  102|  65.1k|         if (it == end) {
  ------------------
  |  Branch (102:14): [True: 74, False: 65.0k]
  ------------------
  103|       |            // An empty document is a valid YAML null document.
  104|     74|            if constexpr (requires { value = nullptr; }) {
  105|     74|               value = nullptr;
  106|     74|               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|     74|         }
  117|       |
  118|       |         // A bare document boundary marker at root denotes an empty document.
  119|       |         // Examples: "---\n---\n", "# comment\n...\n"
  120|  65.1k|         if (yaml::at_document_start(it, end) || yaml::at_document_end(it, end)) {
  ------------------
  |  Branch (120:14): [True: 85, False: 65.0k]
  |  Branch (120:50): [True: 21, False: 65.0k]
  ------------------
  121|     32|            if constexpr (requires { value = nullptr; }) {
  122|     32|               value = nullptr;
  123|     32|               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|     32|         }
  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|  65.1k|         if constexpr (!check_partial_read(Opts)) {
  144|  65.1k|            if (!bool(ctx.error) && ctx.current_indent() < 0) {
  ------------------
  |  Branch (144:17): [True: 11.1k, False: 53.9k]
  |  Branch (144:37): [True: 11.1k, False: 0]
  ------------------
  145|  11.1k|               auto is_document_start = [&](auto pos) {
  146|  11.1k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  147|  11.1k|                     auto after = pos + 3;
  148|  11.1k|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  149|  11.1k|                            *after == '#';
  150|  11.1k|                  }
  151|  11.1k|                  return false;
  152|  11.1k|               };
  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|  11.1k|               if constexpr (requires { ctx.line_prefix_before(it); }) {
  162|  11.1k|                  if (it != end && ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (162:23): [True: 2.38k, False: 8.81k]
  |  Branch (162:23): [True: 1.59k, False: 9.60k]
  |  Branch (162:36): [True: 1.59k, False: 789]
  ------------------
  163|  1.59k|                     auto rest = it;
  164|  4.66k|                     while (rest != end && (*rest == ' ' || *rest == '\t')) ++rest;
  ------------------
  |  Branch (164:29): [True: 4.63k, False: 30]
  |  Branch (164:45): [True: 943, False: 3.68k]
  |  Branch (164:61): [True: 2.12k, False: 1.56k]
  ------------------
  165|  1.59k|                     if (rest != end && *rest != '\n' && *rest != '\r' && *rest != '#') {
  ------------------
  |  Branch (165:26): [True: 1.56k, False: 30]
  |  Branch (165:41): [True: 1.24k, False: 325]
  |  Branch (165:58): [True: 866, False: 375]
  |  Branch (165:75): [True: 701, False: 165]
  ------------------
  166|    701|                        ctx.error = error_code::syntax_error;
  167|    701|                        return;
  168|    701|                     }
  169|  1.59k|                  }
  170|  11.1k|               }
  171|       |
  172|  10.4k|               auto tail_scan = it;
  173|  11.1k|               bool seen_document_end_marker = false;
  174|  27.1k|               while (tail_scan != end) {
  ------------------
  |  Branch (174:23): [True: 17.1k, False: 9.97k]
  ------------------
  175|  17.1k|                  auto line = tail_scan;
  176|  25.5k|                  while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (176:26): [True: 25.5k, False: 64]
  |  Branch (176:42): [True: 5.81k, False: 19.6k]
  |  Branch (176:58): [True: 2.61k, False: 17.0k]
  ------------------
  177|  17.1k|                  if (line != tail_scan && line != end && *line != '\n' && *line != '\r' && *line != '#') {
  ------------------
  |  Branch (177:23): [True: 4.50k, False: 12.6k]
  |  Branch (177:44): [True: 4.43k, False: 64]
  |  Branch (177:59): [True: 3.48k, False: 957]
  |  Branch (177:76): [True: 2.52k, False: 958]
  |  Branch (177:93): [True: 216, False: 2.30k]
  ------------------
  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|    216|                     const char first = *line;
  182|    216|                     const bool explicit_or_structural_start =
  183|    216|                        (first == ':' || first == '?' || first == '!' || first == '&' || first == '*' || first == '[' ||
  ------------------
  |  Branch (183:26): [True: 14, False: 202]
  |  Branch (183:42): [True: 4, False: 198]
  |  Branch (183:58): [True: 7, False: 191]
  |  Branch (183:74): [True: 5, False: 186]
  |  Branch (183:90): [True: 9, False: 177]
  |  Branch (183:106): [True: 7, False: 170]
  ------------------
  184|    170|                         first == '{' || first == '"' || first == '\'' || first == '-');
  ------------------
  |  Branch (184:26): [True: 3, False: 167]
  |  Branch (184:42): [True: 4, False: 163]
  |  Branch (184:58): [True: 5, False: 158]
  |  Branch (184:75): [True: 14, False: 144]
  ------------------
  185|    216|                     if (!explicit_or_structural_start) {
  ------------------
  |  Branch (185:26): [True: 144, False: 72]
  ------------------
  186|    144|                        auto scan = line;
  187|  3.40k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (187:32): [True: 3.32k, False: 78]
  |  Branch (187:47): [True: 3.31k, False: 11]
  |  Branch (187:64): [True: 3.30k, False: 11]
  ------------------
  188|  3.30k|                           if (*scan == ':') {
  ------------------
  |  Branch (188:32): [True: 676, False: 2.63k]
  ------------------
  189|    676|                              auto after = scan + 1;
  190|    676|                              if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (190:35): [True: 9, False: 667]
  |  Branch (190:51): [True: 13, False: 654]
  |  Branch (190:68): [True: 6, False: 648]
  |  Branch (190:86): [True: 7, False: 641]
  |  Branch (190:104): [True: 9, False: 632]
  ------------------
  191|     44|                                 ctx.error = error_code::syntax_error;
  192|     44|                                 return;
  193|     44|                              }
  194|    676|                           }
  195|  3.26k|                           ++scan;
  196|  3.26k|                        }
  197|    144|                     }
  198|    172|                     return;
  199|    216|                  }
  200|  16.9k|                  if (line == end) {
  ------------------
  |  Branch (200:23): [True: 64, False: 16.8k]
  ------------------
  201|     64|                     return;
  202|     64|                  }
  203|  16.8k|                  if (*line == ':' || *line == '?') {
  ------------------
  |  Branch (203:23): [True: 49, False: 16.8k]
  |  Branch (203:39): [True: 26, False: 16.7k]
  ------------------
  204|     75|                     return; // Explicit key/value continuation.
  205|     75|                  }
  206|  16.7k|                  if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (206:23): [True: 6.97k, False: 9.81k]
  |  Branch (206:40): [True: 4.34k, False: 5.47k]
  ------------------
  207|  11.3k|                     tail_scan = line;
  208|  11.3k|                     yaml::skip_newline(tail_scan, end);
  209|  11.3k|                     continue;
  210|  11.3k|                  }
  211|  5.47k|                  if (*line == '#') {
  ------------------
  |  Branch (211:23): [True: 3.83k, False: 1.64k]
  ------------------
  212|  56.8k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (212:29): [True: 56.7k, False: 169]
  |  Branch (212:49): [True: 55.2k, False: 1.43k]
  |  Branch (212:71): [True: 53.0k, False: 2.22k]
  ------------------
  213|  3.83k|                     yaml::skip_newline(tail_scan, end);
  214|  3.83k|                     continue;
  215|  3.83k|                  }
  216|  1.64k|                  if (yaml::at_document_end(line, end)) {
  ------------------
  |  Branch (216:23): [True: 779, False: 867]
  ------------------
  217|    779|                     seen_document_end_marker = true;
  218|  9.59k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (218:29): [True: 9.50k, False: 94]
  |  Branch (218:49): [True: 9.30k, False: 199]
  |  Branch (218:71): [True: 8.81k, False: 486]
  ------------------
  219|    779|                     yaml::skip_newline(tail_scan, end);
  220|    779|                     continue;
  221|    779|                  }
  222|    867|                  if (is_document_start(line)) {
  ------------------
  |  Branch (222:23): [True: 206, False: 661]
  ------------------
  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|    206|                     auto header = line + 3;
  228|  1.49k|                     while (header != end && (*header == ' ' || *header == '\t')) ++header;
  ------------------
  |  Branch (228:29): [True: 1.48k, False: 15]
  |  Branch (228:47): [True: 653, False: 830]
  |  Branch (228:65): [True: 639, False: 191]
  ------------------
  229|    206|                     if (header != end && *header == '!') {
  ------------------
  |  Branch (229:26): [True: 191, False: 15]
  |  Branch (229:43): [True: 72, False: 119]
  ------------------
  230|     72|                        auto tag_end = header + 1;
  231|  91.9k|                        while (tag_end != end && *tag_end != ' ' && *tag_end != '\t' && *tag_end != '\n' &&
  ------------------
  |  Branch (231:32): [True: 91.9k, False: 17]
  |  Branch (231:50): [True: 91.9k, False: 25]
  |  Branch (231:69): [True: 91.9k, False: 17]
  |  Branch (231:89): [True: 91.9k, False: 5]
  ------------------
  232|  91.9k|                               *tag_end != '\r' && *tag_end != '#') {
  ------------------
  |  Branch (232:32): [True: 91.9k, False: 3]
  |  Branch (232:52): [True: 91.9k, False: 5]
  ------------------
  233|  91.9k|                           ++tag_end;
  234|  91.9k|                        }
  235|     72|                        std::string_view tag_token(header, static_cast<size_t>(tag_end - header));
  236|     72|                        const auto second_bang = tag_token.find('!', 1);
  237|     72|                        if (second_bang != std::string_view::npos) {
  ------------------
  |  Branch (237:29): [True: 40, False: 32]
  ------------------
  238|     40|                           std::string_view handle = tag_token.substr(0, second_bang + 1);
  239|     40|                           if (handle != "!" && handle != "!!") {
  ------------------
  |  Branch (239:32): [True: 40, False: 0]
  |  Branch (239:49): [True: 37, False: 3]
  ------------------
  240|     37|                              ctx.error = error_code::syntax_error;
  241|     37|                              return;
  242|     37|                           }
  243|     40|                        }
  244|     72|                     }
  245|    169|                     return; // Additional documents are allowed in the stream tail.
  246|    206|                  }
  247|    661|                  if (line != end && *line == '%') {
  ------------------
  |  Branch (247:23): [True: 661, False: 0]
  |  Branch (247:38): [True: 22, False: 639]
  ------------------
  248|       |                     // YAML directives are only valid in document prefixes. A directive
  249|       |                     // encountered mid-document (without a prior ...) is malformed.
  250|     22|                     if (!seen_document_end_marker) {
  ------------------
  |  Branch (250:26): [True: 15, False: 7]
  ------------------
  251|     15|                        ctx.error = error_code::syntax_error;
  252|     15|                        return;
  253|     15|                     }
  254|      7|                     return;
  255|     22|                  }
  256|    639|                  if (seen_document_end_marker) {
  ------------------
  |  Branch (256:23): [True: 88, False: 551]
  ------------------
  257|     88|                     return; // Implicit next document after explicit document end marker.
  258|     88|                  }
  259|    551|                  ctx.error = error_code::syntax_error;
  260|    551|                  return;
  261|    639|               }
  262|  11.1k|            }
  263|  65.1k|         }
  264|  65.1k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|   974k|      {
  275|   974k|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|   974k|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|   974k|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|   974k|      }
_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_:
 5635|  1.26M|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|  1.26M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|  1.26M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|  1.26M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|  1.26M|                       "the internally tagged shape, so it is rejected here instead.");
 5642|  1.26M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 1.26M]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|  1.26M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|  1.26M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 73, False: 1.26M]
  ------------------
 5650|     73|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|  1.26M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 176k, False: 1.08M]
  ------------------
 5655|   176k|            yaml::skip_ws_newlines_comments(it, end);
 5656|   176k|         }
 5657|  1.08M|         else {
 5658|  1.08M|            yaml::skip_inline_ws(it, end);
 5659|  1.08M|         }
 5660|       |
 5661|  1.26M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 101, False: 1.26M]
  ------------------
 5662|    101|            ctx.error = error_code::unexpected_end;
 5663|    101|            return;
 5664|    101|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|  1.26M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|  1.26M|            using V = std::remove_cvref_t<T>;
 5772|  1.26M|            using counts = yaml_variant_type_count<V>;
 5773|  1.26M|            const char c = *it;
 5774|  1.26M|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  1.26M|               switch (ch) {
 5776|  1.26M|               case ' ':
 5777|  1.26M|               case '\t':
 5778|  1.26M|               case '\n':
 5779|  1.26M|               case '\r':
 5780|  1.26M|               case ',':
 5781|  1.26M|               case ']':
 5782|  1.26M|               case '}':
 5783|  1.26M|                  return true;
 5784|  1.26M|               default:
 5785|  1.26M|                  return false;
 5786|  1.26M|               }
 5787|  1.26M|            };
 5788|       |
 5789|  1.26M|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  1.26M|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  1.26M|                  return false;
 5792|  1.26M|               }
 5793|  1.26M|               if (ctx.current_indent() < 0) {
 5794|  1.26M|                  return false;
 5795|  1.26M|               }
 5796|  1.26M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|  1.26M|                  return false;
 5798|  1.26M|               }
 5799|       |
 5800|  1.26M|               auto look = word_end;
 5801|  1.26M|               yaml::skip_newline(look, end);
 5802|  1.26M|               while (look != end) {
 5803|  1.26M|                  int32_t line_indent = 0;
 5804|  1.26M|                  while (look != end && *look == ' ') {
 5805|  1.26M|                     ++line_indent;
 5806|  1.26M|                     ++look;
 5807|  1.26M|                  }
 5808|  1.26M|                  if (look != end && *look == '\t') {
 5809|  1.26M|                     return false;
 5810|  1.26M|                  }
 5811|  1.26M|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|  1.26M|                     if (look != end) {
 5813|  1.26M|                        yaml::skip_newline(look, end);
 5814|  1.26M|                        continue;
 5815|  1.26M|                     }
 5816|  1.26M|                     return false;
 5817|  1.26M|                  }
 5818|  1.26M|                  if (*look == '#') {
 5819|  1.26M|                     yaml::skip_comment(look, end);
 5820|  1.26M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|  1.26M|                        yaml::skip_newline(look, end);
 5822|  1.26M|                        continue;
 5823|  1.26M|                     }
 5824|  1.26M|                     return false;
 5825|  1.26M|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  1.26M|                  {
 5831|  1.26M|                     auto scan = look;
 5832|  1.26M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|  1.26M|                        if (*scan == ':') {
 5834|  1.26M|                           auto after_colon = scan + 1;
 5835|  1.26M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|  1.26M|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|  1.26M|                              return false;
 5838|  1.26M|                           }
 5839|  1.26M|                        }
 5840|  1.26M|                        ++scan;
 5841|  1.26M|                     }
 5842|  1.26M|                  }
 5843|       |
 5844|  1.26M|                  return line_indent > ctx.current_indent();
 5845|  1.26M|               }
 5846|  1.26M|               return false;
 5847|  1.26M|            };
 5848|  1.26M|            auto is_word_boundary = [&](const auto ptr) {
 5849|  1.26M|               if (ptr == end) {
 5850|  1.26M|                  return true;
 5851|  1.26M|               }
 5852|  1.26M|               if (*ptr == ':') {
 5853|  1.26M|                  auto next = ptr + 1;
 5854|  1.26M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|  1.26M|               }
 5856|  1.26M|               return is_plain_scalar_boundary(*ptr);
 5857|  1.26M|            };
 5858|       |
 5859|  1.26M|            switch (c) {
 5860|   236k|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 236k, False: 1.02M]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|   236k|               ++it;
 5863|   236k|               auto aname = yaml::parse_anchor_name(it, end);
 5864|   236k|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 126, False: 236k]
  ------------------
 5865|    126|                  ctx.error = error_code::syntax_error;
 5866|    126|                  return;
 5867|    126|               }
 5868|   236k|               yaml::skip_inline_ws(it, end);
 5869|   236k|               bool anchor_on_same_line = true;
 5870|   236k|               bool value_is_indentless_sequence = false;
 5871|   236k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 6.51k, False: 229k]
  |  Branch (5871:33): [True: 40.0k, False: 189k]
  |  Branch (5871:48): [True: 17.8k, False: 172k]
  |  Branch (5871:63): [True: 5.05k, False: 166k]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|  69.4k|                  bool value_on_next_line = false;
 5875|  69.4k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 62.9k, False: 6.51k]
  ------------------
 5876|  62.9k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|  62.9k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 5.05k, False: 57.8k]
  ------------------
 5879|  2.93M|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 2.93M, False: 220]
  |  Branch (5879:47): [True: 2.92M, False: 1.97k]
  |  Branch (5879:64): [True: 2.92M, False: 2.86k]
  ------------------
 5880|  5.05k|                     }
 5881|       |                     // Skip newline
 5882|  62.9k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 62.7k, False: 220]
  |  Branch (5882:42): [True: 41.9k, False: 20.7k]
  |  Branch (5882:59): [True: 20.7k, False: 0]
  ------------------
 5883|  62.7k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|  90.7k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 85.7k, False: 4.92k]
  |  Branch (5885:48): [True: 2.07k, False: 83.7k]
  |  Branch (5885:65): [True: 25.9k, False: 57.7k]
  ------------------
 5886|  28.0k|                           yaml::skip_newline(peek, end);
 5887|  28.0k|                        }
 5888|       |                        // Measure indent of next content line
 5889|  62.7k|                        int32_t next_indent = 0;
 5890|  91.6k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 86.4k, False: 5.27k]
  |  Branch (5890:47): [True: 28.9k, False: 57.4k]
  ------------------
 5891|  28.9k|                           ++next_indent;
 5892|  28.9k|                           ++peek;
 5893|  28.9k|                        }
 5894|  62.7k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 57.4k, False: 5.27k]
  |  Branch (5894:44): [True: 56.6k, False: 810]
  |  Branch (5894:61): [True: 56.0k, False: 540]
  ------------------
 5895|  56.0k|                           const bool indentless_sequence =
 5896|  56.0k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 47.7k, False: 8.28k]
  |  Branch (5896:69): [True: 34.5k, False: 13.2k]
  ------------------
 5897|  34.5k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 69, False: 34.4k]
  ------------------
 5898|  34.4k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 33.9k, False: 501]
  ------------------
 5899|  34.0k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 29.6k, False: 4.39k]
  ------------------
 5900|  4.39k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 2.10k, False: 2.29k]
  |  Branch (5900:61): [True: 1.40k, False: 706]
  ------------------
 5901|  56.0k|                           value_is_indentless_sequence = indentless_sequence;
 5902|  56.0k|                           const bool same_indent_property_node =
 5903|  56.0k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 36.5k, False: 19.5k]
  ------------------
 5904|  36.5k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 963, False: 35.5k]
  |  Branch (5904:48): [True: 3.48k, False: 32.1k]
  |  Branch (5904:64): [True: 32, False: 32.0k]
  |  Branch (5904:80): [True: 581, False: 31.4k]
  |  Branch (5904:96): [True: 21, False: 31.4k]
  ------------------
 5905|  31.4k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 3, False: 31.4k]
  |  Branch (5905:48): [True: 17, False: 31.4k]
  |  Branch (5905:65): [True: 573, False: 30.8k]
  |  Branch (5905:81): [True: 61, False: 30.8k]
  ------------------
 5906|  56.0k|                           value_on_next_line =
 5907|  56.0k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 14.7k, False: 41.2k]
  |  Branch (5907:71): [True: 31.0k, False: 10.2k]
  |  Branch (5907:94): [True: 5.73k, False: 4.51k]
  ------------------
 5908|  56.0k|                        }
 5909|  62.7k|                     }
 5910|  62.9k|                  }
 5911|  69.4k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 17.8k, False: 51.5k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  17.8k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  17.8k|                     return;
 5915|  17.8k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|  51.5k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 3.10k, False: 48.4k]
  ------------------
 5918|  2.86M|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 2.86M, False: 0]
  |  Branch (5918:42): [True: 2.86M, False: 1.12k]
  |  Branch (5918:57): [True: 2.86M, False: 1.97k]
  ------------------
 5919|  3.10k|                  }
 5920|  51.5k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 51.5k, False: 0]
  ------------------
 5921|  59.7k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 59.7k, False: 0]
  |  Branch (5921:40): [True: 1.49k, False: 58.2k]
  |  Branch (5921:55): [True: 6.69k, False: 51.5k]
  ------------------
 5922|  8.18k|                     yaml::skip_newline(it, end);
 5923|  8.18k|                  }
 5924|  51.5k|                  yaml::skip_inline_ws(it, end);
 5925|  51.5k|                  anchor_on_same_line = false;
 5926|  51.5k|               }
 5927|       |
 5928|   218k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|   218k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (5929:23): [True: 166k, False: 51.5k]
  |  Branch (5929:46): [True: 1.02k, False: 165k]
  ------------------
 5930|  1.02k|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (5930:24): [True: 12, False: 1.01k]
  |  Branch (5930:43): [True: 15, False: 999]
  ------------------
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|     27|                     ctx.error = error_code::syntax_error;
 5933|     27|                     return;
 5934|     27|                  }
 5935|   218k|               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|   218k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 218k, False: 41]
  |  Branch (5939:33): [True: 3.31k, False: 215k]
  |  Branch (5939:47): [True: 187, False: 3.12k]
  ------------------
 5940|    187|                  ctx.error = error_code::syntax_error;
 5941|    187|                  return;
 5942|    187|               }
 5943|       |
 5944|   218k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|   218k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (5945:23): [True: 51.5k, False: 166k]
  |  Branch (5945:47): [True: 51.5k, False: 14]
  |  Branch (5945:60): [True: 4.90k, False: 46.6k]
  ------------------
 5946|  4.90k|                     auto probe = it + 1;
 5947|  4.90k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|  4.90k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (5948:26): [True: 22, False: 4.88k]
  ------------------
 5949|     22|                        ctx.error = error_code::syntax_error;
 5950|     22|                        return;
 5951|     22|                     }
 5952|  4.88k|                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|  4.88k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (5956:26): [True: 100, False: 4.78k]
  ------------------
 5957|    100|                        ctx.error = error_code::syntax_error;
 5958|    100|                        return;
 5959|    100|                     }
 5960|  4.88k|                  }
 5961|   218k|               }
 5962|       |
 5963|   218k|               const char* anchor_start = &*it;
 5964|   218k|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|   218k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|   218k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (5970:23): [True: 166k, False: 51.5k]
  |  Branch (5970:46): [True: 64.2k, False: 102k]
  ------------------
 5971|  64.2k|                     auto key_start = it;
 5972|  64.2k|                     if (*key_start == '!') {
  ------------------
  |  Branch (5972:26): [True: 1.80k, False: 62.4k]
  ------------------
 5973|  1.80k|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|  1.80k|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (5974:29): [True: 11, False: 1.79k]
  |  Branch (5974:67): [True: 13, False: 1.78k]
  ------------------
 5975|     24|                           ctx.error = error_code::syntax_error;
 5976|     24|                           return;
 5977|     24|                        }
 5978|  1.78k|                        yaml::skip_inline_ws(key_start, end);
 5979|  1.78k|                        if (key_start == end) {
  ------------------
  |  Branch (5979:29): [True: 1, False: 1.78k]
  ------------------
 5980|      1|                           ctx.error = error_code::unexpected_end;
 5981|      1|                           return;
 5982|      1|                        }
 5983|  1.78k|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (5983:29): [True: 2, False: 1.78k]
  |  Branch (5983:51): [True: 2, False: 1.77k]
  ------------------
 5984|      4|                           ctx.error = error_code::syntax_error;
 5985|      4|                           return;
 5986|      4|                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|  1.77k|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (5992:29): [True: 655, False: 1.12k]
  |  Branch (5992:50): [True: 5, False: 650]
  ------------------
 5993|      5|                           ctx.error = error_code::syntax_error;
 5994|      5|                           return;
 5995|      5|                        }
 5996|  1.77k|                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|  64.2k|                     auto key_scan = key_start;
 6000|  64.2k|                     auto key_end = key_start;
 6001|  64.2k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6001:26): [True: 665, False: 63.5k]
  |  Branch (6001:46): [True: 386, False: 63.1k]
  ------------------
 6002|       |                        // Quoted key: skip to closing quote
 6003|  1.05k|                        const char quote = *key_scan;
 6004|  1.05k|                        ++key_scan;
 6005|  7.66k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6005:32): [True: 7.66k, False: 4]
  |  Branch (6005:51): [True: 6.61k, False: 1.04k]
  ------------------
 6006|  6.61k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6006:32): [True: 1.16k, False: 5.44k]
  |  Branch (6006:53): [True: 561, False: 607]
  ------------------
 6007|    561|                              ++key_scan;
 6008|    561|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6008:35): [True: 561, False: 0]
  ------------------
 6009|    561|                           }
 6010|  6.05k|                           else {
 6011|  6.05k|                              ++key_scan;
 6012|  6.05k|                           }
 6013|  6.61k|                        }
 6014|  1.05k|                        if (key_scan == end) {
  ------------------
  |  Branch (6014:29): [True: 4, False: 1.04k]
  ------------------
 6015|      4|                           ctx.error = error_code::syntax_error;
 6016|      4|                           return;
 6017|      4|                        }
 6018|  1.04k|                        ++key_scan; // past closing quote
 6019|  1.04k|                        key_end = key_scan;
 6020|  1.04k|                        yaml::skip_inline_ws(key_scan, end);
 6021|  1.04k|                     }
 6022|  63.1k|                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|  2.59M|                        while (key_scan != end) {
  ------------------
  |  Branch (6024:32): [True: 2.59M, False: 3]
  ------------------
 6025|  2.59M|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6025:32): [True: 127k, False: 2.46M]
  ------------------
 6026|   127k|                              auto next = key_scan + 1;
 6027|   127k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6027:35): [True: 2.00k, False: 125k]
  |  Branch (6027:50): [True: 44.8k, False: 80.6k]
  |  Branch (6027:66): [True: 3.37k, False: 77.3k]
  |  Branch (6027:83): [True: 3.21k, False: 74.0k]
  |  Branch (6027:100): [True: 9.76k, False: 64.3k]
  ------------------
 6028|  63.1k|                                 break;
 6029|  63.1k|                              }
 6030|   127k|                           }
 6031|  2.53M|                           ++key_scan;
 6032|  2.53M|                        }
 6033|  63.1k|                        key_end = key_scan;
 6034|  75.4k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6034:32): [True: 71.7k, False: 3.74k]
  |  Branch (6034:57): [True: 11.3k, False: 60.3k]
  |  Branch (6034:82): [True: 928, False: 59.4k]
  ------------------
 6035|  12.2k|                           --key_end;
 6036|  12.2k|                        }
 6037|  63.1k|                     }
 6038|  64.2k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6038:26): [True: 4, False: 64.2k]
  |  Branch (6038:45): [True: 93, False: 64.1k]
  ------------------
 6039|     97|                        ctx.error = error_code::syntax_error;
 6040|     97|                        return;
 6041|     97|                     }
 6042|       |                     // Store anchor with just the key text span
 6043|  64.1k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|  64.1k|                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|  64.1k|                     if constexpr (counts::n_object > 0) {
 6047|  64.1k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|  64.1k|                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|  64.1k|                     return;
 6054|  64.2k|                  }
 6055|   218k|               }
 6056|       |
 6057|   154k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|   218k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|   218k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|   218k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|   218k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 149k, False: 69.1k]
  ------------------
 6062|   149k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|   149k|               }
 6064|   218k|               return;
 6065|   218k|            }
 6066|  88.7k|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 88.7k, False: 1.17M]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|  88.7k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|  88.7k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6069:23): [True: 6.04k, False: 82.7k]
  ------------------
 6070|  6.04k|                     if constexpr (counts::n_object > 0) {
 6071|  6.04k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|  6.04k|                                                                                                        end);
 6073|  6.04k|                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|  6.04k|                  }
 6080|  88.7k|               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|  88.7k|               return;
 6085|   218k|            }
 6086|  91.1k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 91.1k, False: 1.16M]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|  91.1k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|  91.1k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 126, False: 90.9k]
  ------------------
 6090|    126|                  ctx.error = error_code::syntax_error;
 6091|    126|                  return;
 6092|    126|               }
 6093|  90.9k|               yaml::skip_inline_ws(it, end);
 6094|  90.9k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 90.3k, False: 629]
  |  Branch (6094:33): [True: 4.51k, False: 85.8k]
  ------------------
 6095|  4.51k|                  yaml::skip_comment(it, end);
 6096|  4.51k|               }
 6097|  90.9k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 90.2k, False: 710]
  |  Branch (6097:34): [True: 3.34k, False: 86.9k]
  |  Branch (6097:49): [True: 10.0k, False: 76.8k]
  ------------------
 6098|  13.4k|                  auto content = it;
 6099|  13.4k|                  yaml::skip_newline(content, end);
 6100|  13.4k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  13.4k|                  bool consume_following_content = false;
 6103|  13.4k|                  auto content_token = content;
 6104|  13.4k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 12.8k, False: 604]
  ------------------
 6105|  12.8k|                     auto indent_probe = content;
 6106|  12.8k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  12.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 6, False: 12.7k]
  ------------------
 6108|      6|                        return;
 6109|  12.7k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  12.7k|                     bool tagged_indentless_sequence = false;
 6114|  12.7k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 4.86k, False: 7.93k]
  |  Branch (6114:56): [True: 4.86k, False: 0]
  |  Branch (6114:79): [True: 4.73k, False: 124]
  ------------------
 6115|  4.73k|                        const auto after_dash = indent_probe + 1;
 6116|  4.73k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 11, False: 4.72k]
  ------------------
 6117|  4.72k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 4.12k, False: 605]
  ------------------
 6118|  4.13k|                           tagged_indentless_sequence =
 6119|  4.13k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 886, False: 3.24k]
  ------------------
 6120|  3.24k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 857, False: 2.38k]
  |  Branch (6120:60): [True: 818, False: 39]
  ------------------
 6121|  4.13k|                        }
 6122|  4.73k|                     }
 6123|       |
 6124|  12.7k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 2.52k, False: 10.2k]
  ------------------
 6125|  10.2k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 4.07k, False: 6.19k]
  |  Branch (6125:93): [True: 1.70k, False: 4.48k]
  ------------------
 6126|  12.7k|                  }
 6127|       |
 6128|  13.3k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 8.30k, False: 5.09k]
  ------------------
 6129|  8.30k|                     it = content_token;
 6130|  8.30k|                  }
 6131|  5.09k|                  else {
 6132|  5.09k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 86, False: 5.00k]
  ------------------
 6133|     86|                        if constexpr (counts::n_str > 0) {
 6134|     86|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|     86|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|     86|                           value = StrType{};
 6137|     86|                           return;
 6138|     86|                        }
 6139|     86|                     }
 6140|  5.09k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 54, False: 5.03k]
  ------------------
 6141|     54|                        if constexpr (counts::n_null > 0) {
 6142|     54|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|     54|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|     54|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 54]
  ------------------
 6145|     54|                           return;
 6146|     54|                        }
 6147|     54|                     }
 6148|  5.09k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 4.31k, False: 776]
  ------------------
 6149|  4.31k|                        if constexpr (counts::n_null > 0) {
 6150|  4.31k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  4.31k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  4.31k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 4.31k]
  ------------------
 6153|  4.31k|                           return;
 6154|  4.31k|                        }
 6155|  4.31k|                     }
 6156|  5.09k|                  }
 6157|  13.3k|               }
 6158|  90.9k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|  90.9k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6161:23): [True: 85.8k, False: 5.16k]
  |  Branch (6161:36): [True: 24, False: 85.7k]
  ------------------
 6162|     24|                     ctx.error = error_code::syntax_error;
 6163|     24|                     return;
 6164|     24|                  }
 6165|  90.9k|                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|  90.9k|                     const bool starts_block_sequence_entry =
 6168|  90.9k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6168:26): [True: 85.7k, False: 5.16k]
  |  Branch (6168:39): [True: 6.50k, False: 79.2k]
  ------------------
 6169|  6.50k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6169:26): [True: 182, False: 6.32k]
  |  Branch (6169:45): [True: 5.36k, False: 957]
  ------------------
 6170|  90.9k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6170:26): [True: 80.9k, False: 10.0k]
  |  Branch (6170:58): [True: 6.23k, False: 74.7k]
  ------------------
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|  6.23k|                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|  6.23k|                        return;
 6175|  6.23k|                     }
 6176|  90.9k|                  }
 6177|  90.9k|               }
 6178|  90.9k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 710, False: 90.2k]
  ------------------
 6179|    710|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 203, False: 507]
  ------------------
 6180|    203|                     if constexpr (counts::n_str > 0) {
 6181|    203|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    203|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    203|                        value = StrType{};
 6184|    203|                        return;
 6185|    203|                     }
 6186|    203|                  }
 6187|    710|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 496, False: 214]
  ------------------
 6188|    496|                     if constexpr (counts::n_null > 0) {
 6189|    496|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|    496|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|    496|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 496]
  ------------------
 6192|    496|                        return;
 6193|    496|                     }
 6194|    496|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|    710|                  return;
 6197|    710|               }
 6198|  90.2k|               switch (tag) {
 6199|    581|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 581, False: 89.6k]
  ------------------
 6200|    581|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|    581|                  return;
 6202|  1.79k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 1.79k, False: 88.4k]
  ------------------
 6203|  1.81k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 13, False: 90.2k]
  ------------------
 6204|  1.81k|                  if constexpr (counts::n_num > 0) {
 6205|  1.81k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  1.81k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  6.25k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 4.44k, False: 85.8k]
  ------------------
 6213|  6.25k|                  if constexpr (counts::n_bool > 0) {
 6214|  6.25k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  6.25k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  6.61k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 358, False: 89.9k]
  ------------------
 6222|  6.61k|                  if constexpr (counts::n_null > 0) {
 6223|  6.61k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  6.61k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  6.61k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 6.61k]
  ------------------
 6226|  6.61k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  6.61k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  9.13k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 2.52k, False: 87.7k]
  ------------------
 6234|  9.13k|                  if constexpr (counts::n_object > 0) {
 6235|  9.13k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  9.13k|                                                                                                     end);
 6237|  9.13k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|  18.0k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 8.95k, False: 81.3k]
  ------------------
 6244|  18.0k|                  if constexpr (counts::n_array > 0) {
 6245|  18.0k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|  18.0k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|  18.0k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6247:29): [True: 8.95k, False: 9.13k]
  |  Branch (6247:42): [True: 4.55k, False: 4.39k]
  ------------------
 6248|  4.55k|                           ctx.allow_indentless_sequence = true;
 6249|  4.55k|                        }
 6250|  18.0k|                     }
 6251|  18.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|  18.0k|                                                                                                    end);
 6253|  18.0k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|  18.0k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|  78.9k|               default: {
  ------------------
  |  Branch (6260:16): [True: 60.8k, False: 29.3k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|  78.9k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 60.8k, False: 18.0k]
  |  Branch (6263:36): [True: 46.5k, False: 14.3k]
  ------------------
 6264|  46.5k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  46.5k|                     return;
 6266|  46.5k|                  }
 6267|       |
 6268|  32.4k|                  if constexpr (counts::n_array > 0) {
 6269|  32.4k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 14.3k, False: 18.0k]
  |  Branch (6269:39): [True: 152, False: 14.2k]
  ------------------
 6270|    152|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|    152|                                                                                                       end);
 6272|    152|                        return;
 6273|    152|                     }
 6274|  32.4k|                  }
 6275|  32.4k|                  if constexpr (counts::n_object > 0) {
 6276|  32.4k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 14.2k, False: 18.2k]
  |  Branch (6276:39): [True: 585, False: 13.6k]
  ------------------
 6277|    585|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|    585|                                                                                                        end);
 6279|    585|                        return;
 6280|    585|                     }
 6281|  32.4k|                  }
 6282|       |
 6283|  32.4k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|  32.4k|                     if constexpr (counts::n_array > 0) {
 6285|  32.4k|                        const bool starts_block_sequence_entry =
 6286|  32.4k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6286:29): [True: 13.6k, False: 18.8k]
  |  Branch (6286:42): [True: 825, False: 12.8k]
  ------------------
 6287|    825|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6287:29): [True: 159, False: 666]
  |  Branch (6287:48): [True: 325, False: 341]
  ------------------
 6288|  32.4k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6288:29): [True: 484, False: 31.9k]
  ------------------
 6289|    484|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|    484|                                                                                                          it, end);
 6291|    484|                           return;
 6292|    484|                        }
 6293|  32.4k|                     }
 6294|  32.4k|                     if constexpr (counts::n_object > 0) {
 6295|  32.4k|                        const bool starts_explicit_mapping_indicator =
 6296|  32.4k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6296:29): [True: 13.1k, False: 19.3k]
  |  Branch (6296:43): [True: 1.99k, False: 11.1k]
  |  Branch (6296:57): [True: 500, False: 10.6k]
  ------------------
 6297|  2.49k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6297:29): [True: 640, False: 1.85k]
  |  Branch (6297:48): [True: 1.28k, False: 576]
  ------------------
 6298|  32.4k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6298:29): [True: 1.92k, False: 30.5k]
  ------------------
 6299|  1.92k|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|  1.92k|                                                                                                           it, end);
 6301|  1.92k|                           return;
 6302|  1.92k|                        }
 6303|  30.5k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6303:29): [True: 0, False: 30.5k]
  ------------------
 6304|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|      0|                                                                                                           it, end);
 6306|      0|                           return;
 6307|      0|                        }
 6308|  30.5k|                     }
 6309|  32.4k|                  }
 6310|       |
 6311|  32.4k|                  if constexpr (counts::n_str > 0) {
 6312|  32.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|  32.4k|                     return;
 6314|  32.4k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|  32.4k|                  return;
 6319|  78.9k|               }
 6320|  90.2k|               }
 6321|      0|               return;
 6322|  90.2k|            }
 6323|  48.5k|            case '{':
  ------------------
  |  Branch (6323:13): [True: 48.5k, False: 1.21M]
  ------------------
 6324|  48.5k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|  48.5k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6326:23): [True: 11.0k, False: 37.5k]
  |  Branch (6326:51): [True: 1.44k, False: 9.55k]
  ------------------
 6327|  1.44k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|  1.44k|                                                                                                     end);
 6329|  1.44k|                     return;
 6330|  1.44k|                  }
 6331|  48.5k|               }
 6332|       |               // Flow mapping - object type
 6333|  47.0k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|  48.5k|               return;
 6335|  52.1k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 52.1k, False: 1.20M]
  ------------------
 6336|  52.1k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|  52.1k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6338:23): [True: 33.6k, False: 18.4k]
  |  Branch (6338:51): [True: 506, False: 33.1k]
  ------------------
 6339|    506|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|    506|                                                                                                     end);
 6341|    506|                     return;
 6342|    506|                  }
 6343|  52.1k|               }
 6344|       |               // Flow sequence - array type
 6345|  51.6k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|  52.1k|               return;
 6347|   236k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 236k, False: 1.02M]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   236k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 236k, False: 404]
  |  Branch (6349:39): [True: 10, False: 236k]
  ------------------
 6350|     10|                  ctx.error = error_code::syntax_error;
 6351|     10|                  return;
 6352|     10|               }
 6353|   236k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 236k, False: 404]
  |  Branch (6353:40): [True: 76.6k, False: 159k]
  |  Branch (6353:56): [True: 143k, False: 16.6k]
  |  Branch (6353:73): [True: 10.1k, False: 6.43k]
  ------------------
 6354|   230k|                  if constexpr (counts::n_object > 0) {
 6355|   230k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   230k|                                                                                                     end);
 6357|   230k|                     return;
 6358|   230k|                  }
 6359|   230k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   236k|               return;
 6362|     20|            case '%':
  ------------------
  |  Branch (6362:13): [True: 20, False: 1.26M]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|     20|               ctx.error = error_code::syntax_error;
 6365|     20|               return;
 6366|  1.10k|            case '"':
  ------------------
  |  Branch (6366:13): [True: 1.10k, False: 1.25M]
  ------------------
 6367|  3.61k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 2.50k, False: 1.25M]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  3.61k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  3.61k|               return;
 6372|  12.4k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 12.4k, False: 1.24M]
  ------------------
 6373|  30.7k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 18.3k, False: 1.24M]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  30.7k|               if constexpr (counts::n_bool > 0) {
 6376|  30.7k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 29.9k, False: 888]
  |  Branch (6376:44): [True: 23.8k, False: 6.08k]
  |  Branch (6376:60): [True: 22.6k, False: 1.19k]
  |  Branch (6376:76): [True: 20.3k, False: 2.31k]
  ------------------
 6377|  20.3k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 3.43k, False: 6.16k]
  |  Branch (6377:60): [True: 2.40k, False: 1.02k]
  |  Branch (6377:76): [True: 42, False: 2.36k]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  20.3k|                     const auto after_true = it + 4;
 6380|  20.3k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  20.3k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 19.2k, False: 1.06k]
  ------------------
 6383|  19.2k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 140, False: 19.1k]
  ------------------
 6384|    140|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|    140|                           return;
 6386|    140|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  19.1k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 18.9k, False: 176]
  |  Branch (6389:47): [True: 13.6k, False: 5.28k]
  ------------------
 6390|  13.6k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 684, False: 13.0k]
  |  Branch (6390:47): [True: 12.8k, False: 170]
  |  Branch (6390:63): [True: 37, False: 133]
  |  Branch (6390:80): [True: 48, False: 85]
  |  Branch (6390:97): [True: 85, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  13.6k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  13.6k|                           return;
 6394|  13.6k|                        }
 6395|  5.45k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  5.45k|                                                                                                      end);
 6397|  5.45k|                        return;
 6398|  19.1k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  20.3k|                  }
 6401|  30.7k|               }
 6402|  11.5k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  30.7k|               return;
 6404|  11.3k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 11.3k, False: 1.24M]
  ------------------
 6405|  20.1k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 8.77k, False: 1.25M]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|  20.1k|               if constexpr (counts::n_bool > 0) {
 6408|  20.1k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 19.4k, False: 662]
  |  Branch (6408:44): [True: 11.8k, False: 7.59k]
  |  Branch (6408:60): [True: 5.69k, False: 6.18k]
  |  Branch (6408:76): [True: 5.35k, False: 348]
  |  Branch (6408:92): [True: 4.68k, False: 662]
  ------------------
 6409|  14.7k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 3.04k, False: 11.7k]
  |  Branch (6409:60): [True: 2.43k, False: 610]
  |  Branch (6409:76): [True: 1.80k, False: 632]
  |  Branch (6409:92): [True: 1.73k, False: 66]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  6.42k|                     const auto after_false = it + 5;
 6412|  6.42k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  6.42k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 5.40k, False: 1.02k]
  ------------------
 6415|  5.40k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 313, False: 5.08k]
  ------------------
 6416|    313|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|    313|                           return;
 6418|    313|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  5.08k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 4.83k, False: 251]
  |  Branch (6421:47): [True: 3.19k, False: 1.64k]
  ------------------
 6422|  3.19k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 57, False: 3.13k]
  |  Branch (6422:47): [True: 558, False: 2.57k]
  |  Branch (6422:63): [True: 1.70k, False: 875]
  |  Branch (6422:80): [True: 159, False: 716]
  |  Branch (6422:97): [True: 716, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  3.19k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  3.19k|                           return;
 6426|  3.19k|                        }
 6427|  1.89k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  1.89k|                                                                                                      end);
 6429|  1.89k|                        return;
 6430|  5.08k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  6.42k|                  }
 6433|  20.1k|               }
 6434|  14.7k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|  20.1k|               return;
 6436|  10.2k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 10.2k, False: 1.25M]
  ------------------
 6437|  13.3k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 3.16k, False: 1.25M]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  13.3k|               if constexpr (counts::n_null > 0) {
 6440|  13.3k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 11.8k, False: 1.57k]
  |  Branch (6440:44): [True: 6.86k, False: 4.95k]
  |  Branch (6440:60): [True: 5.56k, False: 1.29k]
  |  Branch (6440:76): [True: 4.87k, False: 691]
  ------------------
 6441|  6.94k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 3.55k, False: 3.39k]
  |  Branch (6441:60): [True: 2.55k, False: 1.00k]
  |  Branch (6441:76): [True: 206, False: 2.35k]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  5.07k|                     const auto after_null = it + 4;
 6444|  5.07k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  5.07k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 4.76k, False: 314]
  ------------------
 6447|  4.76k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 273, False: 4.49k]
  ------------------
 6448|    273|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|    273|                           return;
 6450|    273|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  4.49k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 4.18k, False: 308]
  |  Branch (6453:47): [True: 2.75k, False: 1.43k]
  ------------------
 6454|  2.75k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 586, False: 2.16k]
  |  Branch (6454:47): [True: 598, False: 1.56k]
  |  Branch (6454:63): [True: 364, False: 1.20k]
  |  Branch (6454:80): [True: 1.05k, False: 144]
  |  Branch (6454:97): [True: 144, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  2.75k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  2.75k|                           return;
 6458|  2.75k|                        }
 6459|  1.74k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  1.74k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  1.74k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 1.74k]
  ------------------
 6462|  1.74k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  1.74k|                        return;
 6464|  4.49k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  5.07k|                  }
 6467|  13.3k|               }
 6468|  8.62k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  13.3k|               return;
 6470|    767|            case '~':
  ------------------
  |  Branch (6470:13): [True: 767, False: 1.26M]
  ------------------
 6471|       |               // Null indicator
 6472|    767|               if constexpr (counts::n_null > 0) {
 6473|    767|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|    767|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|    767|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 767]
  ------------------
 6476|    767|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|    767|                  return;
 6478|    767|               }
 6479|      0|               break; // Fall through to try other types
 6480|  96.9k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 96.9k, False: 1.16M]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|  96.9k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 327, False: 96.5k]
  |  Branch (6482:41): [True: 85.9k, False: 10.6k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|  86.2k|                  if constexpr (counts::n_array > 0) {
 6485|  86.2k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|  86.2k|                                                                                                    end);
 6487|  86.2k|                     return;
 6488|  86.2k|                  }
 6489|  86.2k|               }
 6490|  96.9k|               if constexpr (counts::n_num > 0) {
 6491|  96.9k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 10.6k, False: 86.2k]
  |  Branch (6491:43): [True: 1.15k, False: 9.45k]
  |  Branch (6491:94): [True: 770, False: 8.68k]
  ------------------
 6492|  1.92k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|  1.92k|                     return;
 6494|  1.92k|                  }
 6495|  96.9k|               }
 6496|  94.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|  96.9k|               return;
 6498|  4.01k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 4.01k, False: 1.25M]
  ------------------
 6499|  14.0k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 10.0k, False: 1.25M]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  14.0k|               if constexpr (counts::n_num > 0) {
 6503|  14.0k|                  auto start_it = it;
 6504|  14.0k|                  auto temp_ctx = ctx.make_speculative();
 6505|  14.0k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  14.0k|                                                                                               end);
 6507|  14.0k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  14.0k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  14.0k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 2.60k, False: 11.4k]
  ------------------
 6510|  2.60k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  2.60k|                     return; // Successfully parsed as number
 6512|  2.60k|                  }
 6513|  11.4k|                  it = start_it; // Restore and fall through to string
 6514|  11.4k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  14.0k|               return;
 6517|   327k|            default:
  ------------------
  |  Branch (6517:13): [True: 327k, False: 933k]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|   327k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 251k, False: 75.9k]
  |  Branch (6519:32): [True: 77.8k, False: 173k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|  77.8k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 52.5k, False: 25.3k]
  ------------------
 6522|  52.5k|                     return;
 6523|  52.5k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|  25.3k|                  if constexpr (counts::n_num > 0) {
 6526|  25.3k|                     auto start_it = it;
 6527|  25.3k|                     auto temp_ctx = ctx.make_speculative();
 6528|  25.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|  25.3k|                                                                                                  end);
 6530|  25.3k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|  25.3k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|  25.3k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 3.68k, False: 21.6k]
  ------------------
 6533|  3.68k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|  3.68k|                        return; // Successfully parsed as number
 6535|  3.68k|                     }
 6536|  21.6k|                     it = start_it; // Restore and fall through to string
 6537|  21.6k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|  25.3k|                  return;
 6541|  77.8k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   249k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   249k|               return;
 6545|  1.26M|            }
 6546|  1.26M|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|  1.26M|         error_code expansion_error{};
 6556|  1.26M|         std::string_view expansion_message{};
 6557|       |
 6558|  1.26M|         auto try_parse = [&]<size_t I>() -> bool {
 6559|  1.26M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|  1.26M|            auto start = it;
 6561|       |
 6562|  1.26M|            V v{};
 6563|  1.26M|            auto temp_ctx = ctx.make_speculative();
 6564|  1.26M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|  1.26M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|  1.26M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|  1.26M|            if (!bool(temp_ctx.error)) {
 6569|  1.26M|               value = std::move(v);
 6570|  1.26M|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|  1.26M|               return true;
 6572|  1.26M|            }
 6573|       |
 6574|  1.26M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|  1.26M|               expansion_error = temp_ctx.error;
 6576|  1.26M|               expansion_message = temp_ctx.custom_error_message;
 6577|  1.26M|            }
 6578|  1.26M|            it = start;
 6579|  1.26M|            return false;
 6580|  1.26M|         };
 6581|       |
 6582|  1.26M|         bool parsed = false;
 6583|  1.26M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|  1.26M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|  1.26M|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|  1.26M|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 1.26M]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|  1.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_:
 5205|   595k|      {
 5206|   595k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   595k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   595k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   595k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   595k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 595k, False: 0]
  ------------------
 5216|   595k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   595k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4515|   596k|      {
 4516|   596k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 596k]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|   596k|         yaml::node_preamble_state preamble{};
 4520|   596k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 1.61k, False: 594k]
  ------------------
 4521|   596k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  1.61k|            return;
 4523|       |
 4524|   594k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|   594k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|   594k|         std::remove_cvref_t<T> preexisting_entries;
 4538|   594k|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 594k]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|   594k|         struct merge_restore_guard
 4543|   594k|         {
 4544|   594k|            std::remove_cvref_t<T>& target;
 4545|   594k|            std::remove_cvref_t<T>& saved;
 4546|   594k|            ~merge_restore_guard()
 4547|   594k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   594k|               for (auto& entry : saved) {
 4551|   594k|                  target.emplace(entry.first, std::move(entry.second));
 4552|   594k|               }
 4553|   594k|            }
 4554|   594k|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|   594k|         const bool treat_as_block_mapping =
 4557|   594k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [True: 594k, Folded]
  |  Branch (4557:48): [True: 50.4k, False: 544k]
  |  Branch (4557:62): [True: 702, False: 49.7k]
  ------------------
 4558|       |
 4559|   594k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 50.4k, False: 544k]
  |  Branch (4559:28): [True: 49.7k, False: 702]
  ------------------
 4560|       |            // Flow mapping
 4561|  49.7k|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|  49.7k|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|  49.7k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 49.5k, False: 178]
  |  Branch (4565:30): [True: 2.83k, False: 46.7k]
  ------------------
 4566|  2.83k|               ++it;
 4567|  2.83k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  2.83k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 12, False: 2.82k]
  ------------------
 4569|     12|                  return;
 4570|  2.82k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  2.82k|               return;
 4572|  2.83k|            }
 4573|       |
 4574|   371k|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 367k, False: 3.19k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|   367k|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|   367k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 367k, False: 0]
  |  Branch (4578:33): [True: 1.76k, False: 366k]
  ------------------
 4579|  1.76k|                  ++it;
 4580|  1.76k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|  1.76k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 23, False: 1.74k]
  ------------------
 4582|     23|                     return;
 4583|  1.74k|                  break;
 4584|  1.76k|               }
 4585|       |
 4586|   366k|               bool explicit_flow_key = false;
 4587|   366k|               auto explicit_probe = it;
 4588|   366k|               yaml::skip_inline_ws(explicit_probe, end);
 4589|   366k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 366k, False: 0]
  |  Branch (4589:45): [True: 42.2k, False: 324k]
  ------------------
 4590|  42.2k|                  const auto after_q = explicit_probe + 1;
 4591|  42.2k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 9, False: 42.2k]
  |  Branch (4591:41): [True: 6.50k, False: 35.6k]
  ------------------
 4592|  35.6k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 27.7k, False: 7.96k]
  |  Branch (4592:42): [True: 991, False: 6.97k]
  ------------------
 4593|  35.2k|                     explicit_flow_key = true;
 4594|  35.2k|                     it = explicit_probe + 1;
 4595|  35.2k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  35.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 3, False: 35.2k]
  ------------------
 4597|      3|                        return;
 4598|  35.2k|                  }
 4599|  42.2k|               }
 4600|       |               // Parse key
 4601|   366k|               key_t key{};
 4602|   366k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|   366k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 35.2k, False: 330k]
  |  Branch (4603:44): [True: 35.2k, False: 14]
  |  Branch (4603:58): [True: 537, False: 34.6k]
  |  Branch (4603:72): [True: 27.7k, False: 6.93k]
  |  Branch (4603:86): [True: 1.00k, False: 5.93k]
  ------------------
 4604|  29.2k|                     key.clear();
 4605|  29.2k|                  }
 4606|   336k|                  else {
 4607|   336k|                     auto key_probe = it;
 4608|   336k|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|   336k|                     bool parse_complex_flow_key = false;
 4613|   336k|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 336k, False: 14]
  ------------------
 4614|   336k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 1.19k, False: 335k]
  |  Branch (4614:50): [True: 4.92k, False: 330k]
  ------------------
 4615|  6.11k|                           parse_complex_flow_key = true;
 4616|  6.11k|                        }
 4617|   330k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 37.9k, False: 292k]
  ------------------
 4618|  37.9k|                           ++key_probe;
 4619|  37.9k|                           yaml::parse_anchor_name(key_probe, end);
 4620|  37.9k|                           yaml::skip_inline_ws(key_probe, end);
 4621|  37.9k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 37.8k, False: 82]
  |  Branch (4621:53): [True: 623, False: 37.2k]
  |  Branch (4621:74): [True: 459, False: 36.8k]
  ------------------
 4622|  1.08k|                              parse_complex_flow_key = true;
 4623|  1.08k|                           }
 4624|  37.9k|                        }
 4625|   336k|                     }
 4626|       |
 4627|   336k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 7.19k, False: 329k]
  ------------------
 4628|  7.19k|                        glz::generic key_node{};
 4629|  7.19k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|  7.19k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 1.13k, False: 6.06k]
  ------------------
 4631|  1.13k|                           return;
 4632|  6.06k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 2, False: 6.06k]
  ------------------
 4633|      2|                           return;
 4634|  6.06k|                     }
 4635|   329k|                     else {
 4636|   329k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 908, False: 328k]
  ------------------
 4637|    908|                           return;
 4638|    908|                        }
 4639|   329k|                     }
 4640|   336k|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|   364k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|   366k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 25, False: 366k]
  ------------------
 4656|     25|                  return;
 4657|       |
 4658|   366k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|   366k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|   366k|                     val = {};
 4661|   366k|                     return true;
 4662|   366k|                  }
 4663|   366k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   366k|                     val = glz::generic{};
 4665|   366k|                     return true;
 4666|   366k|                  }
 4667|   366k|                  else {
 4668|   366k|                     static constexpr std::string_view null_value{"null"};
 4669|   366k|                     auto null_it = null_value.data();
 4670|   366k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|   366k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|   366k|                     return !bool(ctx.error);
 4673|   366k|                  }
 4674|   366k|               };
 4675|       |
 4676|   366k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 362k, False: 3.98k]
  |  Branch (4676:34): [True: 281k, False: 80.9k]
  |  Branch (4676:48): [True: 10.7k, False: 70.1k]
  ------------------
 4677|   292k|                  val_t val{};
 4678|   292k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 292k]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|   292k|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|   292k|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 10.7k, False: 281k]
  ------------------
 4684|  10.7k|                     ++it;
 4685|  10.7k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  10.7k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 36, False: 10.6k]
  ------------------
 4687|     36|                        return;
 4688|  10.6k|                     break;
 4689|  10.7k|                  }
 4690|       |
 4691|   281k|                  ++it; // skip comma
 4692|   281k|                  yaml::skip_ws_and_newlines(it, end);
 4693|   281k|                  continue;
 4694|   292k|               }
 4695|       |
 4696|  74.1k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 3.98k, False: 70.1k]
  |  Branch (4696:33): [True: 239, False: 69.9k]
  ------------------
 4697|  2.18k|                  ctx.error = error_code::syntax_error;
 4698|  2.18k|                  return;
 4699|  2.18k|               }
 4700|  71.9k|               ++it;
 4701|       |
 4702|  71.9k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  71.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 10, False: 71.9k]
  ------------------
 4704|     10|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  71.9k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 69.5k, False: 2.46k]
  |  Branch (4707:34): [True: 4.48k, False: 65.0k]
  |  Branch (4707:48): [True: 22.8k, False: 42.1k]
  ------------------
 4708|  27.3k|                  val_t val{};
 4709|  27.3k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 27.3k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|  27.3k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|  27.3k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 22.8k, False: 4.48k]
  ------------------
 4715|  22.8k|                     ++it;
 4716|  22.8k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  22.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 8, False: 22.8k]
  ------------------
 4718|      8|                        return;
 4719|  22.8k|                     break;
 4720|  22.8k|                  }
 4721|       |
 4722|  4.48k|                  ++it; // skip comma
 4723|  4.48k|                  yaml::skip_ws_and_newlines(it, end);
 4724|  4.48k|                  continue;
 4725|  27.3k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  44.6k|               val_t val{};
 4729|  44.6k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  44.6k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 864, False: 43.7k]
  ------------------
 4731|    864|                  return;
 4732|       |
 4733|  43.7k|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  43.7k|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  43.7k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 41.1k, False: 2.62k]
  |  Branch (4737:33): [True: 2.18k, False: 38.9k]
  ------------------
 4738|  2.18k|                  ++it;
 4739|  2.18k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|  2.18k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 22, False: 2.16k]
  ------------------
 4741|     22|                     return;
 4742|  2.16k|                  break;
 4743|  2.18k|               }
 4744|  41.5k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 38.9k, False: 2.62k]
  |  Branch (4744:38): [True: 35.7k, False: 3.26k]
  ------------------
 4745|  35.7k|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|  35.7k|                  yaml::skip_ws_and_newlines(it, end);
 4748|  35.7k|               }
 4749|  5.88k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 3.26k, False: 2.62k]
  |  Branch (4749:39): [True: 2.96k, False: 297]
  |  Branch (4749:54): [True: 181, False: 116]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|  3.14k|                  yaml::skip_ws_and_newlines(it, end);
 4753|  3.14k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 3.13k, False: 14]
  |  Branch (4753:36): [True: 299, False: 2.83k]
  ------------------
 4754|    299|                     ++it;
 4755|    299|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|    299|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 3, False: 296]
  ------------------
 4757|      3|                        return;
 4758|    296|                     break;
 4759|    299|                  }
 4760|  2.84k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 2.83k, False: 14]
  |  Branch (4760:36): [True: 2.81k, False: 18]
  ------------------
 4761|  2.81k|                     ++it;
 4762|  2.81k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  2.81k|                     continue;
 4764|  2.81k|                  }
 4765|     32|                  ctx.error = error_code::syntax_error;
 4766|     32|                  return;
 4767|  2.84k|               }
 4768|  2.73k|               else {
 4769|  2.73k|                  ctx.error = error_code::syntax_error;
 4770|  2.73k|                  return;
 4771|  2.73k|               }
 4772|  43.7k|            }
 4773|  46.8k|         }
 4774|   545k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   545k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   545k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   545k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   545k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   545k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   545k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   545k|                           if (ctx.stream_begin) {
 4788|   545k|                              auto is_line_content_start = [&](auto pos) {
 4789|   545k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   545k|                              };
 4791|       |
 4792|   545k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   545k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   545k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   545k|                                 return line != end && *line == ':';
 4796|   545k|                              };
 4797|       |
 4798|   545k|                              if (!is_line_content_start(it) &&
 4799|   545k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   545k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   545k|                                 ctx.error = error_code::syntax_error;
 4802|   545k|                                 return false;
 4803|   545k|                              }
 4804|   545k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   545k|                           }
 4806|   545k|                        }
 4807|       |
 4808|   545k|                        if (*it == '-' &&
 4809|   545k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   545k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   545k|                           ctx.error = error_code::syntax_error;
 4813|   545k|                           return false;
 4814|   545k|                        }
 4815|       |
 4816|   545k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   545k|                           return false;
 4818|   545k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   545k|                        ctx.pop_indent();
 4820|   545k|                     }
 4821|   545k|                     else {
 4822|   545k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   545k|                        if (nested_indent >= 0) {
 4824|   545k|                           yaml::skip_to_content(it, end);
 4825|   545k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   545k|                              ctx.error = error_code::syntax_error;
 4827|   545k|                              return false;
 4828|   545k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   545k|                           const int32_t value_indent =
 4832|   545k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   545k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   545k|                              return false;
 4835|   545k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   545k|                           ctx.pop_indent();
 4837|   545k|                        }
 4838|   545k|                     }
 4839|   545k|                     return !bool(ctx.error);
 4840|   545k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   545k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   545k|                     ctx.error = error_code::syntax_error;
 4847|   545k|                     return false;
 4848|   545k|                  }
 4849|   545k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   545k|                     ++it; // skip '?'
 4851|   545k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   545k|                     const int32_t explicit_value_indicator_indent =
 4854|   545k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   545k|                     key_t key{};
 4857|   545k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   545k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   545k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   545k|                        };
 4861|       |
 4862|   545k|                        auto key_it = it;
 4863|   545k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   545k|                        auto content = key_it;
 4866|   545k|                        yaml::skip_to_content(content, end);
 4867|   545k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   545k|                        if (content != end && *content == '&') {
 4873|   545k|                           auto anchor_probe = content + 1;
 4874|   545k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   545k|                           if (!anchor_name.empty()) {
 4876|   545k|                              auto after_anchor = anchor_probe;
 4877|   545k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   545k|                              auto value_indicator = after_anchor;
 4880|   545k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   545k|                                 key.clear();
 4882|   545k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   545k|                                 it = value_indicator;
 4884|   545k|                                 handled_anchor_only_empty_key = true;
 4885|   545k|                              }
 4886|   545k|                              else {
 4887|   545k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   545k|                                    yaml::skip_comment(value_indicator, end);
 4889|   545k|                                 }
 4890|   545k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   545k|                                    yaml::skip_newline(value_indicator, end);
 4892|   545k|                                    auto value_line = value_indicator;
 4893|   545k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   545k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   545k|                                       return false;
 4896|   545k|                                    if (value_line != end && *value_line == ':' &&
 4897|   545k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   545k|                                       key.clear();
 4899|   545k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   545k|                                       it = value_line;
 4901|   545k|                                       handled_anchor_only_empty_key = true;
 4902|   545k|                                    }
 4903|   545k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   545k|                                       ctx.error = error_code::syntax_error;
 4908|   545k|                                       return false;
 4909|   545k|                                    }
 4910|   545k|                                 }
 4911|   545k|                              }
 4912|   545k|                           }
 4913|   545k|                        }
 4914|       |
 4915|   545k|                        const bool key_content_spans_lines = [&] {
 4916|   545k|                           auto scan = key_it;
 4917|   545k|                           while (scan != content && scan != end) {
 4918|   545k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   545k|                              ++scan;
 4920|   545k|                           }
 4921|   545k|                           return false;
 4922|   545k|                        }();
 4923|       |
 4924|   545k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   545k|                        }
 4927|   545k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   545k|                           key.clear();
 4929|   545k|                           it = content;
 4930|   545k|                        }
 4931|   545k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   545k|                           auto key_node_it = content;
 4937|   545k|                           auto key_node_end = end;
 4938|   545k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   545k|                              auto scan = content;
 4943|   545k|                              while (scan != end) {
 4944|   545k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   545k|                                    ++scan;
 4946|   545k|                                 }
 4947|   545k|                                 if (scan == end) {
 4948|   545k|                                    break;
 4949|   545k|                                 }
 4950|       |
 4951|   545k|                                 yaml::skip_newline(scan, end);
 4952|   545k|                                 auto line_start = scan;
 4953|       |
 4954|   545k|                                 int32_t indicator_indent = 0;
 4955|   545k|                                 while (scan != end && *scan == ' ') {
 4956|   545k|                                    ++indicator_indent;
 4957|   545k|                                    ++scan;
 4958|   545k|                                 }
 4959|       |
 4960|   545k|                                 if (scan != end && *scan == ':') {
 4961|   545k|                                    const auto after_colon = scan + 1;
 4962|   545k|                                    if ((after_colon == end ||
 4963|   545k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   545k|                                        indicator_indent <= line_indent) {
 4965|   545k|                                       key_node_end = line_start;
 4966|   545k|                                       break;
 4967|   545k|                                    }
 4968|   545k|                                 }
 4969|   545k|                              }
 4970|   545k|                           }
 4971|       |
 4972|   545k|                           glz::generic key_node{};
 4973|   545k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   545k|                           ctx.explicit_mapping_key_context = true;
 4975|   545k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   545k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   545k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   545k|                              return false;
 4979|   545k|                           it = key_node_it;
 4980|   545k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   545k|                              return false;
 4982|   545k|                        }
 4983|   545k|                     }
 4984|   545k|                     else {
 4985|   545k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   545k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   545k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   545k|                              return false;
 4989|   545k|                        }
 4990|   545k|                     }
 4991|       |
 4992|   545k|                     yaml::skip_inline_ws(it, end);
 4993|   545k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   545k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   545k|                        auto probe = it;
 4998|   545k|                        bool found_value_indicator = false;
 4999|       |
 5000|   545k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   545k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   545k|                           auto value_line = probe;
 5004|   545k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   545k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   545k|                              return false;
 5007|       |
 5008|   545k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   545k|                              probe = value_line;
 5010|   545k|                              continue; // blank line
 5011|   545k|                           }
 5012|   545k|                           if (*value_line == '#') {
 5013|   545k|                              yaml::skip_comment(value_line, end);
 5014|   545k|                              probe = value_line;
 5015|   545k|                              continue; // comment-only line
 5016|   545k|                           }
 5017|   545k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   545k|                              it = value_line;
 5019|   545k|                              found_value_indicator = true;
 5020|   545k|                           }
 5021|   545k|                           break;
 5022|   545k|                        }
 5023|       |
 5024|   545k|                        if (found_value_indicator) {
 5025|   545k|                           yaml::skip_inline_ws(it, end);
 5026|   545k|                        }
 5027|   545k|                     }
 5028|       |
 5029|   545k|                     val_t val{};
 5030|   545k|                     if (it != end && *it == ':') {
 5031|   545k|                        ++it;
 5032|   545k|                        if (it != end && *it == '\t') {
 5033|   545k|                           ctx.error = error_code::syntax_error;
 5034|   545k|                           return false;
 5035|   545k|                        }
 5036|   545k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   545k|                           auto probe = it;
 5038|   545k|                           yaml::skip_newline(probe, end);
 5039|   545k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   545k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   545k|                              ctx.error = error_code::syntax_error;
 5042|   545k|                              return false;
 5043|   545k|                           }
 5044|   545k|                        }
 5045|   545k|                        yaml::skip_inline_ws(it, end);
 5046|   545k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   545k|                           return false;
 5048|   545k|                     }
 5049|       |
 5050|   545k|                     value.emplace(std::move(key), std::move(val));
 5051|   545k|                     return true;
 5052|   545k|                  }
 5053|       |
 5054|   545k|                  key_t key{};
 5055|   545k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   545k|                     auto key_probe = it;
 5057|   545k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   545k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   545k|                     if (complex_flow_key) {
 5060|   545k|                        glz::generic key_node{};
 5061|   545k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   545k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   545k|                           return false;
 5064|   545k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   545k|                           return false;
 5066|   545k|                     }
 5067|   545k|                     else {
 5068|   545k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   545k|                           return false;
 5070|   545k|                        }
 5071|   545k|                     }
 5072|   545k|                  }
 5073|   545k|                  else {
 5074|   545k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   545k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   545k|                        return false;
 5077|   545k|                  }
 5078|       |
 5079|   545k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   545k|                  if (it == end || *it != ':') {
 5082|   545k|                     ctx.error = error_code::syntax_error;
 5083|   545k|                     return false;
 5084|   545k|                  }
 5085|   545k|                  ++it;
 5086|   545k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   545k|                  val_t val{};
 5089|   545k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   545k|                     return false;
 5091|       |
 5092|   545k|                  value.emplace(std::move(key), std::move(val));
 5093|   545k|                  return true;
 5094|   545k|               });
 5095|   545k|         }
 5096|       |
 5097|   586k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|   586k|      }
_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|   596k|      {
  466|   596k|         skip_inline_ws(it, end);
  467|       |
  468|   596k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1, False: 596k]
  ------------------
  469|      1|            if constexpr (!AllowEmptyInput) {
  470|      1|               ctx.error = error_code::unexpected_end;
  471|      1|            }
  472|      1|            return true;
  473|      1|         }
  474|       |
  475|   596k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   596k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 5, False: 596k]
  ------------------
  477|      5|            ctx.error = error_code::syntax_error;
  478|      5|            return true;
  479|      5|         }
  480|   596k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 4, False: 596k]
  ------------------
  481|      4|            ctx.error = error_code::syntax_error;
  482|      4|            return true;
  483|      4|         }
  484|       |
  485|   596k|         skip_inline_ws(it, end);
  486|       |
  487|   596k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 596k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   596k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 1.59k, False: 594k]
  ------------------
  495|  1.59k|            return true;
  496|  1.59k|         }
  497|       |
  498|   594k|         return false;
  499|   596k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESN_:
 4521|   596k|                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|   596k|      {
  409|   596k|         state.has_anchor = false;
  410|   596k|         state.anchor_name.clear();
  411|   596k|         state.anchor_start = nullptr;
  412|   596k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   596k|         if constexpr (Policy.allow_alias) {
  415|   596k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   596k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 586k, False: 9.79k]
  ------------------
  417|   586k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 1.55k, False: 585k]
  ------------------
  418|   586k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   596k|         }
  424|       |
  425|   596k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 594k, False: 1.55k]
  |  Branch (425:27): [True: 35.2k, False: 559k]
  ------------------
  426|  35.2k|            ++it;
  427|  35.2k|            auto name = parse_anchor_name(it, end);
  428|  35.2k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 20, False: 35.2k]
  ------------------
  429|     20|               ctx.error = error_code::syntax_error;
  430|     20|               return true;
  431|     20|            }
  432|  35.2k|            skip_inline_ws(it, end);
  433|  35.2k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 21, False: 35.2k]
  ------------------
  434|     21|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     21|                  ctx.error = error_code::unexpected_end;
  436|     21|               }
  437|     21|               return true;
  438|     21|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  35.2k|            state.has_anchor = true;
  446|  35.2k|            state.anchor_name = std::string(name);
  447|  35.2k|            state.anchor_start = &*it;
  448|  35.2k|         }
  449|       |
  450|   596k|         return false;
  451|   596k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   586k|      {
  301|   586k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 586k]
  |  Branch (301:27): [True: 585k, False: 1.55k]
  ------------------
  302|       |
  303|  1.55k|         ++it; // skip '*'
  304|  1.55k|         auto name = parse_anchor_name(it, end);
  305|  1.55k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 7, False: 1.55k]
  ------------------
  306|      7|            ctx.error = error_code::syntax_error;
  307|      7|            return true;
  308|      7|         }
  309|       |
  310|  1.55k|         auto anchor_it = ctx.anchors.find(name);
  311|  1.55k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 74, False: 1.47k]
  ------------------
  312|     74|            ctx.error = error_code::syntax_error; // undefined alias
  313|     74|            return true;
  314|     74|         }
  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.47k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.47k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 702, False: 775]
  ------------------
  322|    702|            return true;
  323|    702|         }
  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|    775|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 23, False: 752]
  ------------------
  329|     23|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     23|            return true;
  331|     23|         }
  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|    752|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    752|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 752]
  ------------------
  339|      0|            return true;
  340|       |
  341|    752|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 752]
  ------------------
  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|    752|         auto replay_it = span.begin;
  348|    752|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    752|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    752|         ctx.indent_stack.clear();
  353|    752|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 624, False: 128]
  ------------------
  354|    624|            ctx.push_indent(span.base_indent - 1);
  355|    624|         }
  356|       |
  357|    752|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    752|         using V = std::remove_cvref_t<T>;
  360|    752|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    752|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    752|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    752|         return true;
  367|    752|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  4.36M|      {
  275|  4.36M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  4.36M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  4.36M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  4.36M|      }
_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_:
 5635|  6.64M|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|  6.64M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|  6.64M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|  6.64M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|  6.64M|                       "the internally tagged shape, so it is rejected here instead.");
 5642|  6.64M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 6.64M]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|  6.64M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|  6.64M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 63, False: 6.64M]
  ------------------
 5650|     63|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|  6.64M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 5.17M, False: 1.47M]
  ------------------
 5655|  5.17M|            yaml::skip_ws_newlines_comments(it, end);
 5656|  5.17M|         }
 5657|  1.47M|         else {
 5658|  1.47M|            yaml::skip_inline_ws(it, end);
 5659|  1.47M|         }
 5660|       |
 5661|  6.64M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 735, False: 6.64M]
  ------------------
 5662|    735|            ctx.error = error_code::unexpected_end;
 5663|    735|            return;
 5664|    735|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|  6.64M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|  6.64M|            using V = std::remove_cvref_t<T>;
 5772|  6.64M|            using counts = yaml_variant_type_count<V>;
 5773|  6.64M|            const char c = *it;
 5774|  6.64M|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  6.64M|               switch (ch) {
 5776|  6.64M|               case ' ':
 5777|  6.64M|               case '\t':
 5778|  6.64M|               case '\n':
 5779|  6.64M|               case '\r':
 5780|  6.64M|               case ',':
 5781|  6.64M|               case ']':
 5782|  6.64M|               case '}':
 5783|  6.64M|                  return true;
 5784|  6.64M|               default:
 5785|  6.64M|                  return false;
 5786|  6.64M|               }
 5787|  6.64M|            };
 5788|       |
 5789|  6.64M|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  6.64M|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  6.64M|                  return false;
 5792|  6.64M|               }
 5793|  6.64M|               if (ctx.current_indent() < 0) {
 5794|  6.64M|                  return false;
 5795|  6.64M|               }
 5796|  6.64M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|  6.64M|                  return false;
 5798|  6.64M|               }
 5799|       |
 5800|  6.64M|               auto look = word_end;
 5801|  6.64M|               yaml::skip_newline(look, end);
 5802|  6.64M|               while (look != end) {
 5803|  6.64M|                  int32_t line_indent = 0;
 5804|  6.64M|                  while (look != end && *look == ' ') {
 5805|  6.64M|                     ++line_indent;
 5806|  6.64M|                     ++look;
 5807|  6.64M|                  }
 5808|  6.64M|                  if (look != end && *look == '\t') {
 5809|  6.64M|                     return false;
 5810|  6.64M|                  }
 5811|  6.64M|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|  6.64M|                     if (look != end) {
 5813|  6.64M|                        yaml::skip_newline(look, end);
 5814|  6.64M|                        continue;
 5815|  6.64M|                     }
 5816|  6.64M|                     return false;
 5817|  6.64M|                  }
 5818|  6.64M|                  if (*look == '#') {
 5819|  6.64M|                     yaml::skip_comment(look, end);
 5820|  6.64M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|  6.64M|                        yaml::skip_newline(look, end);
 5822|  6.64M|                        continue;
 5823|  6.64M|                     }
 5824|  6.64M|                     return false;
 5825|  6.64M|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  6.64M|                  {
 5831|  6.64M|                     auto scan = look;
 5832|  6.64M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|  6.64M|                        if (*scan == ':') {
 5834|  6.64M|                           auto after_colon = scan + 1;
 5835|  6.64M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|  6.64M|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|  6.64M|                              return false;
 5838|  6.64M|                           }
 5839|  6.64M|                        }
 5840|  6.64M|                        ++scan;
 5841|  6.64M|                     }
 5842|  6.64M|                  }
 5843|       |
 5844|  6.64M|                  return line_indent > ctx.current_indent();
 5845|  6.64M|               }
 5846|  6.64M|               return false;
 5847|  6.64M|            };
 5848|  6.64M|            auto is_word_boundary = [&](const auto ptr) {
 5849|  6.64M|               if (ptr == end) {
 5850|  6.64M|                  return true;
 5851|  6.64M|               }
 5852|  6.64M|               if (*ptr == ':') {
 5853|  6.64M|                  auto next = ptr + 1;
 5854|  6.64M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|  6.64M|               }
 5856|  6.64M|               return is_plain_scalar_boundary(*ptr);
 5857|  6.64M|            };
 5858|       |
 5859|  6.64M|            switch (c) {
 5860|  1.23M|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 1.23M, False: 5.41M]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|  1.23M|               ++it;
 5863|  1.23M|               auto aname = yaml::parse_anchor_name(it, end);
 5864|  1.23M|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 154, False: 1.23M]
  ------------------
 5865|    154|                  ctx.error = error_code::syntax_error;
 5866|    154|                  return;
 5867|    154|               }
 5868|  1.23M|               yaml::skip_inline_ws(it, end);
 5869|  1.23M|               bool anchor_on_same_line = true;
 5870|  1.23M|               bool value_is_indentless_sequence = false;
 5871|  1.23M|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 5.69k, False: 1.22M]
  |  Branch (5871:33): [True: 45.1k, False: 1.18M]
  |  Branch (5871:48): [True: 79.8k, False: 1.10M]
  |  Branch (5871:63): [True: 18.1k, False: 1.08M]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|   148k|                  bool value_on_next_line = false;
 5875|   148k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 143k, False: 5.69k]
  ------------------
 5876|   143k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|   143k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 18.1k, False: 124k]
  ------------------
 5879|   582k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 582k, False: 36]
  |  Branch (5879:47): [True: 575k, False: 6.72k]
  |  Branch (5879:64): [True: 564k, False: 11.3k]
  ------------------
 5880|  18.1k|                     }
 5881|       |                     // Skip newline
 5882|   143k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 143k, False: 36]
  |  Branch (5882:42): [True: 51.8k, False: 91.1k]
  |  Branch (5882:59): [True: 91.1k, False: 0]
  ------------------
 5883|   143k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|   190k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 187k, False: 2.74k]
  |  Branch (5885:48): [True: 28.4k, False: 159k]
  |  Branch (5885:65): [True: 19.1k, False: 140k]
  ------------------
 5886|  47.5k|                           yaml::skip_newline(peek, end);
 5887|  47.5k|                        }
 5888|       |                        // Measure indent of next content line
 5889|   143k|                        int32_t next_indent = 0;
 5890|   265k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 262k, False: 3.61k]
  |  Branch (5890:47): [True: 122k, False: 139k]
  ------------------
 5891|   122k|                           ++next_indent;
 5892|   122k|                           ++peek;
 5893|   122k|                        }
 5894|   143k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 139k, False: 3.61k]
  |  Branch (5894:44): [True: 134k, False: 5.37k]
  |  Branch (5894:61): [True: 132k, False: 1.60k]
  ------------------
 5895|   132k|                           const bool indentless_sequence =
 5896|   132k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 129k, False: 3.14k]
  |  Branch (5896:69): [True: 58.0k, False: 71.2k]
  ------------------
 5897|  58.0k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 740, False: 57.3k]
  ------------------
 5898|  57.3k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 55.8k, False: 1.48k]
  ------------------
 5899|  56.5k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 2.93k, False: 53.6k]
  ------------------
 5900|  53.6k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 3.71k, False: 49.9k]
  |  Branch (5900:61): [True: 3.28k, False: 432]
  ------------------
 5901|   132k|                           value_is_indentless_sequence = indentless_sequence;
 5902|   132k|                           const bool same_indent_property_node =
 5903|   132k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 12.9k, False: 119k]
  ------------------
 5904|  12.9k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 921, False: 12.0k]
  |  Branch (5904:48): [True: 708, False: 11.3k]
  |  Branch (5904:64): [True: 3, False: 11.3k]
  |  Branch (5904:80): [True: 861, False: 10.4k]
  |  Branch (5904:96): [True: 769, False: 9.68k]
  ------------------
 5905|  9.68k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 810, False: 8.87k]
  |  Branch (5905:48): [True: 556, False: 8.32k]
  |  Branch (5905:65): [True: 1.04k, False: 7.27k]
  |  Branch (5905:81): [True: 269, False: 7.00k]
  ------------------
 5906|   132k|                           value_on_next_line =
 5907|   132k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 112k, False: 20.1k]
  |  Branch (5907:71): [True: 6.22k, False: 13.9k]
  |  Branch (5907:94): [True: 5.94k, False: 8.03k]
  ------------------
 5908|   132k|                        }
 5909|   143k|                     }
 5910|   143k|                  }
 5911|   148k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 24.3k, False: 124k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  24.3k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  24.3k|                     return;
 5915|  24.3k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|   124k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 17.3k, False: 107k]
  ------------------
 5918|   573k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 573k, False: 0]
  |  Branch (5918:42): [True: 567k, False: 6.14k]
  |  Branch (5918:57): [True: 556k, False: 11.2k]
  ------------------
 5919|  17.3k|                  }
 5920|   124k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 124k, False: 0]
  ------------------
 5921|   159k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 159k, False: 0]
  |  Branch (5921:40): [True: 20.2k, False: 138k]
  |  Branch (5921:55): [True: 14.5k, False: 124k]
  ------------------
 5922|  34.7k|                     yaml::skip_newline(it, end);
 5923|  34.7k|                  }
 5924|   124k|                  yaml::skip_inline_ws(it, end);
 5925|   124k|                  anchor_on_same_line = false;
 5926|   124k|               }
 5927|       |
 5928|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|       |                  if (anchor_on_same_line && *it == '-' &&
 5930|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|       |                     ctx.error = error_code::syntax_error;
 5933|       |                     return;
 5934|       |                  }
 5935|       |               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|  1.21M|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 1.21M, False: 7]
  |  Branch (5939:33): [True: 133, False: 1.21M]
  |  Branch (5939:47): [True: 68, False: 65]
  ------------------
 5940|     68|                  ctx.error = error_code::syntax_error;
 5941|     68|                  return;
 5942|     68|               }
 5943|       |
 5944|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 5946|       |                     auto probe = it + 1;
 5947|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|       |                     if (nested_anchor_name.empty()) {
 5949|       |                        ctx.error = error_code::syntax_error;
 5950|       |                        return;
 5951|       |                     }
 5952|       |                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 5957|       |                        ctx.error = error_code::syntax_error;
 5958|       |                        return;
 5959|       |                     }
 5960|       |                  }
 5961|       |               }
 5962|       |
 5963|  1.21M|               const char* anchor_start = &*it;
 5964|  1.21M|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 5971|       |                     auto key_start = it;
 5972|       |                     if (*key_start == '!') {
 5973|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 5975|       |                           ctx.error = error_code::syntax_error;
 5976|       |                           return;
 5977|       |                        }
 5978|       |                        yaml::skip_inline_ws(key_start, end);
 5979|       |                        if (key_start == end) {
 5980|       |                           ctx.error = error_code::unexpected_end;
 5981|       |                           return;
 5982|       |                        }
 5983|       |                        if (*key_start == '\n' || *key_start == '\r') {
 5984|       |                           ctx.error = error_code::syntax_error;
 5985|       |                           return;
 5986|       |                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 5993|       |                           ctx.error = error_code::syntax_error;
 5994|       |                           return;
 5995|       |                        }
 5996|       |                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|       |                     auto key_scan = key_start;
 6000|       |                     auto key_end = key_start;
 6001|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6002|       |                        // Quoted key: skip to closing quote
 6003|       |                        const char quote = *key_scan;
 6004|       |                        ++key_scan;
 6005|       |                        while (key_scan != end && *key_scan != quote) {
 6006|       |                           if (*key_scan == '\\' && quote == '"') {
 6007|       |                              ++key_scan;
 6008|       |                              if (key_scan != end) ++key_scan;
 6009|       |                           }
 6010|       |                           else {
 6011|       |                              ++key_scan;
 6012|       |                           }
 6013|       |                        }
 6014|       |                        if (key_scan == end) {
 6015|       |                           ctx.error = error_code::syntax_error;
 6016|       |                           return;
 6017|       |                        }
 6018|       |                        ++key_scan; // past closing quote
 6019|       |                        key_end = key_scan;
 6020|       |                        yaml::skip_inline_ws(key_scan, end);
 6021|       |                     }
 6022|       |                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|       |                        while (key_scan != end) {
 6025|       |                           if (*key_scan == ':') {
 6026|       |                              auto next = key_scan + 1;
 6027|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6028|       |                                 break;
 6029|       |                              }
 6030|       |                           }
 6031|       |                           ++key_scan;
 6032|       |                        }
 6033|       |                        key_end = key_scan;
 6034|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6035|       |                           --key_end;
 6036|       |                        }
 6037|       |                     }
 6038|       |                     if (key_scan == end || *key_scan != ':') {
 6039|       |                        ctx.error = error_code::syntax_error;
 6040|       |                        return;
 6041|       |                     }
 6042|       |                     // Store anchor with just the key text span
 6043|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|       |                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|       |                     if constexpr (counts::n_object > 0) {
 6047|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|       |                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|       |                     return;
 6054|       |                  }
 6055|       |               }
 6056|       |
 6057|  1.21M|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|  1.21M|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|  1.21M|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|  1.21M|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|  1.21M|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 1.19M, False: 18.5k]
  ------------------
 6062|  1.19M|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|  1.19M|               }
 6064|  1.21M|               return;
 6065|  1.21M|            }
 6066|  1.06M|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 1.06M, False: 5.58M]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6070|       |                     if constexpr (counts::n_object > 0) {
 6071|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|       |                                                                                                        end);
 6073|       |                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|       |                  }
 6080|       |               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|  1.06M|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|  1.06M|               return;
 6085|  1.21M|            }
 6086|   321k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 321k, False: 6.32M]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|   321k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|   321k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 82, False: 321k]
  ------------------
 6090|     82|                  ctx.error = error_code::syntax_error;
 6091|     82|                  return;
 6092|     82|               }
 6093|   321k|               yaml::skip_inline_ws(it, end);
 6094|   321k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 319k, False: 1.85k]
  |  Branch (6094:33): [True: 18.8k, False: 300k]
  ------------------
 6095|  18.8k|                  yaml::skip_comment(it, end);
 6096|  18.8k|               }
 6097|   321k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 318k, False: 2.64k]
  |  Branch (6097:34): [True: 56.4k, False: 262k]
  |  Branch (6097:49): [True: 40.8k, False: 221k]
  ------------------
 6098|  97.3k|                  auto content = it;
 6099|  97.3k|                  yaml::skip_newline(content, end);
 6100|  97.3k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  97.3k|                  bool consume_following_content = false;
 6103|  97.3k|                  auto content_token = content;
 6104|  97.3k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 95.2k, False: 2.07k]
  ------------------
 6105|  95.2k|                     auto indent_probe = content;
 6106|  95.2k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  95.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 5, False: 95.2k]
  ------------------
 6108|      5|                        return;
 6109|  95.2k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  95.2k|                     bool tagged_indentless_sequence = false;
 6114|  95.2k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 15.9k, False: 79.2k]
  |  Branch (6114:56): [True: 15.9k, False: 0]
  |  Branch (6114:79): [True: 13.7k, False: 2.20k]
  ------------------
 6115|  13.7k|                        const auto after_dash = indent_probe + 1;
 6116|  13.7k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 762, False: 13.0k]
  ------------------
 6117|  13.0k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 7.93k, False: 5.09k]
  ------------------
 6118|  8.70k|                           tagged_indentless_sequence =
 6119|  8.70k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 1.89k, False: 6.81k]
  ------------------
 6120|  6.81k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 1.38k, False: 5.42k]
  |  Branch (6120:60): [True: 352, False: 1.03k]
  ------------------
 6121|  8.70k|                        }
 6122|  13.7k|                     }
 6123|       |
 6124|  95.2k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 55.4k, False: 39.8k]
  ------------------
 6125|  39.8k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 8.69k, False: 31.1k]
  |  Branch (6125:93): [True: 2.24k, False: 28.8k]
  ------------------
 6126|  95.2k|                  }
 6127|       |
 6128|  97.3k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 66.3k, False: 30.9k]
  ------------------
 6129|  66.3k|                     it = content_token;
 6130|  66.3k|                  }
 6131|  30.9k|                  else {
 6132|  30.9k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 867, False: 30.0k]
  ------------------
 6133|    867|                        if constexpr (counts::n_str > 0) {
 6134|    867|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|    867|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|    867|                           value = StrType{};
 6137|    867|                           return;
 6138|    867|                        }
 6139|    867|                     }
 6140|  30.9k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 237, False: 30.7k]
  ------------------
 6141|    237|                        if constexpr (counts::n_null > 0) {
 6142|    237|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|    237|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|    237|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 237]
  ------------------
 6145|    237|                           return;
 6146|    237|                        }
 6147|    237|                     }
 6148|  30.9k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 28.4k, False: 2.47k]
  ------------------
 6149|  28.4k|                        if constexpr (counts::n_null > 0) {
 6150|  28.4k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  28.4k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  28.4k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 28.4k]
  ------------------
 6153|  28.4k|                           return;
 6154|  28.4k|                        }
 6155|  28.4k|                     }
 6156|  30.9k|                  }
 6157|  97.3k|               }
 6158|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|       |                  if (it != end && *it == ',') {
 6162|       |                     ctx.error = error_code::syntax_error;
 6163|       |                     return;
 6164|       |                  }
 6165|       |                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|       |                     const bool starts_block_sequence_entry =
 6168|       |                        (it != end && *it == '-') &&
 6169|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6170|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|       |                        return;
 6175|       |                     }
 6176|       |                  }
 6177|       |               }
 6178|   321k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 2.64k, False: 318k]
  ------------------
 6179|  2.64k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 524, False: 2.11k]
  ------------------
 6180|    524|                     if constexpr (counts::n_str > 0) {
 6181|    524|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    524|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    524|                        value = StrType{};
 6184|    524|                        return;
 6185|    524|                     }
 6186|    524|                  }
 6187|  2.64k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 2.11k, False: 533]
  ------------------
 6188|  2.11k|                     if constexpr (counts::n_null > 0) {
 6189|  2.11k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|  2.11k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|  2.11k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 2.11k]
  ------------------
 6192|  2.11k|                        return;
 6193|  2.11k|                     }
 6194|  2.11k|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  2.64k|                  return;
 6197|  2.64k|               }
 6198|   318k|               switch (tag) {
 6199|  3.54k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 3.54k, False: 315k]
  ------------------
 6200|  3.54k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|  3.54k|                  return;
 6202|  8.92k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 8.92k, False: 309k]
  ------------------
 6203|  9.09k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 170, False: 318k]
  ------------------
 6204|  9.09k|                  if constexpr (counts::n_num > 0) {
 6205|  9.09k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  9.09k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  36.4k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 27.3k, False: 291k]
  ------------------
 6213|  36.4k|                  if constexpr (counts::n_bool > 0) {
 6214|  36.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  36.4k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  38.3k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 1.88k, False: 316k]
  ------------------
 6222|  38.3k|                  if constexpr (counts::n_null > 0) {
 6223|  38.3k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  38.3k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  38.3k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 38.3k]
  ------------------
 6226|  38.3k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  38.3k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  63.7k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 25.4k, False: 293k]
  ------------------
 6234|  63.7k|                  if constexpr (counts::n_object > 0) {
 6235|  63.7k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  63.7k|                                                                                                     end);
 6237|  63.7k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|   129k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 65.6k, False: 253k]
  ------------------
 6244|   129k|                  if constexpr (counts::n_array > 0) {
 6245|   129k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|       |                        if (it != end && *it == '-') {
 6248|       |                           ctx.allow_indentless_sequence = true;
 6249|       |                        }
 6250|       |                     }
 6251|   129k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|   129k|                                                                                                    end);
 6253|   129k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|   129k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|   285k|               default: {
  ------------------
  |  Branch (6260:16): [True: 156k, False: 162k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|   285k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 156k, False: 129k]
  |  Branch (6263:36): [True: 23.2k, False: 132k]
  ------------------
 6264|  23.2k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  23.2k|                     return;
 6266|  23.2k|                  }
 6267|       |
 6268|   262k|                  if constexpr (counts::n_array > 0) {
 6269|   262k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 132k, False: 129k]
  |  Branch (6269:39): [True: 5.72k, False: 127k]
  ------------------
 6270|  5.72k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|  5.72k|                                                                                                       end);
 6272|  5.72k|                        return;
 6273|  5.72k|                     }
 6274|   262k|                  }
 6275|   262k|                  if constexpr (counts::n_object > 0) {
 6276|   262k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 127k, False: 135k]
  |  Branch (6276:39): [True: 23.2k, False: 104k]
  ------------------
 6277|  23.2k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|  23.2k|                                                                                                        end);
 6279|  23.2k|                        return;
 6280|  23.2k|                     }
 6281|   262k|                  }
 6282|       |
 6283|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|       |                     if constexpr (counts::n_array > 0) {
 6285|       |                        const bool starts_block_sequence_entry =
 6286|       |                           (it != end && *it == '-') &&
 6287|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6288|       |                        if (starts_block_sequence_entry) {
 6289|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|       |                                                                                                          it, end);
 6291|       |                           return;
 6292|       |                        }
 6293|       |                     }
 6294|       |                     if constexpr (counts::n_object > 0) {
 6295|       |                        const bool starts_explicit_mapping_indicator =
 6296|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6297|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6298|       |                        if (starts_explicit_mapping_indicator) {
 6299|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|       |                                                                                                           it, end);
 6301|       |                           return;
 6302|       |                        }
 6303|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6304|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|       |                                                                                                           it, end);
 6306|       |                           return;
 6307|       |                        }
 6308|       |                     }
 6309|       |                  }
 6310|       |
 6311|   262k|                  if constexpr (counts::n_str > 0) {
 6312|   262k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|   262k|                     return;
 6314|   262k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|   262k|                  return;
 6319|   285k|               }
 6320|   318k|               }
 6321|      0|               return;
 6322|   318k|            }
 6323|  1.32M|            case '{':
  ------------------
  |  Branch (6323:13): [True: 1.32M, False: 5.32M]
  ------------------
 6324|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6327|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|       |                                                                                                     end);
 6329|       |                     return;
 6330|       |                  }
 6331|       |               }
 6332|       |               // Flow mapping - object type
 6333|  1.32M|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|  1.32M|               return;
 6335|   103k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 103k, False: 6.54M]
  ------------------
 6336|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6339|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|       |                                                                                                     end);
 6341|       |                     return;
 6342|       |                  }
 6343|       |               }
 6344|       |               // Flow sequence - array type
 6345|   103k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|   103k|               return;
 6347|   295k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 295k, False: 6.35M]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   295k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 292k, False: 3.15k]
  |  Branch (6349:39): [True: 5, False: 292k]
  ------------------
 6350|      5|                  ctx.error = error_code::syntax_error;
 6351|      5|                  return;
 6352|      5|               }
 6353|   295k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 292k, False: 3.15k]
  |  Branch (6353:40): [True: 87.1k, False: 205k]
  |  Branch (6353:56): [True: 116k, False: 88.5k]
  |  Branch (6353:73): [True: 46.5k, False: 41.9k]
  ------------------
 6354|   250k|                  if constexpr (counts::n_object > 0) {
 6355|   250k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   250k|                                                                                                     end);
 6357|   250k|                     return;
 6358|   250k|                  }
 6359|   250k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   295k|               return;
 6362|    254|            case '%':
  ------------------
  |  Branch (6362:13): [True: 254, False: 6.64M]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|    254|               ctx.error = error_code::syntax_error;
 6365|    254|               return;
 6366|  6.63k|            case '"':
  ------------------
  |  Branch (6366:13): [True: 6.63k, False: 6.63M]
  ------------------
 6367|  14.0k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 7.39k, False: 6.63M]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  14.0k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  14.0k|               return;
 6372|  61.1k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 61.1k, False: 6.58M]
  ------------------
 6373|  68.7k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 7.59k, False: 6.63M]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  68.7k|               if constexpr (counts::n_bool > 0) {
 6376|  68.7k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 68.0k, False: 753]
  |  Branch (6376:44): [True: 50.0k, False: 17.9k]
  |  Branch (6376:60): [True: 42.1k, False: 7.90k]
  |  Branch (6376:76): [True: 30.0k, False: 12.1k]
  ------------------
 6377|  38.0k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 9.43k, False: 28.5k]
  |  Branch (6377:60): [True: 1.80k, False: 7.62k]
  |  Branch (6377:76): [True: 328, False: 1.47k]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  30.3k|                     const auto after_true = it + 4;
 6380|  30.3k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  30.3k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 8.46k, False: 21.8k]
  ------------------
 6383|  8.46k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 0, False: 8.46k]
  ------------------
 6384|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|      0|                           return;
 6386|      0|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  8.46k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 7.12k, False: 1.34k]
  |  Branch (6389:47): [True: 3.55k, False: 3.57k]
  ------------------
 6390|  3.55k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 829, False: 2.72k]
  |  Branch (6390:47): [True: 378, False: 2.34k]
  |  Branch (6390:63): [True: 902, False: 1.44k]
  |  Branch (6390:80): [True: 448, False: 995]
  |  Branch (6390:97): [True: 995, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  3.55k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  3.55k|                           return;
 6394|  3.55k|                        }
 6395|  4.91k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  4.91k|                                                                                                      end);
 6397|  4.91k|                        return;
 6398|  8.46k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  30.3k|                  }
 6401|  68.7k|               }
 6402|  60.3k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  68.7k|               return;
 6404|   114k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 114k, False: 6.53M]
  ------------------
 6405|   143k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 29.1k, False: 6.61M]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|   143k|               if constexpr (counts::n_bool > 0) {
 6408|   143k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 141k, False: 2.75k]
  |  Branch (6408:44): [True: 70.2k, False: 70.9k]
  |  Branch (6408:60): [True: 53.8k, False: 16.4k]
  |  Branch (6408:76): [True: 51.3k, False: 2.47k]
  |  Branch (6408:92): [True: 39.9k, False: 11.4k]
  ------------------
 6409|   101k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 18.1k, False: 83.2k]
  |  Branch (6409:60): [True: 13.8k, False: 4.30k]
  |  Branch (6409:76): [True: 12.3k, False: 1.43k]
  |  Branch (6409:92): [True: 8.90k, False: 3.48k]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  48.8k|                     const auto after_false = it + 5;
 6412|  48.8k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  48.8k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 44.0k, False: 4.79k]
  ------------------
 6415|  44.0k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 0, False: 44.0k]
  ------------------
 6416|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|      0|                           return;
 6418|      0|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  44.0k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 38.6k, False: 5.34k]
  |  Branch (6421:47): [True: 29.2k, False: 9.37k]
  ------------------
 6422|  29.2k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 415, False: 28.8k]
  |  Branch (6422:47): [True: 1.00k, False: 27.8k]
  |  Branch (6422:63): [True: 701, False: 27.1k]
  |  Branch (6422:80): [True: 3.90k, False: 23.2k]
  |  Branch (6422:97): [True: 23.2k, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  29.2k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  29.2k|                           return;
 6426|  29.2k|                        }
 6427|  14.7k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  14.7k|                                                                                                      end);
 6429|  14.7k|                        return;
 6430|  44.0k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  48.8k|                  }
 6433|   143k|               }
 6434|  99.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|   143k|               return;
 6436|  76.1k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 76.1k, False: 6.57M]
  ------------------
 6437|  94.8k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 18.7k, False: 6.62M]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  94.8k|               if constexpr (counts::n_null > 0) {
 6440|  94.8k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 91.4k, False: 3.39k]
  |  Branch (6440:44): [True: 45.4k, False: 46.0k]
  |  Branch (6440:60): [True: 42.7k, False: 2.69k]
  |  Branch (6440:76): [True: 35.6k, False: 7.08k]
  ------------------
 6441|  55.8k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 2.51k, False: 53.3k]
  |  Branch (6441:60): [True: 2.02k, False: 490]
  |  Branch (6441:76): [True: 1.39k, False: 633]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  37.0k|                     const auto after_null = it + 4;
 6444|  37.0k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  37.0k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 31.9k, False: 5.08k]
  ------------------
 6447|  31.9k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 0, False: 31.9k]
  ------------------
 6448|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|      0|                           return;
 6450|      0|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  31.9k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 31.5k, False: 420]
  |  Branch (6453:47): [True: 26.9k, False: 4.59k]
  ------------------
 6454|  26.9k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 41, False: 26.9k]
  |  Branch (6454:47): [True: 698, False: 26.2k]
  |  Branch (6454:63): [True: 25.2k, False: 977]
  |  Branch (6454:80): [True: 365, False: 612]
  |  Branch (6454:97): [True: 612, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  26.9k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  26.9k|                           return;
 6458|  26.9k|                        }
 6459|  5.01k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  5.01k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  5.01k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 5.01k]
  ------------------
 6462|  5.01k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  5.01k|                        return;
 6464|  31.9k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  37.0k|                  }
 6467|  94.8k|               }
 6468|  62.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  94.8k|               return;
 6470|  4.35k|            case '~':
  ------------------
  |  Branch (6470:13): [True: 4.35k, False: 6.64M]
  ------------------
 6471|       |               // Null indicator
 6472|  4.35k|               if constexpr (counts::n_null > 0) {
 6473|  4.35k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|  4.35k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|  4.35k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 4.35k]
  ------------------
 6476|  4.35k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|  4.35k|                  return;
 6478|  4.35k|               }
 6479|      0|               break; // Fall through to try other types
 6480|   748k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 748k, False: 5.89M]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|   748k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 3.93k, False: 745k]
  |  Branch (6482:41): [True: 605k, False: 139k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|   609k|                  if constexpr (counts::n_array > 0) {
 6485|   609k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|   609k|                                                                                                    end);
 6487|   609k|                     return;
 6488|   609k|                  }
 6489|   609k|               }
 6490|   748k|               if constexpr (counts::n_num > 0) {
 6491|   748k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 139k, False: 609k]
  |  Branch (6491:43): [True: 7.34k, False: 132k]
  |  Branch (6491:94): [True: 54.3k, False: 77.6k]
  ------------------
 6492|  61.7k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|  61.7k|                     return;
 6494|  61.7k|                  }
 6495|   748k|               }
 6496|   687k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|   748k|               return;
 6498|  62.7k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 62.7k, False: 6.58M]
  ------------------
 6499|  94.3k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 31.5k, False: 6.61M]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  94.3k|               if constexpr (counts::n_num > 0) {
 6503|  94.3k|                  auto start_it = it;
 6504|  94.3k|                  auto temp_ctx = ctx.make_speculative();
 6505|  94.3k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  94.3k|                                                                                               end);
 6507|  94.3k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  94.3k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  94.3k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 7.89k, False: 86.4k]
  ------------------
 6510|  7.89k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  7.89k|                     return; // Successfully parsed as number
 6512|  7.89k|                  }
 6513|  86.4k|                  it = start_it; // Restore and fall through to string
 6514|  86.4k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  94.3k|               return;
 6517|  1.13M|            default:
  ------------------
  |  Branch (6517:13): [True: 1.13M, False: 5.50M]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|  1.13M|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 604k, False: 533k]
  |  Branch (6519:32): [True: 227k, False: 376k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|   227k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 13.6k, False: 214k]
  ------------------
 6522|  13.6k|                     return;
 6523|  13.6k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|   214k|                  if constexpr (counts::n_num > 0) {
 6526|   214k|                     auto start_it = it;
 6527|   214k|                     auto temp_ctx = ctx.make_speculative();
 6528|   214k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|   214k|                                                                                                  end);
 6530|   214k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|   214k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|   214k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 104k, False: 109k]
  ------------------
 6533|   104k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|   104k|                        return; // Successfully parsed as number
 6535|   104k|                     }
 6536|   109k|                     it = start_it; // Restore and fall through to string
 6537|   109k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|   214k|                  return;
 6541|   227k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   909k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   909k|               return;
 6545|  6.64M|            }
 6546|  6.64M|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|  6.64M|         error_code expansion_error{};
 6556|  6.64M|         std::string_view expansion_message{};
 6557|       |
 6558|  6.64M|         auto try_parse = [&]<size_t I>() -> bool {
 6559|  6.64M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|  6.64M|            auto start = it;
 6561|       |
 6562|  6.64M|            V v{};
 6563|  6.64M|            auto temp_ctx = ctx.make_speculative();
 6564|  6.64M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|  6.64M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|  6.64M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|  6.64M|            if (!bool(temp_ctx.error)) {
 6569|  6.64M|               value = std::move(v);
 6570|  6.64M|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|  6.64M|               return true;
 6572|  6.64M|            }
 6573|       |
 6574|  6.64M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|  6.64M|               expansion_error = temp_ctx.error;
 6576|  6.64M|               expansion_message = temp_ctx.custom_error_message;
 6577|  6.64M|            }
 6578|  6.64M|            it = start;
 6579|  6.64M|            return false;
 6580|  6.64M|         };
 6581|       |
 6582|  6.64M|         bool parsed = false;
 6583|  6.64M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|  6.64M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|  6.64M|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|  6.64M|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 6.64M]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|  6.64M|      }
_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|  1.08M|      {
  301|  1.08M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.08M]
  |  Branch (301:27): [True: 0, False: 1.08M]
  ------------------
  302|       |
  303|  1.08M|         ++it; // skip '*'
  304|  1.08M|         auto name = parse_anchor_name(it, end);
  305|  1.08M|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 192, False: 1.08M]
  ------------------
  306|    192|            ctx.error = error_code::syntax_error;
  307|    192|            return true;
  308|    192|         }
  309|       |
  310|  1.08M|         auto anchor_it = ctx.anchors.find(name);
  311|  1.08M|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 2.20k, False: 1.08M]
  ------------------
  312|  2.20k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  2.20k|            return true;
  314|  2.20k|         }
  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.08M|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.08M|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 11.3k, False: 1.07M]
  ------------------
  322|  11.3k|            return true;
  323|  11.3k|         }
  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.07M|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 29, False: 1.07M]
  ------------------
  329|     29|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     29|            return true;
  331|     29|         }
  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.07M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.07M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 1.07M]
  ------------------
  339|      2|            return true;
  340|       |
  341|  1.07M|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 14, False: 1.07M]
  ------------------
  342|     14|            ctx.error = error_code::exceeded_max_expansion;
  343|     14|            ctx.custom_error_message = "alias expansion";
  344|     14|            return true;
  345|     14|         }
  346|       |
  347|  1.07M|         auto replay_it = span.begin;
  348|  1.07M|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.07M|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.07M|         ctx.indent_stack.clear();
  353|  1.07M|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 29.7k, False: 1.04M]
  ------------------
  354|  29.7k|            ctx.push_indent(span.base_indent - 1);
  355|  29.7k|         }
  356|       |
  357|  1.07M|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.07M|         using V = std::remove_cvref_t<T>;
  360|  1.07M|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.07M|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.07M|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.07M|         return true;
  367|  1.07M|      }
_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_:
 5205|  1.26M|      {
 5206|  1.26M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  1.26M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  1.26M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  1.26M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  1.26M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 1.26M, False: 0]
  ------------------
 5216|  1.26M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  1.26M|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1892|  1.30M|      {
 1893|  1.30M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 4.97k, False: 1.30M]
  ------------------
 1894|  4.97k|            return;
 1895|       |
 1896|  1.30M|         yaml::node_preamble_state preamble{};
 1897|  1.30M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 48.7k, False: 1.25M]
  ------------------
 1898|  1.30M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  48.7k|            return;
 1900|       |
 1901|  1.25M|         std::string str;
 1902|  1.25M|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|  1.25M|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 1.25M, False: 0]
  ------------------
 1905|  4.94k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 4.94k, False: 1.24M]
  ------------------
 1906|  4.94k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|  4.94k|            break;
 1908|  7.75k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 7.75k, False: 1.24M]
  ------------------
 1909|  7.75k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  7.75k|            break;
 1911|  1.39k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 1.39k, False: 1.25M]
  ------------------
 1912|  7.75k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 6.35k, False: 1.24M]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  7.75k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  7.75k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 1.07k, False: 6.67k]
  ------------------
 1918|  7.75k|            break;
 1919|  1.23M|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 1.23M, False: 20.4k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|       |               if (ctx.current_indent() >= 0) {
 1924|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|       |               }
 1926|       |               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|       |               }
 1930|       |            }
 1931|  1.23M|            else {
 1932|  1.23M|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|  1.23M|            }
 1934|  1.23M|            break;
 1935|  1.25M|         }
 1936|       |
 1937|  1.25M|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 1.25M, False: 464]
  ------------------
 1938|  1.25M|            value = std::move(str);
 1939|  1.25M|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|  1.25M|         }
 1941|  1.25M|      }
_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|  1.30M|      {
  466|  1.30M|         skip_inline_ws(it, end);
  467|       |
  468|  1.30M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 6, False: 1.30M]
  ------------------
  469|      6|            if constexpr (!AllowEmptyInput) {
  470|      6|               ctx.error = error_code::unexpected_end;
  471|      6|            }
  472|      6|            return true;
  473|      6|         }
  474|       |
  475|  1.30M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  1.30M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 24, False: 1.30M]
  ------------------
  477|     24|            ctx.error = error_code::syntax_error;
  478|     24|            return true;
  479|     24|         }
  480|  1.30M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 5, False: 1.30M]
  ------------------
  481|      5|            ctx.error = error_code::syntax_error;
  482|      5|            return true;
  483|      5|         }
  484|       |
  485|  1.30M|         skip_inline_ws(it, end);
  486|       |
  487|  1.30M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 14, False: 1.30M]
  ------------------
  488|     14|            if constexpr (!AllowEmptyInput) {
  489|     14|               ctx.error = error_code::unexpected_end;
  490|     14|            }
  491|     14|            return true;
  492|     14|         }
  493|       |
  494|  1.30M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 48.7k, False: 1.25M]
  ------------------
  495|  48.7k|            return true;
  496|  48.7k|         }
  497|       |
  498|  1.25M|         return false;
  499|  1.30M|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1898|  1.30M|                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|  1.30M|      {
  409|  1.30M|         state.has_anchor = false;
  410|  1.30M|         state.anchor_name.clear();
  411|  1.30M|         state.anchor_start = nullptr;
  412|  1.30M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  1.30M|         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.30M|            else {
  421|  1.30M|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 48.6k, False: 1.25M]
  ------------------
  422|  1.30M|            }
  423|  1.30M|         }
  424|       |
  425|  1.30M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 1.25M, False: 48.6k]
  |  Branch (425:27): [True: 20.3k, False: 1.23M]
  ------------------
  426|  20.3k|            ++it;
  427|  20.3k|            auto name = parse_anchor_name(it, end);
  428|  20.3k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 11, False: 20.3k]
  ------------------
  429|     11|               ctx.error = error_code::syntax_error;
  430|     11|               return true;
  431|     11|            }
  432|  20.3k|            skip_inline_ws(it, end);
  433|  20.3k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 24, False: 20.3k]
  ------------------
  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|  20.3k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  20.3k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 17, False: 20.3k]
  ------------------
  441|     17|                  ctx.error = error_code::syntax_error;
  442|     17|                  return true;
  443|     17|               }
  444|  20.3k|            }
  445|  20.3k|            state.has_anchor = true;
  446|  20.3k|            state.anchor_name = std::string(name);
  447|  20.3k|            state.anchor_start = &*it;
  448|  20.3k|         }
  449|       |
  450|  1.30M|         return false;
  451|  1.30M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|  1.30M|      {
  301|  1.30M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 1.30M]
  |  Branch (301:27): [True: 1.25M, False: 48.6k]
  ------------------
  302|       |
  303|  48.6k|         ++it; // skip '*'
  304|  48.6k|         auto name = parse_anchor_name(it, end);
  305|  48.6k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 10, False: 48.6k]
  ------------------
  306|     10|            ctx.error = error_code::syntax_error;
  307|     10|            return true;
  308|     10|         }
  309|       |
  310|  48.6k|         auto anchor_it = ctx.anchors.find(name);
  311|  48.6k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 43, False: 48.6k]
  ------------------
  312|     43|            ctx.error = error_code::syntax_error; // undefined alias
  313|     43|            return true;
  314|     43|         }
  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|  48.6k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  48.6k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 2.50k, False: 46.1k]
  ------------------
  322|  2.50k|            return true;
  323|  2.50k|         }
  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|  46.1k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 7, False: 46.1k]
  ------------------
  329|      7|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      7|            return true;
  331|      7|         }
  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|  46.1k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  46.1k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 46.1k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  46.1k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 46.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|  46.1k|         auto replay_it = span.begin;
  348|  46.1k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  46.1k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  46.1k|         ctx.indent_stack.clear();
  353|  46.1k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.91k, False: 43.1k]
  ------------------
  354|  2.91k|            ctx.push_indent(span.base_indent - 1);
  355|  2.91k|         }
  356|       |
  357|  46.1k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  46.1k|         using V = std::remove_cvref_t<T>;
  360|  46.1k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  46.1k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  46.1k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  46.1k|         return true;
  367|  46.1k|      }
_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_:
 5205|   379k|      {
 5206|   379k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   379k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   379k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   379k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   379k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 379k, False: 0]
  ------------------
 5216|   379k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   379k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2047|   382k|      {
 2048|   382k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 382k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|   382k|         yaml::node_preamble_state preamble{};
 2052|   382k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 6.07k, False: 376k]
  ------------------
 2053|   382k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   382k|                   return yaml::tag_valid_for_float(tag);
 2055|   382k|                }
 2056|   382k|                else {
 2057|   382k|                   return yaml::tag_valid_for_int(tag);
 2058|   382k|                }
 2059|   382k|             }))
 2060|  6.07k|            return;
 2061|       |
 2062|   376k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|   376k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|   376k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|   376k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 32.3k, False: 343k]
  ------------------
 2070|  32.3k|               ++it;
 2071|  32.3k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 30.5k, False: 1.79k]
  |  Branch (2071:38): [True: 2.30k, False: 28.2k]
  |  Branch (2071:74): [True: 822, False: 27.4k]
  ------------------
 2072|  27.4k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 425, False: 27.0k]
  ------------------
 2073|  3.55k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  3.55k|                  it += 3;
 2075|  3.55k|                  finalize();
 2076|  3.55k|                  return;
 2077|  3.55k|               }
 2078|  28.8k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 27.0k, False: 1.79k]
  |  Branch (2078:38): [True: 675, False: 26.3k]
  |  Branch (2078:74): [True: 1.25k, False: 25.1k]
  ------------------
 2079|  25.1k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 1.14k, False: 23.9k]
  ------------------
 2080|  3.07k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  3.07k|                  it += 3;
 2082|  3.07k|                  finalize();
 2083|  3.07k|                  return;
 2084|  3.07k|               }
 2085|  25.7k|               it = start;
 2086|  25.7k|            }
 2087|       |
 2088|   369k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 63.9k, False: 305k]
  |  Branch (2088:31): [True: 62.7k, False: 242k]
  ------------------
 2089|   126k|               const char sign = *it;
 2090|   126k|               ++it;
 2091|   126k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 125k, False: 798]
  |  Branch (2091:33): [True: 66.7k, False: 59.2k]
  ------------------
 2092|  66.7k|                  ++it;
 2093|  66.7k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 64.6k, False: 2.03k]
  |  Branch (2093:41): [True: 53.4k, False: 11.2k]
  |  Branch (2093:77): [True: 2.83k, False: 8.36k]
  ------------------
 2094|  57.0k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 688, False: 7.67k]
  ------------------
 2095|  57.0k|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 55.9k, False: 1.03k]
  ------------------
 2096|  55.9k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|  55.9k|                     }
 2098|  1.03k|                     else {
 2099|  1.03k|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|  1.03k|                     }
 2101|  57.0k|                     it += 3;
 2102|  57.0k|                     finalize();
 2103|  57.0k|                     return;
 2104|  57.0k|                  }
 2105|  66.7k|               }
 2106|  69.7k|               it = start;
 2107|  69.7k|            }
 2108|   369k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|   312k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  31.0M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 31.0M, False: 78.0k]
  ------------------
 2115|  31.0M|            const char c = *it;
 2116|  31.0M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 89.7k, False: 30.9M]
  |  Branch (2116:29): [True: 70.8k, False: 30.8M]
  |  Branch (2116:42): [True: 9.81k, False: 30.8M]
  |  Branch (2116:55): [True: 57.3k, False: 30.7M]
  |  Branch (2116:68): [True: 25.3k, False: 30.7M]
  |  Branch (2116:80): [True: 3.54k, False: 30.7M]
  |  Branch (2116:92): [True: 8.03k, False: 30.7M]
  |  Branch (2116:104): [True: 25.1k, False: 30.7M]
  ------------------
 2117|   289k|               break;
 2118|   289k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  30.7M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 49.9k, False: 30.6M]
  ------------------
 2121|  49.9k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 590, False: 49.4k]
  |  Branch (2121:39): [True: 2.12k, False: 47.2k]
  |  Branch (2121:59): [True: 797, False: 46.4k]
  |  Branch (2121:80): [True: 3.24k, False: 43.2k]
  |  Branch (2121:101): [True: 1.72k, False: 41.5k]
  ------------------
 2122|  8.47k|                  break;
 2123|  8.47k|               }
 2124|  49.9k|            }
 2125|  30.7M|            ++it;
 2126|  30.7M|         }
 2127|       |
 2128|   376k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|   376k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 1.13k, False: 375k]
  ------------------
 2131|  1.13k|            ctx.error = error_code::parse_number_failure;
 2132|  1.13k|            return;
 2133|  1.13k|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|   375k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|   375k|            bool negative = false;
 2186|   375k|            std::string_view digits = num_str;
 2187|       |
 2188|   375k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 311k, False: 63.6k]
  |  Branch (2188:37): [True: 61.7k, False: 249k]
  |  Branch (2188:62): [True: 8.00k, False: 241k]
  ------------------
 2189|  69.7k|               negative = (digits.front() == '-');
 2190|  69.7k|               digits.remove_prefix(1);
 2191|  69.7k|            }
 2192|       |
 2193|   375k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 215k, False: 159k]
  |  Branch (2193:38): [True: 81.5k, False: 133k]
  ------------------
 2194|  81.5k|               int base = 10;
 2195|  81.5k|               size_t offset = 0;
 2196|       |
 2197|  81.5k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 5.08k, False: 76.4k]
  |  Branch (2197:40): [True: 357, False: 76.0k]
  ------------------
 2198|  5.44k|                  base = 16;
 2199|  5.44k|                  offset = 2;
 2200|  5.44k|               }
 2201|  76.0k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 1.73k, False: 74.3k]
  |  Branch (2201:45): [True: 1.78k, False: 72.5k]
  ------------------
 2202|  3.51k|                  base = 8;
 2203|  3.51k|                  offset = 2;
 2204|  3.51k|               }
 2205|  72.5k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 3.30k, False: 69.2k]
  |  Branch (2205:45): [True: 858, False: 68.4k]
  ------------------
 2206|  4.16k|                  base = 2;
 2207|  4.16k|                  offset = 2;
 2208|  4.16k|               }
 2209|       |
 2210|  81.5k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 13.1k, False: 68.4k]
  ------------------
 2211|  13.1k|                  auto raw_digits = digits.substr(offset);
 2212|  13.1k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  13.1k|                  std::string clean_storage;
 2215|  13.1k|                  std::string_view clean_view;
 2216|  13.1k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 3.17k, False: 9.94k]
  ------------------
 2217|  3.17k|                     clean_storage.reserve(raw_digits.size());
 2218|  3.73M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 3.73M, False: 3.17k]
  ------------------
 2219|  3.73M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 3.72M, False: 6.20k]
  ------------------
 2220|  3.72M|                           clean_storage.push_back(c);
 2221|  3.72M|                        }
 2222|  3.73M|                     }
 2223|  3.17k|                     clean_view = clean_storage;
 2224|  3.17k|                  }
 2225|  9.94k|                  else {
 2226|  9.94k|                     clean_view = raw_digits;
 2227|  9.94k|                  }
 2228|       |
 2229|  13.1k|                  uint64_t parsed_int{};
 2230|  13.1k|                  auto [ptr, ec] =
 2231|  13.1k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  13.1k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 4.90k, False: 8.22k]
  |  Branch (2232:44): [True: 3.53k, False: 4.68k]
  ------------------
 2233|  8.43k|                     ctx.error = error_code::parse_number_failure;
 2234|  8.43k|                     finalize();
 2235|  8.43k|                     return;
 2236|  8.43k|                  }
 2237|       |
 2238|  4.68k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  4.68k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 3.30k, False: 1.37k]
  ------------------
 2240|  4.68k|                  finalize();
 2241|  4.68k|                  return;
 2242|  13.1k|               }
 2243|  81.5k|            }
 2244|   375k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|   361k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|   375k|         std::string clean_storage;
 2250|   375k|         std::string_view clean_view;
 2251|       |
 2252|   375k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 4.06k, False: 370k]
  ------------------
 2253|  4.06k|            clean_storage.reserve(num_str.size());
 2254|  18.9M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 18.9M, False: 4.06k]
  ------------------
 2255|  18.9M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 18.9M, False: 20.5k]
  ------------------
 2256|  18.9M|                  clean_storage.push_back(c);
 2257|  18.9M|               }
 2258|  18.9M|            }
 2259|  4.06k|            clean_view = clean_storage;
 2260|  4.06k|         }
 2261|   370k|         else {
 2262|   370k|            clean_view = num_str;
 2263|   370k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|   375k|         auto parse_view = clean_view;
 2268|   375k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 298k, False: 76.9k]
  |  Branch (2268:37): [True: 61.7k, False: 236k]
  ------------------
 2269|  61.7k|            parse_view.remove_prefix(1);
 2270|  61.7k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 16.8k, False: 44.8k]
  ------------------
 2271|  16.8k|               ctx.error = error_code::parse_number_failure;
 2272|  16.8k|               return;
 2273|  16.8k|            }
 2274|  61.7k|         }
 2275|       |
 2276|   358k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|   358k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|   358k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 142k, False: 215k]
  |  Branch (2279:45): [True: 101k, False: 114k]
  ------------------
 2280|   167k|               ctx.error = error_code::parse_number_failure;
 2281|   167k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|   358k|         finalize();
 2292|   358k|      }
_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|   382k|      {
  466|   382k|         skip_inline_ws(it, end);
  467|       |
  468|   382k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 446, False: 381k]
  ------------------
  469|    446|            if constexpr (!AllowEmptyInput) {
  470|    446|               ctx.error = error_code::unexpected_end;
  471|    446|            }
  472|    446|            return true;
  473|    446|         }
  474|       |
  475|   381k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   381k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 205, False: 381k]
  ------------------
  477|    205|            ctx.error = error_code::syntax_error;
  478|    205|            return true;
  479|    205|         }
  480|   381k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 193, False: 381k]
  ------------------
  481|    193|            ctx.error = error_code::syntax_error;
  482|    193|            return true;
  483|    193|         }
  484|       |
  485|   381k|         skip_inline_ws(it, end);
  486|       |
  487|   381k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 182, False: 381k]
  ------------------
  488|    182|            if constexpr (!AllowEmptyInput) {
  489|    182|               ctx.error = error_code::unexpected_end;
  490|    182|            }
  491|    182|            return true;
  492|    182|         }
  493|       |
  494|   381k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.04k, False: 376k]
  ------------------
  495|  5.04k|            return true;
  496|  5.04k|         }
  497|       |
  498|   376k|         return false;
  499|   381k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2052|   381k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|   381k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   381k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|   381k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   381k|      {
  409|   381k|         state.has_anchor = false;
  410|   381k|         state.anchor_name.clear();
  411|   381k|         state.anchor_start = nullptr;
  412|   381k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   381k|         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|   381k|            else {
  421|   381k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 4.70k, False: 376k]
  ------------------
  422|   381k|            }
  423|   381k|         }
  424|       |
  425|   381k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 376k, False: 4.70k]
  |  Branch (425:27): [True: 7.10k, False: 369k]
  ------------------
  426|  7.10k|            ++it;
  427|  7.10k|            auto name = parse_anchor_name(it, end);
  428|  7.10k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 171, False: 6.93k]
  ------------------
  429|    171|               ctx.error = error_code::syntax_error;
  430|    171|               return true;
  431|    171|            }
  432|  6.93k|            skip_inline_ws(it, end);
  433|  6.93k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 170, False: 6.76k]
  ------------------
  434|    170|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    170|                  ctx.error = error_code::unexpected_end;
  436|    170|               }
  437|    170|               return true;
  438|    170|            }
  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.76k|            state.has_anchor = true;
  446|  6.76k|            state.anchor_name = std::string(name);
  447|  6.76k|            state.anchor_start = &*it;
  448|  6.76k|         }
  449|       |
  450|   380k|         return false;
  451|   381k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   381k|      {
  301|   381k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 381k]
  |  Branch (301:27): [True: 376k, False: 4.70k]
  ------------------
  302|       |
  303|  4.70k|         ++it; // skip '*'
  304|  4.70k|         auto name = parse_anchor_name(it, end);
  305|  4.70k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 200, False: 4.50k]
  ------------------
  306|    200|            ctx.error = error_code::syntax_error;
  307|    200|            return true;
  308|    200|         }
  309|       |
  310|  4.50k|         auto anchor_it = ctx.anchors.find(name);
  311|  4.50k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 744, False: 3.76k]
  ------------------
  312|    744|            ctx.error = error_code::syntax_error; // undefined alias
  313|    744|            return true;
  314|    744|         }
  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.76k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.76k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 710, False: 3.05k]
  ------------------
  322|    710|            return true;
  323|    710|         }
  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.05k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 3, False: 3.04k]
  ------------------
  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|  3.04k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  3.04k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 3.04k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  3.04k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 3.04k]
  ------------------
  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.04k|         auto replay_it = span.begin;
  348|  3.04k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  3.04k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  3.04k|         ctx.indent_stack.clear();
  353|  3.04k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 404, False: 2.64k]
  ------------------
  354|    404|            ctx.push_indent(span.base_indent - 1);
  355|    404|         }
  356|       |
  357|  3.04k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  3.04k|         using V = std::remove_cvref_t<T>;
  360|  3.04k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  3.04k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  3.04k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  3.04k|         return true;
  367|  3.04k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|   358k|         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_:
 5205|  46.9k|      {
 5206|  46.9k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  46.9k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  46.9k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  46.9k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  46.9k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 46.9k, False: 0]
  ------------------
 5216|  46.9k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  46.9k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2012|  60.5k|      {
 2013|  60.5k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 60.5k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  60.5k|         yaml::node_preamble_state preamble{};
 2017|  60.5k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 15.5k, False: 44.9k]
  ------------------
 2018|  60.5k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|  15.5k|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  44.9k|         std::string str;
 2023|  44.9k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  44.9k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 3.10k, False: 41.8k]
  |  Branch (2025:31): [True: 1.52k, False: 40.3k]
  |  Branch (2025:48): [True: 281, False: 40.0k]
  |  Branch (2025:65): [True: 534, False: 39.5k]
  |  Branch (2025:81): [True: 1.82k, False: 37.7k]
  |  Branch (2025:97): [True: 691, False: 37.0k]
  ------------------
 2026|  37.0k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 1.19k, False: 35.8k]
  |  Branch (2026:29): [True: 160, False: 35.6k]
  |  Branch (2026:44): [True: 877, False: 34.8k]
  ------------------
 2027|  10.1k|            value = true;
 2028|  10.1k|         }
 2029|  34.8k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 20.0k, False: 14.7k]
  |  Branch (2029:37): [True: 617, False: 14.0k]
  |  Branch (2029:55): [True: 6.39k, False: 7.69k]
  |  Branch (2029:73): [True: 694, False: 7.00k]
  |  Branch (2029:88): [True: 957, False: 6.04k]
  |  Branch (2029:103): [True: 4.16k, False: 1.88k]
  ------------------
 2030|  34.5k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 698, False: 1.18k]
  |  Branch (2030:35): [True: 463, False: 725]
  |  Branch (2030:51): [True: 454, False: 271]
  ------------------
 2031|  34.5k|            value = false;
 2032|  34.5k|         }
 2033|    271|         else {
 2034|    271|            ctx.error = error_code::expected_true_or_false;
 2035|    271|         }
 2036|       |
 2037|  44.9k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  44.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|  60.5k|      {
  466|  60.5k|         skip_inline_ws(it, end);
  467|       |
  468|  60.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 5, False: 60.5k]
  ------------------
  469|      5|            if constexpr (!AllowEmptyInput) {
  470|      5|               ctx.error = error_code::unexpected_end;
  471|      5|            }
  472|      5|            return true;
  473|      5|         }
  474|       |
  475|  60.5k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  60.5k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 7, False: 60.5k]
  ------------------
  477|      7|            ctx.error = error_code::syntax_error;
  478|      7|            return true;
  479|      7|         }
  480|  60.5k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 60.5k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|  60.5k|         skip_inline_ws(it, end);
  486|       |
  487|  60.5k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 60.5k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|  60.5k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 15.5k, False: 44.9k]
  ------------------
  495|  15.5k|            return true;
  496|  15.5k|         }
  497|       |
  498|  44.9k|         return false;
  499|  60.5k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2018|  60.5k|                                             [](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|  60.5k|      {
  409|  60.5k|         state.has_anchor = false;
  410|  60.5k|         state.anchor_name.clear();
  411|  60.5k|         state.anchor_start = nullptr;
  412|  60.5k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  60.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|  60.5k|            else {
  421|  60.5k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 15.5k, False: 45.0k]
  ------------------
  422|  60.5k|            }
  423|  60.5k|         }
  424|       |
  425|  60.5k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 45.0k, False: 15.5k]
  |  Branch (425:27): [True: 12.6k, False: 32.3k]
  ------------------
  426|  12.6k|            ++it;
  427|  12.6k|            auto name = parse_anchor_name(it, end);
  428|  12.6k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 12.6k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  12.6k|            skip_inline_ws(it, end);
  433|  12.6k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 17, False: 12.6k]
  ------------------
  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|  12.6k|            state.has_anchor = true;
  446|  12.6k|            state.anchor_name = std::string(name);
  447|  12.6k|            state.anchor_start = &*it;
  448|  12.6k|         }
  449|       |
  450|  60.4k|         return false;
  451|  60.5k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  60.5k|      {
  301|  60.5k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 60.5k]
  |  Branch (301:27): [True: 45.0k, False: 15.5k]
  ------------------
  302|       |
  303|  15.5k|         ++it; // skip '*'
  304|  15.5k|         auto name = parse_anchor_name(it, end);
  305|  15.5k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 14, False: 15.4k]
  ------------------
  306|     14|            ctx.error = error_code::syntax_error;
  307|     14|            return true;
  308|     14|         }
  309|       |
  310|  15.4k|         auto anchor_it = ctx.anchors.find(name);
  311|  15.4k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 47, False: 15.4k]
  ------------------
  312|     47|            ctx.error = error_code::syntax_error; // undefined alias
  313|     47|            return true;
  314|     47|         }
  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.4k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  15.4k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.88k, False: 13.5k]
  ------------------
  322|  1.88k|            return true;
  323|  1.88k|         }
  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|  13.5k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 11, False: 13.5k]
  ------------------
  329|     11|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     11|            return true;
  331|     11|         }
  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|  13.5k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  13.5k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 13.5k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  13.5k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 13.5k]
  ------------------
  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|  13.5k|         auto replay_it = span.begin;
  348|  13.5k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  13.5k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  13.5k|         ctx.indent_stack.clear();
  353|  13.5k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 993, False: 12.5k]
  ------------------
  354|    993|            ctx.push_indent(span.base_indent - 1);
  355|    993|         }
  356|       |
  357|  13.5k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  13.5k|         using V = std::remove_cvref_t<T>;
  360|  13.5k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  13.5k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  13.5k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  13.5k|         return true;
  367|  13.5k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2398|  11.2k|      {
 2399|  11.2k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 11.2k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  11.2k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  11.2k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 4, False: 11.2k]
  ------------------
 2405|      4|            ctx.error = error_code::unexpected_end;
 2406|      4|            return;
 2407|      4|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  11.2k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 4.35k, False: 6.89k]
  ------------------
 2411|  4.35k|            ++it;
 2412|  4.35k|            return;
 2413|  4.35k|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  6.89k|         auto start = it;
 2417|   108k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 107k, False: 433]
  |  Branch (2417:30): [True: 101k, False: 6.46k]
  ------------------
 2418|   101k|            ++it;
 2419|   101k|         }
 2420|       |
 2421|  6.89k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  6.89k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 74, False: 6.82k]
  ------------------
 2423|     74|            ctx.error = error_code::syntax_error;
 2424|     74|         }
 2425|  6.89k|      }
_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_:
 5205|  2.00M|      {
 5206|  2.00M|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  2.00M|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  2.00M|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  2.00M|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  2.00M|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 2.00M, False: 0]
  ------------------
 5216|  2.00M|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  2.00M|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4515|  2.02M|      {
 4516|  2.02M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 2.02M]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|  2.02M|         yaml::node_preamble_state preamble{};
 4520|  2.02M|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 11.5k, False: 2.00M]
  ------------------
 4521|  2.02M|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  11.5k|            return;
 4523|       |
 4524|  2.00M|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|  2.00M|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|  2.00M|         std::remove_cvref_t<T> preexisting_entries;
 4538|  2.00M|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 2.00M]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|  2.00M|         struct merge_restore_guard
 4543|  2.00M|         {
 4544|  2.00M|            std::remove_cvref_t<T>& target;
 4545|  2.00M|            std::remove_cvref_t<T>& saved;
 4546|  2.00M|            ~merge_restore_guard()
 4547|  2.00M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  2.00M|               for (auto& entry : saved) {
 4551|  2.00M|                  target.emplace(entry.first, std::move(entry.second));
 4552|  2.00M|               }
 4553|  2.00M|            }
 4554|  2.00M|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|  2.00M|         const bool treat_as_block_mapping =
 4557|  2.00M|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [Folded, False: 2.00M]
  |  Branch (4557:48): [True: 0, False: 0]
  |  Branch (4557:62): [True: 0, False: 0]
  ------------------
 4558|       |
 4559|  2.00M|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 1.35M, False: 655k]
  |  Branch (4559:28): [True: 0, Folded]
  ------------------
 4560|       |            // Flow mapping
 4561|  1.35M|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|  1.35M|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|  1.35M|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 1.35M, False: 2.63k]
  |  Branch (4565:30): [True: 26.4k, False: 1.32M]
  ------------------
 4566|  26.4k|               ++it;
 4567|  26.4k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  26.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 17, False: 26.4k]
  ------------------
 4569|     17|                  return;
 4570|  26.4k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  26.4k|               return;
 4572|  26.4k|            }
 4573|       |
 4574|  7.08M|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 7.08M, False: 5.05k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|  7.08M|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|  7.08M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 7.08M, False: 0]
  |  Branch (4578:33): [True: 58.2k, False: 7.02M]
  ------------------
 4579|  58.2k|                  ++it;
 4580|  58.2k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|  58.2k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 50, False: 58.1k]
  ------------------
 4582|     50|                     return;
 4583|  58.1k|                  break;
 4584|  58.2k|               }
 4585|       |
 4586|  7.02M|               bool explicit_flow_key = false;
 4587|  7.02M|               auto explicit_probe = it;
 4588|  7.02M|               yaml::skip_inline_ws(explicit_probe, end);
 4589|  7.02M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 7.02M, False: 0]
  |  Branch (4589:45): [True: 122k, False: 6.90M]
  ------------------
 4590|   122k|                  const auto after_q = explicit_probe + 1;
 4591|   122k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 7, False: 122k]
  |  Branch (4591:41): [True: 55.1k, False: 66.8k]
  ------------------
 4592|  66.8k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 10.7k, False: 56.1k]
  |  Branch (4592:42): [True: 650, False: 55.4k]
  ------------------
 4593|  66.5k|                     explicit_flow_key = true;
 4594|  66.5k|                     it = explicit_probe + 1;
 4595|  66.5k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  66.5k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 6, False: 66.5k]
  ------------------
 4597|      6|                        return;
 4598|  66.5k|                  }
 4599|   122k|               }
 4600|       |               // Parse key
 4601|  7.02M|               key_t key{};
 4602|  7.02M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|  7.02M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 66.5k, False: 6.95M]
  |  Branch (4603:44): [True: 66.5k, False: 15]
  |  Branch (4603:58): [True: 2.64k, False: 63.8k]
  |  Branch (4603:72): [True: 13.3k, False: 50.5k]
  |  Branch (4603:86): [True: 1.26k, False: 49.3k]
  ------------------
 4604|  17.2k|                     key.clear();
 4605|  17.2k|                  }
 4606|  7.00M|                  else {
 4607|  7.00M|                     auto key_probe = it;
 4608|  7.00M|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|  7.00M|                     bool parse_complex_flow_key = false;
 4613|  7.00M|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 7.00M, False: 15]
  ------------------
 4614|  7.00M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 16.7k, False: 6.99M]
  |  Branch (4614:50): [True: 38.1k, False: 6.95M]
  ------------------
 4615|  54.9k|                           parse_complex_flow_key = true;
 4616|  54.9k|                        }
 4617|  6.95M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 1.31M, False: 5.63M]
  ------------------
 4618|  1.31M|                           ++key_probe;
 4619|  1.31M|                           yaml::parse_anchor_name(key_probe, end);
 4620|  1.31M|                           yaml::skip_inline_ws(key_probe, end);
 4621|  1.31M|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 1.31M, False: 107]
  |  Branch (4621:53): [True: 9.00k, False: 1.30M]
  |  Branch (4621:74): [True: 266k, False: 1.03M]
  ------------------
 4622|   275k|                              parse_complex_flow_key = true;
 4623|   275k|                           }
 4624|  1.31M|                        }
 4625|  7.00M|                     }
 4626|       |
 4627|  7.00M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 330k, False: 6.67M]
  ------------------
 4628|   330k|                        glz::generic key_node{};
 4629|   330k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|   330k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 17.5k, False: 313k]
  ------------------
 4631|  17.5k|                           return;
 4632|   313k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 59, False: 312k]
  ------------------
 4633|     59|                           return;
 4634|   313k|                     }
 4635|  6.67M|                     else {
 4636|  6.67M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 8.64k, False: 6.66M]
  ------------------
 4637|  8.64k|                           return;
 4638|  8.64k|                        }
 4639|  6.67M|                     }
 4640|  7.00M|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|  6.99M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|  7.02M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 37, False: 7.02M]
  ------------------
 4656|     37|                  return;
 4657|       |
 4658|  7.02M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|  7.02M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|  7.02M|                     val = {};
 4661|  7.02M|                     return true;
 4662|  7.02M|                  }
 4663|  7.02M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  7.02M|                     val = glz::generic{};
 4665|  7.02M|                     return true;
 4666|  7.02M|                  }
 4667|  7.02M|                  else {
 4668|  7.02M|                     static constexpr std::string_view null_value{"null"};
 4669|  7.02M|                     auto null_it = null_value.data();
 4670|  7.02M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|  7.02M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|  7.02M|                     return !bool(ctx.error);
 4673|  7.02M|                  }
 4674|  7.02M|               };
 4675|       |
 4676|  7.02M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 6.99M, False: 29.6k]
  |  Branch (4676:34): [True: 4.06M, False: 2.93M]
  |  Branch (4676:48): [True: 180k, False: 2.75M]
  ------------------
 4677|  4.24M|                  val_t val{};
 4678|  4.24M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 4.24M]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|  4.24M|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|  4.24M|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 180k, False: 4.06M]
  ------------------
 4684|   180k|                     ++it;
 4685|   180k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|   180k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 189, False: 180k]
  ------------------
 4687|    189|                        return;
 4688|   180k|                     break;
 4689|   180k|                  }
 4690|       |
 4691|  4.06M|                  ++it; // skip comma
 4692|  4.06M|                  yaml::skip_ws_and_newlines(it, end);
 4693|  4.06M|                  continue;
 4694|  4.24M|               }
 4695|       |
 4696|  2.78M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 29.6k, False: 2.75M]
  |  Branch (4696:33): [True: 1.58k, False: 2.75M]
  ------------------
 4697|  5.03k|                  ctx.error = error_code::syntax_error;
 4698|  5.03k|                  return;
 4699|  5.03k|               }
 4700|  2.77M|               ++it;
 4701|       |
 4702|  2.77M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  2.77M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 23, False: 2.77M]
  ------------------
 4704|     23|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  2.77M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 2.75M, False: 26.3k]
  |  Branch (4707:34): [True: 353k, False: 2.39M]
  |  Branch (4707:48): [True: 20.4k, False: 2.37M]
  ------------------
 4708|   374k|                  val_t val{};
 4709|   374k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 374k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|   374k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|   374k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 20.4k, False: 353k]
  ------------------
 4715|  20.4k|                     ++it;
 4716|  20.4k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  20.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 28, False: 20.3k]
  ------------------
 4718|     28|                        return;
 4719|  20.3k|                     break;
 4720|  20.4k|                  }
 4721|       |
 4722|   353k|                  ++it; // skip comma
 4723|   353k|                  yaml::skip_ws_and_newlines(it, end);
 4724|   353k|                  continue;
 4725|   374k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  2.40M|               val_t val{};
 4729|  2.40M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  2.40M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 6.70k, False: 2.39M]
  ------------------
 4731|  6.70k|                  return;
 4732|       |
 4733|  2.39M|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  2.39M|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  2.39M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 2.37M, False: 26.8k]
  |  Branch (4737:33): [True: 980k, False: 1.38M]
  ------------------
 4738|   980k|                  ++it;
 4739|   980k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|   980k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 274, False: 980k]
  ------------------
 4741|    274|                     return;
 4742|   980k|                  break;
 4743|   980k|               }
 4744|  1.41M|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 1.38M, False: 26.8k]
  |  Branch (4744:38): [True: 1.26M, False: 127k]
  ------------------
 4745|  1.26M|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|  1.26M|                  yaml::skip_ws_and_newlines(it, end);
 4748|  1.26M|               }
 4749|   153k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 127k, False: 26.8k]
  |  Branch (4749:39): [True: 53.2k, False: 73.8k]
  |  Branch (4749:54): [True: 73.2k, False: 627]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|   126k|                  yaml::skip_ws_and_newlines(it, end);
 4753|   126k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 126k, False: 40]
  |  Branch (4753:36): [True: 42.7k, False: 83.6k]
  ------------------
 4754|  42.7k|                     ++it;
 4755|  42.7k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|  42.7k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 36, False: 42.7k]
  ------------------
 4757|     36|                        return;
 4758|  42.7k|                     break;
 4759|  42.7k|                  }
 4760|  83.6k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 83.6k, False: 40]
  |  Branch (4760:36): [True: 83.4k, False: 175]
  ------------------
 4761|  83.4k|                     ++it;
 4762|  83.4k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  83.4k|                     continue;
 4764|  83.4k|                  }
 4765|    215|                  ctx.error = error_code::syntax_error;
 4766|    215|                  return;
 4767|  83.6k|               }
 4768|  27.5k|               else {
 4769|  27.5k|                  ctx.error = error_code::syntax_error;
 4770|  27.5k|                  return;
 4771|  27.5k|               }
 4772|  2.39M|            }
 4773|  1.32M|         }
 4774|   655k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   655k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   655k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   655k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   655k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   655k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   655k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   655k|                           if (ctx.stream_begin) {
 4788|   655k|                              auto is_line_content_start = [&](auto pos) {
 4789|   655k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   655k|                              };
 4791|       |
 4792|   655k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   655k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   655k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   655k|                                 return line != end && *line == ':';
 4796|   655k|                              };
 4797|       |
 4798|   655k|                              if (!is_line_content_start(it) &&
 4799|   655k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   655k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   655k|                                 ctx.error = error_code::syntax_error;
 4802|   655k|                                 return false;
 4803|   655k|                              }
 4804|   655k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   655k|                           }
 4806|   655k|                        }
 4807|       |
 4808|   655k|                        if (*it == '-' &&
 4809|   655k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   655k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   655k|                           ctx.error = error_code::syntax_error;
 4813|   655k|                           return false;
 4814|   655k|                        }
 4815|       |
 4816|   655k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   655k|                           return false;
 4818|   655k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   655k|                        ctx.pop_indent();
 4820|   655k|                     }
 4821|   655k|                     else {
 4822|   655k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   655k|                        if (nested_indent >= 0) {
 4824|   655k|                           yaml::skip_to_content(it, end);
 4825|   655k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   655k|                              ctx.error = error_code::syntax_error;
 4827|   655k|                              return false;
 4828|   655k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   655k|                           const int32_t value_indent =
 4832|   655k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   655k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   655k|                              return false;
 4835|   655k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   655k|                           ctx.pop_indent();
 4837|   655k|                        }
 4838|   655k|                     }
 4839|   655k|                     return !bool(ctx.error);
 4840|   655k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   655k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   655k|                     ctx.error = error_code::syntax_error;
 4847|   655k|                     return false;
 4848|   655k|                  }
 4849|   655k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   655k|                     ++it; // skip '?'
 4851|   655k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   655k|                     const int32_t explicit_value_indicator_indent =
 4854|   655k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   655k|                     key_t key{};
 4857|   655k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   655k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   655k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   655k|                        };
 4861|       |
 4862|   655k|                        auto key_it = it;
 4863|   655k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   655k|                        auto content = key_it;
 4866|   655k|                        yaml::skip_to_content(content, end);
 4867|   655k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   655k|                        if (content != end && *content == '&') {
 4873|   655k|                           auto anchor_probe = content + 1;
 4874|   655k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   655k|                           if (!anchor_name.empty()) {
 4876|   655k|                              auto after_anchor = anchor_probe;
 4877|   655k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   655k|                              auto value_indicator = after_anchor;
 4880|   655k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   655k|                                 key.clear();
 4882|   655k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   655k|                                 it = value_indicator;
 4884|   655k|                                 handled_anchor_only_empty_key = true;
 4885|   655k|                              }
 4886|   655k|                              else {
 4887|   655k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   655k|                                    yaml::skip_comment(value_indicator, end);
 4889|   655k|                                 }
 4890|   655k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   655k|                                    yaml::skip_newline(value_indicator, end);
 4892|   655k|                                    auto value_line = value_indicator;
 4893|   655k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   655k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   655k|                                       return false;
 4896|   655k|                                    if (value_line != end && *value_line == ':' &&
 4897|   655k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   655k|                                       key.clear();
 4899|   655k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   655k|                                       it = value_line;
 4901|   655k|                                       handled_anchor_only_empty_key = true;
 4902|   655k|                                    }
 4903|   655k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   655k|                                       ctx.error = error_code::syntax_error;
 4908|   655k|                                       return false;
 4909|   655k|                                    }
 4910|   655k|                                 }
 4911|   655k|                              }
 4912|   655k|                           }
 4913|   655k|                        }
 4914|       |
 4915|   655k|                        const bool key_content_spans_lines = [&] {
 4916|   655k|                           auto scan = key_it;
 4917|   655k|                           while (scan != content && scan != end) {
 4918|   655k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   655k|                              ++scan;
 4920|   655k|                           }
 4921|   655k|                           return false;
 4922|   655k|                        }();
 4923|       |
 4924|   655k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   655k|                        }
 4927|   655k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   655k|                           key.clear();
 4929|   655k|                           it = content;
 4930|   655k|                        }
 4931|   655k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   655k|                           auto key_node_it = content;
 4937|   655k|                           auto key_node_end = end;
 4938|   655k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   655k|                              auto scan = content;
 4943|   655k|                              while (scan != end) {
 4944|   655k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   655k|                                    ++scan;
 4946|   655k|                                 }
 4947|   655k|                                 if (scan == end) {
 4948|   655k|                                    break;
 4949|   655k|                                 }
 4950|       |
 4951|   655k|                                 yaml::skip_newline(scan, end);
 4952|   655k|                                 auto line_start = scan;
 4953|       |
 4954|   655k|                                 int32_t indicator_indent = 0;
 4955|   655k|                                 while (scan != end && *scan == ' ') {
 4956|   655k|                                    ++indicator_indent;
 4957|   655k|                                    ++scan;
 4958|   655k|                                 }
 4959|       |
 4960|   655k|                                 if (scan != end && *scan == ':') {
 4961|   655k|                                    const auto after_colon = scan + 1;
 4962|   655k|                                    if ((after_colon == end ||
 4963|   655k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   655k|                                        indicator_indent <= line_indent) {
 4965|   655k|                                       key_node_end = line_start;
 4966|   655k|                                       break;
 4967|   655k|                                    }
 4968|   655k|                                 }
 4969|   655k|                              }
 4970|   655k|                           }
 4971|       |
 4972|   655k|                           glz::generic key_node{};
 4973|   655k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   655k|                           ctx.explicit_mapping_key_context = true;
 4975|   655k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   655k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   655k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   655k|                              return false;
 4979|   655k|                           it = key_node_it;
 4980|   655k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   655k|                              return false;
 4982|   655k|                        }
 4983|   655k|                     }
 4984|   655k|                     else {
 4985|   655k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   655k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   655k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   655k|                              return false;
 4989|   655k|                        }
 4990|   655k|                     }
 4991|       |
 4992|   655k|                     yaml::skip_inline_ws(it, end);
 4993|   655k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   655k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   655k|                        auto probe = it;
 4998|   655k|                        bool found_value_indicator = false;
 4999|       |
 5000|   655k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   655k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   655k|                           auto value_line = probe;
 5004|   655k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   655k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   655k|                              return false;
 5007|       |
 5008|   655k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   655k|                              probe = value_line;
 5010|   655k|                              continue; // blank line
 5011|   655k|                           }
 5012|   655k|                           if (*value_line == '#') {
 5013|   655k|                              yaml::skip_comment(value_line, end);
 5014|   655k|                              probe = value_line;
 5015|   655k|                              continue; // comment-only line
 5016|   655k|                           }
 5017|   655k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   655k|                              it = value_line;
 5019|   655k|                              found_value_indicator = true;
 5020|   655k|                           }
 5021|   655k|                           break;
 5022|   655k|                        }
 5023|       |
 5024|   655k|                        if (found_value_indicator) {
 5025|   655k|                           yaml::skip_inline_ws(it, end);
 5026|   655k|                        }
 5027|   655k|                     }
 5028|       |
 5029|   655k|                     val_t val{};
 5030|   655k|                     if (it != end && *it == ':') {
 5031|   655k|                        ++it;
 5032|   655k|                        if (it != end && *it == '\t') {
 5033|   655k|                           ctx.error = error_code::syntax_error;
 5034|   655k|                           return false;
 5035|   655k|                        }
 5036|   655k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   655k|                           auto probe = it;
 5038|   655k|                           yaml::skip_newline(probe, end);
 5039|   655k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   655k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   655k|                              ctx.error = error_code::syntax_error;
 5042|   655k|                              return false;
 5043|   655k|                           }
 5044|   655k|                        }
 5045|   655k|                        yaml::skip_inline_ws(it, end);
 5046|   655k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   655k|                           return false;
 5048|   655k|                     }
 5049|       |
 5050|   655k|                     value.emplace(std::move(key), std::move(val));
 5051|   655k|                     return true;
 5052|   655k|                  }
 5053|       |
 5054|   655k|                  key_t key{};
 5055|   655k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   655k|                     auto key_probe = it;
 5057|   655k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   655k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   655k|                     if (complex_flow_key) {
 5060|   655k|                        glz::generic key_node{};
 5061|   655k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   655k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   655k|                           return false;
 5064|   655k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   655k|                           return false;
 5066|   655k|                     }
 5067|   655k|                     else {
 5068|   655k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   655k|                           return false;
 5070|   655k|                        }
 5071|   655k|                     }
 5072|   655k|                  }
 5073|   655k|                  else {
 5074|   655k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   655k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   655k|                        return false;
 5077|   655k|                  }
 5078|       |
 5079|   655k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   655k|                  if (it == end || *it != ':') {
 5082|   655k|                     ctx.error = error_code::syntax_error;
 5083|   655k|                     return false;
 5084|   655k|                  }
 5085|   655k|                  ++it;
 5086|   655k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   655k|                  val_t val{};
 5089|   655k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   655k|                     return false;
 5091|       |
 5092|   655k|                  value.emplace(std::move(key), std::move(val));
 5093|   655k|                  return true;
 5094|   655k|               });
 5095|   655k|         }
 5096|       |
 5097|  1.94M|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|  1.94M|      }
_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.02M|      {
  466|  2.02M|         skip_inline_ws(it, end);
  467|       |
  468|  2.02M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 5, False: 2.02M]
  ------------------
  469|      5|            if constexpr (!AllowEmptyInput) {
  470|      5|               ctx.error = error_code::unexpected_end;
  471|      5|            }
  472|      5|            return true;
  473|      5|         }
  474|       |
  475|  2.02M|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  2.02M|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 5, False: 2.02M]
  ------------------
  477|      5|            ctx.error = error_code::syntax_error;
  478|      5|            return true;
  479|      5|         }
  480|  2.02M|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 5, False: 2.02M]
  ------------------
  481|      5|            ctx.error = error_code::syntax_error;
  482|      5|            return true;
  483|      5|         }
  484|       |
  485|  2.02M|         skip_inline_ws(it, end);
  486|       |
  487|  2.02M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 7, False: 2.02M]
  ------------------
  488|      7|            if constexpr (!AllowEmptyInput) {
  489|      7|               ctx.error = error_code::unexpected_end;
  490|      7|            }
  491|      7|            return true;
  492|      7|         }
  493|       |
  494|  2.02M|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 11.5k, False: 2.00M]
  ------------------
  495|  11.5k|            return true;
  496|  11.5k|         }
  497|       |
  498|  2.00M|         return false;
  499|  2.02M|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESN_:
 4521|  2.02M|                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.02M|      {
  409|  2.02M|         state.has_anchor = false;
  410|  2.02M|         state.anchor_name.clear();
  411|  2.02M|         state.anchor_start = nullptr;
  412|  2.02M|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  2.02M|         if constexpr (Policy.allow_alias) {
  415|  2.02M|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|  2.02M|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 2.01M, False: 447]
  ------------------
  417|  2.01M|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 11.4k, False: 2.00M]
  ------------------
  418|  2.01M|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|  2.02M|         }
  424|       |
  425|  2.02M|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 2.00M, False: 11.4k]
  |  Branch (425:27): [True: 13.6k, False: 1.99M]
  ------------------
  426|  13.6k|            ++it;
  427|  13.6k|            auto name = parse_anchor_name(it, end);
  428|  13.6k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 10, False: 13.6k]
  ------------------
  429|     10|               ctx.error = error_code::syntax_error;
  430|     10|               return true;
  431|     10|            }
  432|  13.6k|            skip_inline_ws(it, end);
  433|  13.6k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 23, False: 13.6k]
  ------------------
  434|     23|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     23|                  ctx.error = error_code::unexpected_end;
  436|     23|               }
  437|     23|               return true;
  438|     23|            }
  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.6k|            state.has_anchor = true;
  446|  13.6k|            state.anchor_name = std::string(name);
  447|  13.6k|            state.anchor_start = &*it;
  448|  13.6k|         }
  449|       |
  450|  2.02M|         return false;
  451|  2.02M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|  2.01M|      {
  301|  2.01M|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 2.01M]
  |  Branch (301:27): [True: 2.00M, False: 11.4k]
  ------------------
  302|       |
  303|  11.4k|         ++it; // skip '*'
  304|  11.4k|         auto name = parse_anchor_name(it, end);
  305|  11.4k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 21, False: 11.4k]
  ------------------
  306|     21|            ctx.error = error_code::syntax_error;
  307|     21|            return true;
  308|     21|         }
  309|       |
  310|  11.4k|         auto anchor_it = ctx.anchors.find(name);
  311|  11.4k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 83, False: 11.3k]
  ------------------
  312|     83|            ctx.error = error_code::syntax_error; // undefined alias
  313|     83|            return true;
  314|     83|         }
  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.3k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  11.3k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 982, False: 10.4k]
  ------------------
  322|    982|            return true;
  323|    982|         }
  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.4k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 8, False: 10.3k]
  ------------------
  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|  10.3k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  10.3k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 10.3k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  10.3k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 10.3k]
  ------------------
  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.3k|         auto replay_it = span.begin;
  348|  10.3k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  10.3k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  10.3k|         ctx.indent_stack.clear();
  353|  10.3k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 523, False: 9.87k]
  ------------------
  354|    523|            ctx.push_indent(span.base_indent - 1);
  355|    523|         }
  356|       |
  357|  10.3k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  10.3k|         using V = std::remove_cvref_t<T>;
  360|  10.3k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  10.3k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  10.3k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  10.3k|         return true;
  367|  10.3k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|  4.61M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|  4.61M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  4.61M|                     val = glz::generic{};
 4665|  4.61M|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|  4.61M|               };
_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_:
 3633|   655k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   655k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 655k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   655k|         const int32_t parent_indent = ctx.current_indent();
 3644|   655k|         const bool discover_indent = (mapping_indent < 0);
 3645|   655k|         bool first_key = !discover_indent;
 3646|   655k|         bool discovered_first_key_mid_line = false;
 3647|   655k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|  1.45M|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 885k, False: 572k]
  ------------------
 3650|   885k|            auto line_start = it;
 3651|   885k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 885k]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|  1.01M|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 998k, False: 13.9k]
  ------------------
 3655|   998k|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 31.4k, False: 967k]
  ------------------
 3656|  31.4k|                  skip_comment(it, end);
 3657|  31.4k|                  skip_newline(it, end);
 3658|  31.4k|                  first_key = false;
 3659|  31.4k|                  line_indent = 0;
 3660|  31.4k|               }
 3661|   967k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 27.5k, False: 939k]
  |  Branch (3661:40): [True: 37.1k, False: 902k]
  ------------------
 3662|  64.7k|                  skip_newline(it, end);
 3663|  64.7k|                  first_key = false;
 3664|  64.7k|                  line_indent = 0;
 3665|  64.7k|               }
 3666|   902k|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 121k, False: 781k]
  ------------------
 3667|   121k|                  line_start = it;
 3668|   121k|                  line_indent = 0;
 3669|   310k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 308k, False: 2.32k]
  |  Branch (3669:39): [True: 189k, False: 118k]
  ------------------
 3670|   189k|                     ++line_indent;
 3671|   189k|                     ++it;
 3672|   189k|                  }
 3673|       |
 3674|   121k|                  bool saw_tab = false;
 3675|   143k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 140k, False: 2.85k]
  |  Branch (3675:40): [True: 11.5k, False: 129k]
  |  Branch (3675:54): [True: 10.9k, False: 118k]
  ------------------
 3676|  22.4k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 19.6k, False: 2.81k]
  |  Branch (3676:43): [True: 2.81k, False: 0]
  ------------------
 3677|  22.4k|                     ++it;
 3678|  22.4k|                  }
 3679|       |
 3680|   121k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 2.85k, False: 118k]
  |  Branch (3680:36): [True: 7.67k, False: 110k]
  |  Branch (3680:51): [True: 5.96k, False: 104k]
  |  Branch (3680:66): [True: 4.21k, False: 100k]
  ------------------
 3681|  20.7k|                     first_key = false;
 3682|  20.7k|                     line_indent = 0;
 3683|  20.7k|                     continue; // Blank or comment line
 3684|  20.7k|                  }
 3685|       |
 3686|   100k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 42, False: 100k]
  ------------------
 3687|     42|                     ctx.error = error_code::syntax_error;
 3688|     42|                     return;
 3689|     42|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|   100k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 97.1k, False: 3.12k]
  |  Branch (3692:46): [True: 254, False: 96.8k]
  ------------------
 3693|    254|                     it = line_start;
 3694|    254|                     return;
 3695|    254|                  }
 3696|       |
 3697|  99.9k|                  first_key = false;
 3698|  99.9k|                  break; // Found content
 3699|   100k|               }
 3700|   781k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 10.9k, False: 770k]
  ------------------
 3701|  10.9k|                  line_start = it;
 3702|  37.1k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 34.9k, False: 2.17k]
  |  Branch (3702:40): [True: 6.72k, False: 28.2k]
  |  Branch (3702:54): [True: 19.4k, False: 8.75k]
  ------------------
 3703|  10.9k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 2.17k, False: 8.75k]
  |  Branch (3703:36): [True: 3.76k, False: 4.99k]
  |  Branch (3703:51): [True: 808, False: 4.18k]
  |  Branch (3703:66): [True: 4.14k, False: 41]
  ------------------
 3704|  10.8k|                     first_key = false;
 3705|  10.8k|                     line_indent = 0;
 3706|  10.8k|                     continue; // Blank or comment-only line with tab indentation
 3707|  10.8k|                  }
 3708|     41|                  ctx.error = error_code::syntax_error;
 3709|     41|                  return;
 3710|  10.9k|               }
 3711|   770k|               else {
 3712|   770k|                  line_start = it;
 3713|   770k|                  break; // Content at column 0
 3714|   770k|               }
 3715|   998k|            }
 3716|       |
 3717|   884k|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 13.9k, False: 870k]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|   870k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 3.15k, False: 867k]
  |  Branch (3721:45): [True: 3.23k, False: 864k]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|   864k|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 864k, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|   864k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 864k, False: 0]
  |  Branch (3728:39): [True: 209k, False: 654k]
  |  Branch (3728:62): [True: 71.8k, False: 137k]
  |  Branch (3728:84): [True: 46.3k, False: 25.5k]
  ------------------
 3729|  46.3k|                  it = line_start;
 3730|  46.3k|                  return;
 3731|  46.3k|               }
 3732|   818k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 163k, False: 654k]
  |  Branch (3732:43): [True: 127, False: 163k]
  ------------------
 3733|    127|                  it = line_start;
 3734|    127|                  return;
 3735|    127|               }
 3736|   818k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   817k|            bool established_mapping_indent_this_line = false;
 3740|   817k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 654k, False: 163k]
  ------------------
 3741|   654k|               mapping_indent = line_indent;
 3742|   654k|               established_mapping_indent_this_line = true;
 3743|   654k|               discovered_first_key_visual_indent = line_indent;
 3744|   654k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   654k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 654k, False: 0]
  |  Branch (3745:43): [True: 654k, False: 0]
  ------------------
 3746|   654k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   654k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 385, False: 654k]
  ------------------
 3748|    385|                        ctx.error = error_code::syntax_error;
 3749|    385|                        return;
 3750|    385|                     }
 3751|       |
 3752|   654k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   654k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 651k, False: 3.12k]
  |  Branch (3753:49): [True: 479k, False: 172k]
  ------------------
 3754|   479k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   479k|                     }
 3756|   654k|                  }
 3757|   654k|               }
 3758|   654k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   817k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 817k, False: 385]
  |  Branch (3762:36): [True: 817k, False: 0]
  |  Branch (3762:59): [True: 163k, False: 654k]
  ------------------
 3763|   163k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 36.3k, False: 126k]
  ------------------
 3764|  36.3k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 35.7k, False: 520]
  |  Branch (3764:43): [True: 20.8k, False: 14.9k]
  ------------------
 3765|  20.8k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 17, False: 20.8k]
  ------------------
 3766|     17|                     ctx.error = error_code::syntax_error;
 3767|     17|                     return;
 3768|     17|                  }
 3769|  20.8k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 1.35k, False: 19.5k]
  ------------------
 3770|  1.35k|                     it = line_start;
 3771|  1.35k|                     return;
 3772|  1.35k|                  }
 3773|  20.8k|               }
 3774|  15.4k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 1.08k, False: 14.3k]
  ------------------
 3775|  1.08k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 57, False: 1.02k]
  |  Branch (3775:47): [True: 2, False: 1.02k]
  ------------------
 3776|  1.02k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 1.02k, False: 0]
  |  Branch (3776:49): [True: 1.02k, False: 0]
  |  Branch (3776:72): [True: 5, False: 1.02k]
  ------------------
 3777|     64|                  ctx.error = error_code::syntax_error;
 3778|     64|                  return;
 3779|     64|               }
 3780|  36.3k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   816k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 816k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   816k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 816k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   816k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 385, False: 816k]
  |  Branch (3798:32): [True: 0, False: 816k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   816k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 184k, False: 631k]
  |  Branch (3807:53): [True: 18.8k, False: 165k]
  |  Branch (3807:94): [True: 3.41k, False: 15.4k]
  ------------------
 3808|  3.41k|               const auto after_colon = it + 1;
 3809|  3.41k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 2.71k, False: 697]
  ------------------
 3810|  3.41k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 150, False: 3.26k]
  |  Branch (3810:43): [True: 2.50k, False: 755]
  ------------------
 3811|  2.65k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 206, False: 2.45k]
  ------------------
 3812|    206|                  it = line_start;
 3813|    206|                  return;
 3814|    206|               }
 3815|  3.41k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   816k|            int32_t effective_line_indent = line_indent;
 3819|   816k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 815k, False: 385]
  |  Branch (3819:36): [True: 654k, False: 161k]
  ------------------
 3820|   654k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 479k, False: 175k]
  ------------------
 3821|   479k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 392k, False: 87.0k]
  |  Branch (3821:52): [True: 232k, False: 159k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   246k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   246k|            }
 3834|       |
 3835|   816k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 13.3k, False: 802k]
  ------------------
 3836|  13.3k|               return;
 3837|  13.3k|            }
 3838|   802k|            first_key = false;
 3839|       |
 3840|   802k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 802k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|   802k|            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|   802k|               auto flow_end = it;
 3847|   802k|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|   802k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3848:20): [True: 93, False: 802k]
  ------------------
 3849|     93|                  return;
 3850|   802k|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3850:20): [True: 649k, False: 153k]
  |  Branch (3850:40): [True: 353k, False: 296k]
  |  Branch (3850:60): [True: 16.5k, False: 279k]
  |  Branch (3850:80): [True: 62.9k, False: 216k]
  ------------------
 3851|   432k|                  it = flow_end;
 3852|   432k|                  return;
 3853|   432k|               }
 3854|   802k|            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   802k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 258k, False: 544k]
  ------------------
 3860|   258k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 94.0k, False: 164k]
  |  Branch (3860:34): [True: 1.32k, False: 162k]
  ------------------
 3861|  95.3k|                  auto peek = it;
 3862|  95.3k|                  skip_inline_ws(peek, end);
 3863|  95.3k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 85.6k, False: 9.77k]
  |  Branch (3863:38): [True: 82.2k, False: 3.32k]
  |  Branch (3863:55): [True: 81.4k, False: 852]
  |  Branch (3863:72): [True: 79.9k, False: 1.50k]
  ------------------
 3864|  79.9k|                     continue; // At leading indent of new line
 3865|  79.9k|                  }
 3866|  95.3k|               }
 3867|   178k|               skip_inline_ws(it, end);
 3868|   178k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 168k, False: 9.77k]
  |  Branch (3868:33): [True: 7.41k, False: 161k]
  ------------------
 3869|  7.41k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  7.41k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 7.41k, False: 0]
  ------------------
 3871|  7.41k|                        const char prev = *(it - 1);
 3872|  7.41k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 4.26k, False: 3.14k]
  |  Branch (3872:44): [True: 2.68k, False: 1.57k]
  |  Branch (3872:60): [True: 795, False: 1.89k]
  |  Branch (3872:76): [True: 15, False: 780]
  ------------------
 3873|     15|                           ctx.error = error_code::syntax_error;
 3874|     15|                           return;
 3875|     15|                        }
 3876|  7.41k|                     }
 3877|  7.41k|                  }
 3878|  7.41k|               }
 3879|  7.39k|               skip_comment(it, end);
 3880|   178k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 168k, False: 9.84k]
  |  Branch (3880:34): [True: 49.8k, False: 118k]
  |  Branch (3880:49): [True: 57.0k, False: 61.6k]
  ------------------
 3881|   106k|                  skip_newline(it, end);
 3882|   106k|               }
 3883|  71.4k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 61.6k, False: 9.84k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|  61.6k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|  61.6k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 733, False: 60.9k]
  ------------------
 3890|    733|                        ctx.error = error_code::syntax_error;
 3891|    733|                        return;
 3892|    733|                     }
 3893|  61.6k|                  }
 3894|  61.6k|               }
 3895|   178k|            }
 3896|   802k|         }
 3897|   655k|      }
_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:
 4777|   815k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   815k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   815k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   815k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   815k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   815k|                           if (ctx.stream_begin) {
 4788|   815k|                              auto is_line_content_start = [&](auto pos) {
 4789|   815k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   815k|                              };
 4791|       |
 4792|   815k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   815k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   815k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   815k|                                 return line != end && *line == ':';
 4796|   815k|                              };
 4797|       |
 4798|   815k|                              if (!is_line_content_start(it) &&
 4799|   815k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   815k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   815k|                                 ctx.error = error_code::syntax_error;
 4802|   815k|                                 return false;
 4803|   815k|                              }
 4804|   815k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   815k|                           }
 4806|   815k|                        }
 4807|       |
 4808|   815k|                        if (*it == '-' &&
 4809|   815k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   815k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   815k|                           ctx.error = error_code::syntax_error;
 4813|   815k|                           return false;
 4814|   815k|                        }
 4815|       |
 4816|   815k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   815k|                           return false;
 4818|   815k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   815k|                        ctx.pop_indent();
 4820|   815k|                     }
 4821|   815k|                     else {
 4822|   815k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   815k|                        if (nested_indent >= 0) {
 4824|   815k|                           yaml::skip_to_content(it, end);
 4825|   815k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   815k|                              ctx.error = error_code::syntax_error;
 4827|   815k|                              return false;
 4828|   815k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   815k|                           const int32_t value_indent =
 4832|   815k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   815k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   815k|                              return false;
 4835|   815k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   815k|                           ctx.pop_indent();
 4837|   815k|                        }
 4838|   815k|                     }
 4839|   815k|                     return !bool(ctx.error);
 4840|   815k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   815k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 330k, False: 485k]
  |  Branch (4845:37): [True: 330k, False: 197]
  |  Branch (4845:58): [True: 5, False: 330k]
  ------------------
 4846|      5|                     ctx.error = error_code::syntax_error;
 4847|      5|                     return false;
 4848|      5|                  }
 4849|   815k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 330k, False: 485k]
  |  Branch (4849:38): [True: 197, False: 330k]
  |  Branch (4849:57): [True: 133k, False: 197k]
  |  Branch (4849:77): [True: 123k, False: 73.3k]
  |  Branch (4849:98): [True: 58.1k, False: 15.2k]
  ------------------
 4850|   315k|                     ++it; // skip '?'
 4851|   315k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   315k|                     const int32_t explicit_value_indicator_indent =
 4854|   315k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 182k, False: 132k]
  ------------------
 4855|       |
 4856|   315k|                     key_t key{};
 4857|   315k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   315k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   315k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   315k|                        };
 4861|       |
 4862|   315k|                        auto key_it = it;
 4863|   315k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   315k|                        auto content = key_it;
 4866|   315k|                        yaml::skip_to_content(content, end);
 4867|   315k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   315k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 302k, False: 13.1k]
  |  Branch (4872:47): [True: 101k, False: 201k]
  ------------------
 4873|   101k|                           auto anchor_probe = content + 1;
 4874|   101k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   101k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 101k, False: 21]
  ------------------
 4876|   101k|                              auto after_anchor = anchor_probe;
 4877|   101k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   101k|                              auto value_indicator = after_anchor;
 4880|   101k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 98.3k, False: 2.71k]
  |  Branch (4880:61): [True: 4.04k, False: 94.2k]
  ------------------
 4881|  4.04k|                                 key.clear();
 4882|  4.04k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  4.04k|                                 it = value_indicator;
 4884|  4.04k|                                 handled_anchor_only_empty_key = true;
 4885|  4.04k|                              }
 4886|  96.9k|                              else {
 4887|  96.9k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 94.2k, False: 2.71k]
  |  Branch (4887:64): [True: 1.71k, False: 92.5k]
  ------------------
 4888|  1.71k|                                    yaml::skip_comment(value_indicator, end);
 4889|  1.71k|                                 }
 4890|  96.9k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 94.2k, False: 2.72k]
  |  Branch (4890:65): [True: 27.7k, False: 66.4k]
  |  Branch (4890:93): [True: 19.6k, False: 46.8k]
  ------------------
 4891|  47.3k|                                    yaml::skip_newline(value_indicator, end);
 4892|  47.3k|                                    auto value_line = value_indicator;
 4893|  47.3k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  47.3k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 4, False: 47.3k]
  ------------------
 4895|      4|                                       return false;
 4896|  47.3k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 45.6k, False: 1.77k]
  |  Branch (4896:62): [True: 8.45k, False: 37.1k]
  ------------------
 4897|  8.45k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 8.44k, False: 6]
  ------------------
 4898|  8.44k|                                       key.clear();
 4899|  8.44k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  8.44k|                                       it = value_line;
 4901|  8.44k|                                       handled_anchor_only_empty_key = true;
 4902|  8.44k|                                    }
 4903|  38.9k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 37.1k, False: 1.77k]
  |  Branch (4903:67): [True: 6, False: 37.1k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|      6|                                       ctx.error = error_code::syntax_error;
 4908|      6|                                       return false;
 4909|      6|                                    }
 4910|  47.3k|                                 }
 4911|  96.9k|                              }
 4912|   101k|                           }
 4913|   101k|                        }
 4914|       |
 4915|   315k|                        const bool key_content_spans_lines = [&] {
 4916|   315k|                           auto scan = key_it;
 4917|   315k|                           while (scan != content && scan != end) {
 4918|   315k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   315k|                              ++scan;
 4920|   315k|                           }
 4921|   315k|                           return false;
 4922|   315k|                        }();
 4923|       |
 4924|   315k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 12.4k, False: 302k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  12.4k|                        }
 4927|   302k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 13.1k, False: 289k]
  |  Branch (4927:53): [True: 6.85k, False: 282k]
  |  Branch (4927:72): [True: 3.18k, False: 3.66k]
  ------------------
 4928|  16.3k|                           key.clear();
 4929|  16.3k|                           it = content;
 4930|  16.3k|                        }
 4931|   286k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   286k|                           auto key_node_it = content;
 4937|   286k|                           auto key_node_end = end;
 4938|   286k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   286k|                              auto scan = content;
 4943|  6.82M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 6.77M, False: 54.6k]
  ------------------
 4944|   167M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 167M, False: 164k]
  |  Branch (4944:56): [True: 164M, False: 2.98M]
  |  Branch (4944:73): [True: 161M, False: 3.62M]
  ------------------
 4945|   161M|                                    ++scan;
 4946|   161M|                                 }
 4947|  6.77M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 164k, False: 6.60M]
  ------------------
 4948|   164k|                                    break;
 4949|   164k|                                 }
 4950|       |
 4951|  6.60M|                                 yaml::skip_newline(scan, end);
 4952|  6.60M|                                 auto line_start = scan;
 4953|       |
 4954|  6.60M|                                 int32_t indicator_indent = 0;
 4955|  8.00M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 7.94M, False: 54.6k]
  |  Branch (4955:56): [True: 1.39M, False: 6.55M]
  ------------------
 4956|  1.39M|                                    ++indicator_indent;
 4957|  1.39M|                                    ++scan;
 4958|  1.39M|                                 }
 4959|       |
 4960|  6.60M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 6.55M, False: 54.6k]
  |  Branch (4960:53): [True: 163k, False: 6.38M]
  ------------------
 4961|   163k|                                    const auto after_colon = scan + 1;
 4962|   163k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 460, False: 163k]
  ------------------
 4963|   163k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 103k, False: 60.1k]
  ------------------
 4964|   103k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 67.0k, False: 36.7k]
  ------------------
 4965|  67.0k|                                       key_node_end = line_start;
 4966|  67.0k|                                       break;
 4967|  67.0k|                                    }
 4968|   163k|                                 }
 4969|  6.60M|                              }
 4970|   286k|                           }
 4971|       |
 4972|   286k|                           glz::generic key_node{};
 4973|   286k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   286k|                           ctx.explicit_mapping_key_context = true;
 4975|   286k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   286k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   286k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 2.30k, False: 284k]
  ------------------
 4978|  2.30k|                              return false;
 4979|   284k|                           it = key_node_it;
 4980|   284k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 11, False: 284k]
  ------------------
 4981|     11|                              return false;
 4982|   284k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   312k|                     yaml::skip_inline_ws(it, end);
 4993|   315k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   315k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 261k, False: 54.0k]
  |  Branch (4996:40): [True: 19.8k, False: 241k]
  |  Branch (4996:55): [True: 44.2k, False: 197k]
  ------------------
 4997|  64.1k|                        auto probe = it;
 4998|  64.1k|                        bool found_value_indicator = false;
 4999|       |
 5000|   128k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 110k, False: 18.4k]
  |  Branch (5000:49): [True: 38.2k, False: 71.9k]
  |  Branch (5000:67): [True: 71.9k, False: 0]
  ------------------
 5001|   110k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   110k|                           auto value_line = probe;
 5004|   110k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   110k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 10, False: 110k]
  ------------------
 5006|     10|                              return false;
 5007|       |
 5008|   110k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 15.8k, False: 94.3k]
  |  Branch (5008:53): [True: 12.0k, False: 82.3k]
  |  Branch (5008:76): [True: 20.8k, False: 61.4k]
  ------------------
 5009|  48.6k|                              probe = value_line;
 5010|  48.6k|                              continue; // blank line
 5011|  48.6k|                           }
 5012|  61.4k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 15.8k, False: 45.6k]
  ------------------
 5013|  15.8k|                              yaml::skip_comment(value_line, end);
 5014|  15.8k|                              probe = value_line;
 5015|  15.8k|                              continue; // comment-only line
 5016|  15.8k|                           }
 5017|  45.6k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 13.0k, False: 32.6k]
  |  Branch (5017:54): [True: 7.22k, False: 5.81k]
  ------------------
 5018|  7.22k|                              it = value_line;
 5019|  7.22k|                              found_value_indicator = true;
 5020|  7.22k|                           }
 5021|  45.6k|                           break;
 5022|  61.4k|                        }
 5023|       |
 5024|  64.1k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 7.22k, False: 56.9k]
  ------------------
 5025|  7.22k|                           yaml::skip_inline_ws(it, end);
 5026|  7.22k|                        }
 5027|  64.1k|                     }
 5028|       |
 5029|   315k|                     val_t val{};
 5030|   315k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 261k, False: 54.0k]
  |  Branch (5030:39): [True: 87.8k, False: 173k]
  ------------------
 5031|  87.8k|                        ++it;
 5032|  87.8k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 87.3k, False: 473]
  |  Branch (5032:42): [True: 25, False: 87.3k]
  ------------------
 5033|     25|                           ctx.error = error_code::syntax_error;
 5034|     25|                           return false;
 5035|     25|                        }
 5036|  87.8k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 87.3k, False: 473]
  |  Branch (5036:43): [True: 5.57k, False: 81.7k]
  |  Branch (5036:58): [True: 13.3k, False: 68.3k]
  ------------------
 5037|  18.9k|                           auto probe = it;
 5038|  18.9k|                           yaml::skip_newline(probe, end);
 5039|  55.8k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 54.6k, False: 1.22k]
  |  Branch (5039:51): [True: 36.8k, False: 17.7k]
  ------------------
 5040|  18.9k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 17.7k, False: 1.22k]
  |  Branch (5040:48): [True: 958, False: 16.7k]
  |  Branch (5040:65): [True: 955, False: 3]
  |  Branch (5040:89): [True: 2, False: 953]
  ------------------
 5041|      2|                              ctx.error = error_code::syntax_error;
 5042|      2|                              return false;
 5043|      2|                           }
 5044|  18.9k|                        }
 5045|  87.8k|                        yaml::skip_inline_ws(it, end);
 5046|  87.8k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 515, False: 87.3k]
  ------------------
 5047|    515|                           return false;
 5048|  87.8k|                     }
 5049|       |
 5050|   314k|                     value.emplace(std::move(key), std::move(val));
 5051|   314k|                     return true;
 5052|   315k|                  }
 5053|       |
 5054|   500k|                  key_t key{};
 5055|   500k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   500k|                     auto key_probe = it;
 5057|   500k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   500k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 500k, False: 0]
  |  Branch (5058:74): [True: 1.04k, False: 499k]
  |  Branch (5058:95): [True: 1.13k, False: 498k]
  ------------------
 5059|   500k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 2.18k, False: 498k]
  ------------------
 5060|  2.18k|                        glz::generic key_node{};
 5061|  2.18k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  2.18k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 1.02k, False: 1.16k]
  ------------------
 5063|  1.02k|                           return false;
 5064|  1.16k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 0, False: 1.16k]
  ------------------
 5065|      0|                           return false;
 5066|  1.16k|                     }
 5067|   498k|                     else {
 5068|   498k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 258, False: 498k]
  ------------------
 5069|    258|                           return false;
 5070|    258|                        }
 5071|   498k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   499k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   500k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 1.81k, False: 498k]
  |  Branch (5081:36): [True: 403, False: 498k]
  ------------------
 5082|    943|                     ctx.error = error_code::syntax_error;
 5083|    943|                     return false;
 5084|    943|                  }
 5085|   499k|                  ++it;
 5086|   499k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   499k|                  val_t val{};
 5089|   499k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 8.25k, False: 491k]
  ------------------
 5090|  8.25k|                     return false;
 5091|       |
 5092|   491k|                  value.emplace(std::move(key), std::move(val));
 5093|   491k|                  return true;
 5094|   499k|               });
_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:
 4915|   315k|                        const bool key_content_spans_lines = [&] {
 4916|   315k|                           auto scan = key_it;
 4917|   347k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 221k, False: 125k]
  |  Branch (4917:54): [True: 221k, False: 0]
  ------------------
 4918|   221k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 125k, False: 96.5k]
  |  Branch (4918:52): [True: 64.4k, False: 32.0k]
  ------------------
 4919|  32.0k|                              ++scan;
 4920|  32.0k|                           }
 4921|   125k|                           return false;
 4922|   315k|                        }();
_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_:
 4858|   284k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   284k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   284k|                        };
_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_:
 4778|   586k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   586k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 572k, False: 13.6k]
  |  Branch (4779:39): [True: 400k, False: 172k]
  ------------------
 4780|   400k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   400k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   400k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 400k, False: 0]
  ------------------
 4788|   400k|                              auto is_line_content_start = [&](auto pos) {
 4789|   400k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   400k|                              };
 4791|       |
 4792|   400k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   400k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   400k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   400k|                                 return line != end && *line == ':';
 4796|   400k|                              };
 4797|       |
 4798|   400k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 400k, False: 0]
  ------------------
 4799|   400k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 60.7k, False: 339k]
  ------------------
 4800|  60.7k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 456, False: 60.2k]
  ------------------
 4801|    456|                                 ctx.error = error_code::syntax_error;
 4802|    456|                                 return false;
 4803|    456|                              }
 4804|   399k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   399k|                           }
 4806|   400k|                        }
 4807|       |
 4808|   400k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 4.78k, False: 395k]
  ------------------
 4809|  4.78k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 813, False: 3.97k]
  |  Branch (4809:49): [True: 2.00k, False: 1.97k]
  ------------------
 4810|  2.81k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 12, False: 2.80k]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|     12|                           ctx.error = error_code::syntax_error;
 4813|     12|                           return false;
 4814|     12|                        }
 4815|       |
 4816|   400k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 400k]
  ------------------
 4817|      0|                           return false;
 4818|   400k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   400k|                        ctx.pop_indent();
 4820|   400k|                     }
 4821|   186k|                     else {
 4822|   186k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   186k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 80.5k, False: 105k]
  ------------------
 4824|  80.5k|                           yaml::skip_to_content(it, end);
 4825|  80.5k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 80.5k, False: 0]
  |  Branch (4825:45): [True: 0, False: 80.5k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  80.5k|                           const int32_t value_indent =
 4832|  80.5k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 80.5k]
  ------------------
 4833|  80.5k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 80.5k]
  ------------------
 4834|      0|                              return false;
 4835|  80.5k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  80.5k|                           ctx.pop_indent();
 4837|  80.5k|                        }
 4838|   186k|                     }
 4839|   586k|                     return !bool(ctx.error);
 4840|   586k|                  };
_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_:
 4788|   400k|                              auto is_line_content_start = [&](auto pos) {
 4789|   400k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   400k|                              };
_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_:
 4792|   460k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   460k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   737k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 737k, False: 0]
  |  Branch (4794:57): [True: 275k, False: 461k]
  |  Branch (4794:73): [True: 865, False: 460k]
  ------------------
 4795|   460k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 460k, False: 0]
  |  Branch (4795:56): [True: 240k, False: 219k]
  ------------------
 4796|   460k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|  2.00M|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|  2.00M|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 2.00M]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|  2.00M|            }
_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_:
 5205|   783k|      {
 5206|   783k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   783k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   783k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   783k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   783k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 783k, False: 0]
  ------------------
 5216|   783k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   783k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4098|   826k|      {
 4099|   826k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 826k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|   826k|         auto peek = it;
 4104|   826k|         yaml::node_preamble_state preamble{};
 4105|   826k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 43.7k, False: 782k]
  ------------------
 4106|   826k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  43.7k|            it = peek;
 4108|  43.7k|            return;
 4109|  43.7k|         }
 4110|       |
 4111|   782k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 110k, False: 671k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|   110k|            it = peek;
 4114|   110k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|   110k|         }
 4116|   671k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 671k, False: 153]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|   671k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 5.25k, False: 666k]
  |  Branch (4119:57): [True: 3.93k, False: 662k]
  ------------------
 4120|  9.19k|               it = peek;
 4121|  9.19k|            }
 4122|   671k|            int32_t seq_indent = ctx.current_indent();
 4123|   671k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 670k, False: 882]
  |  Branch (4123:31): [True: 134k, False: 536k]
  ------------------
 4124|   134k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 7.45k, False: 126k]
  |  Branch (4124:62): [True: 4.59k, False: 2.86k]
  ------------------
 4125|   134k|                                                          : (ctx.current_indent() + 1);
 4126|   134k|            }
 4127|   671k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|   671k|         }
 4129|    153|         else {
 4130|    153|            ctx.error = error_code::syntax_error;
 4131|    153|         }
 4132|       |
 4133|   782k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|   782k|      }
_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|   826k|      {
  466|   826k|         skip_inline_ws(it, end);
  467|       |
  468|   826k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 10, False: 826k]
  ------------------
  469|     10|            if constexpr (!AllowEmptyInput) {
  470|     10|               ctx.error = error_code::unexpected_end;
  471|     10|            }
  472|     10|            return true;
  473|     10|         }
  474|       |
  475|   826k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   826k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 826k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|   826k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 826k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|   826k|         skip_inline_ws(it, end);
  486|       |
  487|   826k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 4, False: 826k]
  ------------------
  488|      4|            if constexpr (!AllowEmptyInput) {
  489|      4|               ctx.error = error_code::unexpected_end;
  490|      4|            }
  491|      4|            return true;
  492|      4|         }
  493|       |
  494|   826k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 43.7k, False: 782k]
  ------------------
  495|  43.7k|            return true;
  496|  43.7k|         }
  497|       |
  498|   782k|         return false;
  499|   826k|      }
_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_:
 4106|   826k|                                             [](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|   826k|      {
  409|   826k|         state.has_anchor = false;
  410|   826k|         state.anchor_name.clear();
  411|   826k|         state.anchor_start = nullptr;
  412|   826k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   826k|         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|   826k|            else {
  421|   826k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 43.7k, False: 782k]
  ------------------
  422|   826k|            }
  423|   826k|         }
  424|       |
  425|   826k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 782k, False: 43.7k]
  |  Branch (425:27): [True: 4.82k, False: 777k]
  ------------------
  426|  4.82k|            ++it;
  427|  4.82k|            auto name = parse_anchor_name(it, end);
  428|  4.82k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 9, False: 4.81k]
  ------------------
  429|      9|               ctx.error = error_code::syntax_error;
  430|      9|               return true;
  431|      9|            }
  432|  4.81k|            skip_inline_ws(it, end);
  433|  4.81k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 36, False: 4.78k]
  ------------------
  434|     36|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     36|                  ctx.error = error_code::unexpected_end;
  436|     36|               }
  437|     36|               return true;
  438|     36|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  4.78k|            state.has_anchor = true;
  446|  4.78k|            state.anchor_name = std::string(name);
  447|  4.78k|            state.anchor_start = &*it;
  448|  4.78k|         }
  449|       |
  450|   825k|         return false;
  451|   826k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   826k|      {
  301|   826k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 826k]
  |  Branch (301:27): [True: 782k, False: 43.7k]
  ------------------
  302|       |
  303|  43.7k|         ++it; // skip '*'
  304|  43.7k|         auto name = parse_anchor_name(it, end);
  305|  43.7k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 6, False: 43.7k]
  ------------------
  306|      6|            ctx.error = error_code::syntax_error;
  307|      6|            return true;
  308|      6|         }
  309|       |
  310|  43.7k|         auto anchor_it = ctx.anchors.find(name);
  311|  43.7k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 44, False: 43.6k]
  ------------------
  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|  43.6k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  43.6k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.61k, False: 42.0k]
  ------------------
  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|  42.0k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 8, False: 42.0k]
  ------------------
  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|  42.0k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  42.0k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 42.0k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  42.0k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 42.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|  42.0k|         auto replay_it = span.begin;
  348|  42.0k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  42.0k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  42.0k|         ctx.indent_stack.clear();
  353|  42.0k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 3.77k, False: 38.2k]
  ------------------
  354|  3.77k|            ctx.push_indent(span.base_indent - 1);
  355|  3.77k|         }
  356|       |
  357|  42.0k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  42.0k|         using V = std::remove_cvref_t<T>;
  360|  42.0k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  42.0k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  42.0k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  42.0k|         return true;
  367|  42.0k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|   110k|      {
 2597|   110k|         using V = std::remove_cvref_t<T>;
 2598|   110k|         using value_type = typename V::value_type;
 2599|       |
 2600|   110k|         struct sequence_container_adapter
 2601|   110k|         {
 2602|   110k|            size_t index = 0;
 2603|       |
 2604|   110k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|   110k|            {
 2606|   110k|               if constexpr (!resizable<V>) {
 2607|   110k|                  return index >= container.size();
 2608|   110k|               }
 2609|   110k|               else {
 2610|   110k|                  (void)container;
 2611|   110k|                  return false;
 2612|   110k|               }
 2613|   110k|            }
 2614|       |
 2615|   110k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|   110k|            inline void append(V& container, value_type&& element) noexcept
 2618|   110k|            {
 2619|   110k|               if constexpr (emplace_backable<V>) {
 2620|   110k|                  container.emplace_back(std::move(element));
 2621|   110k|               }
 2622|   110k|               else if constexpr (emplaceable<V>) {
 2623|   110k|                  container.emplace(std::move(element));
 2624|   110k|               }
 2625|   110k|            }
 2626|   110k|         };
 2627|       |
 2628|   110k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 110k]
  |  Branch (2628:27): [True: 0, False: 110k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|   110k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|   110k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|   110k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|   110k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 14, False: 110k]
  ------------------
 2641|     14|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|   110k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 109k, False: 980]
  |  Branch (2644:27): [True: 15.1k, False: 94.4k]
  ------------------
 2645|  15.1k|            ++it;
 2646|  15.1k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  15.1k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 16, False: 15.1k]
  ------------------
 2648|     16|               return;
 2649|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|       |               if (ctx.current_indent() < 0) {
 2651|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|       |               }
 2653|       |            }
 2654|  15.1k|            return;
 2655|  15.1k|         }
 2656|       |
 2657|  95.4k|         bool just_saw_comma = false;
 2658|  95.4k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  95.4k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|   158k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 157k, False: 1.14k]
  ------------------
 2663|   157k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|   157k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 157k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|   157k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 157k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|   157k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 11.2k, False: 146k]
  ------------------
 2673|  11.2k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 11.2k, False: 0]
  ------------------
 2674|  11.2k|                     ++it;
 2675|  11.2k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  11.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 12, False: 11.1k]
  ------------------
 2677|     12|                        return;
 2678|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|       |                        if (ctx.current_indent() < 0) {
 2680|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|       |                        }
 2682|       |                     }
 2683|  11.1k|                     return;
 2684|  11.2k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  11.2k|               }
 2688|       |
 2689|   146k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 365, False: 146k]
  |  Branch (2689:34): [True: 17, False: 146k]
  ------------------
 2690|    382|                  ctx.error = error_code::syntax_error;
 2691|    382|                  return;
 2692|    382|               }
 2693|   146k|               just_saw_comma = false;
 2694|       |
 2695|   146k|               value_type element{};
 2696|   146k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|   146k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 16.0k, False: 130k]
  ------------------
 2699|  16.0k|                  return;
 2700|       |
 2701|   130k|               bool saw_line_break_before_separator = false;
 2702|   130k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|   130k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 23, False: 130k]
  ------------------
 2704|     23|                  return;
 2705|       |
 2706|   130k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 127k, False: 2.18k]
  |  Branch (2706:33): [True: 22.3k, False: 105k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  22.3k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 53, False: 22.2k]
  ------------------
 2709|     53|                     ctx.error = error_code::syntax_error;
 2710|     53|                     return;
 2711|     53|                  }
 2712|  22.2k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  22.2k|                     glz::generic key_node = std::move(element);
 2714|  22.2k|                     ++it;
 2715|  22.2k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  22.2k|                     glz::generic mapped{};
 2718|  22.2k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  22.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 1.00k, False: 21.2k]
  ------------------
 2720|  1.00k|                        return;
 2721|       |
 2722|  21.2k|                     std::string key;
 2723|  21.2k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 4, False: 21.2k]
  ------------------
 2724|      4|                        return;
 2725|       |
 2726|  21.2k|                     glz::generic pair{};
 2727|  21.2k|                     pair[key] = std::move(mapped);
 2728|  21.2k|                     element = std::move(pair);
 2729|       |
 2730|  21.2k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  21.2k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 4, False: 21.2k]
  ------------------
 2732|      4|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  22.2k|               }
 2739|       |
 2740|   129k|               adapter.append(value, std::move(element));
 2741|       |
 2742|   129k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 2.32k, False: 127k]
  ------------------
 2743|  2.32k|                  ctx.error = error_code::unexpected_end;
 2744|  2.32k|                  return;
 2745|  2.32k|               }
 2746|       |
 2747|   127k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 62.0k, False: 65.5k]
  ------------------
 2748|  62.0k|                  ++it;
 2749|  62.0k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  62.0k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 62, False: 62.0k]
  ------------------
 2751|     62|                     return;
 2752|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|       |                     if (ctx.current_indent() < 0) {
 2754|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|       |                     }
 2756|       |                  }
 2757|  62.0k|                  return;
 2758|  62.0k|               }
 2759|  65.5k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 63.3k, False: 2.23k]
  ------------------
 2760|  63.3k|                  ++it;
 2761|  63.3k|                  just_saw_comma = true;
 2762|  63.3k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  63.3k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 13, False: 63.3k]
  ------------------
 2764|     13|                     return;
 2765|  63.3k|               }
 2766|  2.23k|               else {
 2767|  2.23k|                  ctx.error = error_code::syntax_error;
 2768|  2.23k|                  return;
 2769|  2.23k|               }
 2770|   127k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  95.4k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|   782k|      {
 2581|   782k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|   782k|            if constexpr (!check_append_arrays(Opts)) {
 2584|   782k|               value.clear();
 2585|   782k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|   782k|      }
_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_:
 2618|   128k|            {
 2619|   128k|               if constexpr (emplace_backable<V>) {
 2620|   128k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|   128k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|   671k|      {
 3082|   671k|         using V = std::remove_cvref_t<T>;
 3083|   671k|         using value_type = typename V::value_type;
 3084|       |
 3085|   671k|         struct sequence_container_adapter
 3086|   671k|         {
 3087|   671k|            size_t index = 0;
 3088|       |
 3089|   671k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|   671k|            {
 3091|   671k|               if constexpr (!resizable<V>) {
 3092|   671k|                  return index >= container.size();
 3093|   671k|               }
 3094|   671k|               else {
 3095|   671k|                  (void)container;
 3096|   671k|                  return false;
 3097|   671k|               }
 3098|   671k|            }
 3099|       |
 3100|   671k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|   671k|            inline void append(V& container, value_type&& element) noexcept
 3103|   671k|            {
 3104|   671k|               if constexpr (emplace_backable<V>) {
 3105|   671k|                  container.emplace_back(std::move(element));
 3106|   671k|               }
 3107|   671k|               else if constexpr (emplaceable<V>) {
 3108|   671k|                  container.emplace(std::move(element));
 3109|   671k|               }
 3110|   671k|            }
 3111|   671k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|   671k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|   671k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|   671k|         bool first_item = true;
 3122|   671k|         bool has_pending_item_anchor = false;
 3123|   671k|         std::string pending_item_anchor_name{};
 3124|   671k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|  1.40M|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 1.10M, False: 300k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|  1.10M|            int32_t line_indent = 0;
 3137|  1.10M|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|  1.10M|            auto line_start = it;
 3139|       |
 3140|  1.42M|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 1.41M, False: 15.2k]
  ------------------
 3141|  1.41M|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 20.3k, False: 1.39M]
  ------------------
 3142|  20.3k|                  skip_comment(it, end);
 3143|  20.3k|                  skip_newline(it, end);
 3144|  20.3k|                  line_start = it;
 3145|  20.3k|                  line_indent = 0;
 3146|  20.3k|               }
 3147|  1.39M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 53.4k, False: 1.34M]
  |  Branch (3147:40): [True: 165k, False: 1.17M]
  ------------------
 3148|   219k|                  skip_newline(it, end);
 3149|   219k|                  line_start = it;
 3150|   219k|                  line_indent = 0;
 3151|   219k|               }
 3152|  1.17M|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 174k, False: 1.00M]
  ------------------
 3153|   174k|                  line_start = it;
 3154|   174k|                  line_indent = 0;
 3155|   616k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 614k, False: 2.25k]
  |  Branch (3155:39): [True: 441k, False: 172k]
  ------------------
 3156|   441k|                     ++line_indent;
 3157|   441k|                     ++it;
 3158|   441k|                  }
 3159|       |
 3160|   174k|                  bool saw_tab = false;
 3161|   191k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 187k, False: 3.53k]
  |  Branch (3161:40): [True: 8.26k, False: 179k]
  |  Branch (3161:54): [True: 8.11k, False: 171k]
  ------------------
 3162|  16.3k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 12.6k, False: 3.70k]
  |  Branch (3162:43): [True: 3.70k, False: 0]
  ------------------
 3163|  16.3k|                     ++it;
 3164|  16.3k|                  }
 3165|       |
 3166|   174k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 3.53k, False: 171k]
  |  Branch (3166:36): [True: 5.54k, False: 165k]
  |  Branch (3166:51): [True: 56.5k, False: 109k]
  |  Branch (3166:66): [True: 5.29k, False: 103k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|  70.9k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 67.3k, False: 3.53k]
  |  Branch (3168:39): [True: 5.29k, False: 62.0k]
  ------------------
 3169|  5.29k|                        skip_comment(it, end);
 3170|  5.29k|                     }
 3171|  70.9k|                     line_indent = 0;
 3172|  70.9k|                     continue;
 3173|  70.9k|                  }
 3174|       |
 3175|   103k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 18, False: 103k]
  ------------------
 3176|     18|                     ctx.error = error_code::syntax_error;
 3177|     18|                     return;
 3178|     18|                  }
 3179|   103k|                  break; // Found content
 3180|   103k|               }
 3181|  1.00M|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 16.1k, False: 984k]
  ------------------
 3182|  16.1k|                  line_start = it;
 3183|  35.2k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 34.1k, False: 1.19k]
  |  Branch (3183:40): [True: 1.64k, False: 32.4k]
  |  Branch (3183:54): [True: 17.5k, False: 14.9k]
  ------------------
 3184|  16.1k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 1.19k, False: 14.9k]
  |  Branch (3184:36): [True: 575, False: 14.3k]
  |  Branch (3184:51): [True: 6.60k, False: 7.76k]
  |  Branch (3184:66): [True: 7.74k, False: 20]
  ------------------
 3185|  16.1k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 14.9k, False: 1.19k]
  |  Branch (3185:39): [True: 7.74k, False: 7.18k]
  ------------------
 3186|  7.74k|                        skip_comment(it, end);
 3187|  7.74k|                     }
 3188|  16.1k|                     line_indent = 0;
 3189|  16.1k|                     continue;
 3190|  16.1k|                  }
 3191|     20|                  ctx.error = error_code::syntax_error;
 3192|     20|                  return;
 3193|  16.1k|               }
 3194|   984k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|   984k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 671k, False: 312k]
  |  Branch (3198:37): [True: 670k, False: 878]
  ------------------
 3199|   670k|                     line_indent = sequence_indent;
 3200|   670k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|   670k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 670k, False: 0]
  |  Branch (3201:49): [True: 670k, False: 0]
  ------------------
 3202|   670k|                           auto probe = it;
 3203|   670k|                           int32_t leading_ws = 0;
 3204|   670k|                           bool saw_tab = false;
 3205|  1.27M|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 1.27M, False: 0]
  |  Branch (3205:64): [True: 591k, False: 681k]
  |  Branch (3205:87): [True: 11.2k, False: 670k]
  ------------------
 3206|   602k|                              --probe;
 3207|   602k|                              ++leading_ws;
 3208|   602k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 5.10k, False: 597k]
  |  Branch (3208:52): [True: 6.81k, False: 590k]
  ------------------
 3209|   602k|                           }
 3210|   670k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 0, False: 670k]
  |  Branch (3210:61): [True: 10.4k, False: 660k]
  |  Branch (3210:85): [True: 122k, False: 537k]
  ------------------
 3211|   133k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 4, False: 133k]
  ------------------
 3212|      4|                                 ctx.error = error_code::syntax_error;
 3213|      4|                                 return;
 3214|      4|                              }
 3215|   133k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|   133k|                           }
 3217|   670k|                        }
 3218|   670k|                     }
 3219|   670k|                  }
 3220|   670k|                  break;
 3221|   984k|               }
 3222|  1.41M|            }
 3223|       |
 3224|  1.10M|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 15.2k, False: 1.08M]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|  1.08M|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 4.13k, False: 1.08M]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|  1.08M|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 36.3k, False: 1.04M]
  ------------------
 3231|  36.3k|               it = line_start;
 3232|  36.3k|               return;
 3233|  36.3k|            }
 3234|       |
 3235|  1.04M|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 8.26k, False: 1.03M]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  8.26k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 14, False: 8.24k]
  ------------------
 3240|     14|                  ctx.error = error_code::syntax_error;
 3241|     14|                  return;
 3242|     14|               }
 3243|       |
 3244|  8.24k|               ++it;
 3245|  8.24k|               auto pending_name = parse_anchor_name(it, end);
 3246|  8.24k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 13, False: 8.23k]
  ------------------
 3247|     13|                  ctx.error = error_code::syntax_error;
 3248|     13|                  return;
 3249|     13|               }
 3250|  8.23k|               skip_inline_ws(it, end);
 3251|  8.23k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 8.17k, False: 64]
  |  Branch (3251:33): [True: 4.24k, False: 3.92k]
  ------------------
 3252|  4.24k|                  skip_comment(it, end);
 3253|  4.24k|               }
 3254|       |
 3255|  8.23k|               has_pending_item_anchor = true;
 3256|  8.23k|               pending_item_anchor_name = std::string(pending_name);
 3257|  8.23k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  8.23k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 81, False: 8.15k]
  |  Branch (3259:34): [True: 5.10k, False: 3.04k]
  |  Branch (3259:49): [True: 71, False: 5.03k]
  ------------------
 3260|    152|                  ctx.error = error_code::syntax_error;
 3261|    152|                  return;
 3262|    152|               }
 3263|       |
 3264|  8.08k|               skip_newline(it, end);
 3265|  8.08k|               continue;
 3266|  8.23k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|  1.03M|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 297k, False: 742k]
  ------------------
 3270|   297k|               it = line_start;
 3271|   297k|               return;
 3272|   297k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|   742k|            dash_col = line_indent;
 3278|   742k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   742k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 742k, False: 4]
  ------------------
 3280|   742k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|   742k|               }
 3282|   742k|            }
 3283|       |
 3284|   742k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|   742k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 737k, False: 4.74k]
  |  Branch (3287:30): [True: 17.6k, False: 719k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  17.6k|               it = line_start;
 3290|  17.6k|               return;
 3291|  17.6k|            }
 3292|       |
 3293|   724k|            bool saw_tab_after_dash = false;
 3294|  4.55M|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 4.54M, False: 9.91k]
  |  Branch (3294:34): [True: 3.48M, False: 1.06M]
  |  Branch (3294:48): [True: 345k, False: 714k]
  ------------------
 3295|  3.83M|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 2.67M, False: 1.15M]
  |  Branch (3295:59): [True: 268k, False: 890k]
  ------------------
 3296|  3.83M|               ++it;
 3297|  3.83M|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|   724k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 268k, False: 456k]
  |  Branch (3299:39): [True: 264k, False: 3.46k]
  |  Branch (3299:52): [True: 29.8k, False: 234k]
  ------------------
 3300|  29.8k|               const auto after_dash = it + 1;
 3301|  29.8k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 3, False: 29.8k]
  |  Branch (3301:41): [True: 5, False: 29.8k]
  ------------------
 3302|      8|                  ctx.error = error_code::syntax_error;
 3303|      8|                  return;
 3304|      8|               }
 3305|  29.8k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|   724k|            auto parse_element = [&](auto& element) {
 3309|   724k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|   724k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   724k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|   724k|                     return;
 3319|   724k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   724k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   724k|                  ctx.sequence_item_value_context = true;
 3322|   724k|                  ctx.sequence_dash_indent = dash_col;
 3323|   724k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   724k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   724k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   724k|                  ctx.pop_indent();
 3327|   724k|               }
 3328|   724k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   724k|                  skip_ws_and_comment(it, end);
 3331|   724k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   724k|                  auto nested_start = it;
 3335|   724k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   724k|                  if (bool(ctx.error)) [[unlikely]]
 3337|   724k|                     return;
 3338|   724k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   724k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|   724k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|   724k|                     const int32_t element_indent =
 3350|   724k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|   724k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|   724k|                        return;
 3353|   724k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|   724k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|   724k|                     ctx.sequence_item_value_context = true;
 3356|   724k|                     ctx.sequence_dash_indent = dash_col;
 3357|   724k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|   724k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|   724k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|   724k|                     ctx.pop_indent();
 3361|   724k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   724k|               }
 3364|       |
 3365|   724k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|   724k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|   724k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|   724k|                                                                      pending_item_anchor_indent};
 3369|   724k|                  has_pending_item_anchor = false;
 3370|   724k|               }
 3371|   724k|            };
 3372|       |
 3373|   724k|            if constexpr (emplace_backable<V>) {
 3374|   724k|               auto& element = value.emplace_back();
 3375|   724k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|   724k|            first_item = false;
 3394|       |
 3395|   724k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 530, False: 724k]
  ------------------
 3396|    530|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|   724k|         }
 3401|   671k|      }
_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_:
 3308|   724k|            auto parse_element = [&](auto& element) {
 3309|   724k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 714k, False: 9.91k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|   724k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 714k, False: 9.91k]
  |  Branch (3312:33): [True: 475k, False: 238k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   475k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 475k]
  ------------------
 3318|      0|                     return;
 3319|   475k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   475k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   475k|                  ctx.sequence_item_value_context = true;
 3322|   475k|                  ctx.sequence_dash_indent = dash_col;
 3323|   475k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   475k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   475k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   475k|                  ctx.pop_indent();
 3327|   475k|               }
 3328|   248k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   248k|                  skip_ws_and_comment(it, end);
 3331|   248k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   248k|                  auto nested_start = it;
 3335|   248k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   248k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 6, False: 248k]
  ------------------
 3337|      6|                     return;
 3338|   248k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   248k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 129k, False: 119k]
  ------------------
 3344|   248k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 99.1k, False: 149k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  99.1k|                     const int32_t element_indent =
 3350|  99.1k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 99.1k]
  ------------------
 3351|  99.1k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 99.1k]
  ------------------
 3352|      0|                        return;
 3353|  99.1k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  99.1k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  99.1k|                     ctx.sequence_item_value_context = true;
 3356|  99.1k|                     ctx.sequence_dash_indent = dash_col;
 3357|  99.1k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  99.1k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  99.1k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  99.1k|                     ctx.pop_indent();
 3361|  99.1k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   248k|               }
 3364|       |
 3365|   724k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 1.58k, False: 723k]
  |  Branch (3365:47): [True: 1.50k, False: 80]
  ------------------
 3366|  1.50k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 1.33k, False: 166]
  ------------------
 3367|  1.50k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  1.50k|                                                                      pending_item_anchor_indent};
 3369|  1.50k|                  has_pending_item_anchor = false;
 3370|  1.50k|               }
 3371|   724k|            };
_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_:
 5423|  1.41M|   {
 5424|  1.41M|      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|  1.41M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|  1.41M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|  1.41M|            int depth = 0;
 5432|  1.41M|            while (pos != stop) {
 5433|  1.41M|               const char c = *pos;
 5434|  1.41M|               if (c == '"' || c == '\'') {
 5435|  1.41M|                  const char quote = c;
 5436|  1.41M|                  ++pos;
 5437|  1.41M|                  while (pos != stop && *pos != quote) {
 5438|  1.41M|                     if (*pos == '\\' && quote == '"') {
 5439|  1.41M|                        ++pos;
 5440|  1.41M|                        if (pos != stop) ++pos;
 5441|  1.41M|                     }
 5442|  1.41M|                     else {
 5443|  1.41M|                        ++pos;
 5444|  1.41M|                     }
 5445|  1.41M|                  }
 5446|  1.41M|                  if (pos != stop) ++pos;
 5447|  1.41M|                  continue;
 5448|  1.41M|               }
 5449|  1.41M|               if (c == '[' || c == '{') {
 5450|  1.41M|                  ++depth;
 5451|  1.41M|                  ++pos;
 5452|  1.41M|                  continue;
 5453|  1.41M|               }
 5454|  1.41M|               if (c == ']' || c == '}') {
 5455|  1.41M|                  if (depth == 0) return false;
 5456|  1.41M|                  --depth;
 5457|  1.41M|                  ++pos;
 5458|  1.41M|                  continue;
 5459|  1.41M|               }
 5460|  1.41M|               if (c == ',' && depth == 0) return false;
 5461|  1.41M|               if (c == ':' && depth == 0) {
 5462|  1.41M|                  auto next = pos + 1;
 5463|  1.41M|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|  1.41M|               }
 5465|  1.41M|               ++pos;
 5466|  1.41M|            }
 5467|  1.41M|            return false;
 5468|  1.41M|         };
 5469|       |
 5470|  1.41M|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5470:14): [True: 386k, False: 1.02M]
  |  Branch (5470:49): [True: 23.8k, False: 1.00M]
  ------------------
 5471|   410k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5471:17): [True: 365k, False: 44.8k]
  ------------------
 5472|   365k|               return;
 5473|   365k|            }
 5474|  44.8k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5474:17): [True: 5.83k, False: 39.0k]
  ------------------
 5475|  5.83k|               return;
 5476|  5.83k|            }
 5477|  44.8k|         }
 5478|       |
 5479|  1.04M|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|  1.04M|         return;
 5481|  1.41M|      }
 5482|       |
 5483|  1.41M|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 0, False: 1.41M]
  ------------------
 5484|      0|         return;
 5485|      0|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|  1.41M|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 0, False: 1.41M]
  ------------------
 5488|      0|         return;
 5489|      0|      }
 5490|  1.41M|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|  1.41M|   }
_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_:
 5427|  1.41M|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|  1.41M|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|  1.41M|            int depth = 0;
 5432|  65.6M|            while (pos != stop) {
  ------------------
  |  Branch (5432:20): [True: 65.2M, False: 427k]
  ------------------
 5433|  65.2M|               const char c = *pos;
 5434|  65.2M|               if (c == '"' || c == '\'') {
  ------------------
  |  Branch (5434:20): [True: 238k, False: 64.9M]
  |  Branch (5434:32): [True: 223k, False: 64.7M]
  ------------------
 5435|   462k|                  const char quote = c;
 5436|   462k|                  ++pos;
 5437|  48.7M|                  while (pos != stop && *pos != quote) {
  ------------------
  |  Branch (5437:26): [True: 48.5M, False: 180k]
  |  Branch (5437:41): [True: 48.2M, False: 281k]
  ------------------
 5438|  48.2M|                     if (*pos == '\\' && quote == '"') {
  ------------------
  |  Branch (5438:26): [True: 169k, False: 48.0M]
  |  Branch (5438:42): [True: 116k, False: 52.9k]
  ------------------
 5439|   116k|                        ++pos;
 5440|   116k|                        if (pos != stop) ++pos;
  ------------------
  |  Branch (5440:29): [True: 107k, False: 9.28k]
  ------------------
 5441|   116k|                     }
 5442|  48.1M|                     else {
 5443|  48.1M|                        ++pos;
 5444|  48.1M|                     }
 5445|  48.2M|                  }
 5446|   462k|                  if (pos != stop) ++pos;
  ------------------
  |  Branch (5446:23): [True: 281k, False: 180k]
  ------------------
 5447|   462k|                  continue;
 5448|   462k|               }
 5449|  64.7M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5449:20): [True: 2.25M, False: 62.5M]
  |  Branch (5449:32): [True: 478k, False: 62.0M]
  ------------------
 5450|  2.73M|                  ++depth;
 5451|  2.73M|                  ++pos;
 5452|  2.73M|                  continue;
 5453|  2.73M|               }
 5454|  62.0M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5454:20): [True: 80.3k, False: 61.9M]
  |  Branch (5454:32): [True: 162k, False: 61.7M]
  ------------------
 5455|   243k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5455:23): [True: 86.1k, False: 157k]
  ------------------
 5456|   157k|                  --depth;
 5457|   157k|                  ++pos;
 5458|   157k|                  continue;
 5459|   243k|               }
 5460|  61.7M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5460:20): [True: 2.34M, False: 59.4M]
  |  Branch (5460:32): [True: 389k, False: 1.95M]
  ------------------
 5461|  61.3M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5461:20): [True: 1.18M, False: 60.2M]
  |  Branch (5461:32): [True: 513k, False: 671k]
  ------------------
 5462|   513k|                  auto next = pos + 1;
 5463|   513k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5463:26): [True: 14.8k, False: 498k]
  |  Branch (5463:41): [True: 211k, False: 287k]
  |  Branch (5463:57): [True: 55.4k, False: 231k]
  |  Branch (5463:74): [True: 36.3k, False: 195k]
  |  Branch (5463:91): [True: 68.9k, False: 126k]
  ------------------
 5464|   513k|               }
 5465|  60.8M|               ++pos;
 5466|  60.8M|            }
 5467|   427k|            return false;
 5468|  1.41M|         };
_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_:
 5848|   116k|            auto is_word_boundary = [&](const auto ptr) {
 5849|   116k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 7.11k, False: 109k]
  ------------------
 5850|  7.11k|                  return true;
 5851|  7.11k|               }
 5852|   109k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 82.1k, False: 26.9k]
  ------------------
 5853|  82.1k|                  auto next = ptr + 1;
 5854|  82.1k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 1.28k, False: 80.8k]
  |  Branch (5854:43): [True: 2.07k, False: 78.7k]
  |  Branch (5854:59): [True: 26.8k, False: 51.9k]
  |  Branch (5854:76): [True: 4.72k, False: 47.2k]
  |  Branch (5854:93): [True: 24.8k, False: 22.3k]
  ------------------
 5855|  82.1k|               }
 5856|  26.9k|               return is_plain_scalar_boundary(*ptr);
 5857|   109k|            };
_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:
 5774|  26.9k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  26.9k|               switch (ch) {
 5776|  1.33k|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 1.33k, False: 25.6k]
  ------------------
 5777|  2.60k|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 1.26k, False: 25.6k]
  ------------------
 5778|  12.6k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 10.0k, False: 16.9k]
  ------------------
 5779|  14.3k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 1.69k, False: 25.2k]
  ------------------
 5780|  15.6k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 1.35k, False: 25.5k]
  ------------------
 5781|  16.5k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 882, False: 26.0k]
  ------------------
 5782|  17.5k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 964, False: 25.9k]
  ------------------
 5783|  17.5k|                  return true;
 5784|  9.41k|               default:
  ------------------
  |  Branch (5784:16): [True: 9.41k, False: 17.5k]
  ------------------
 5785|  9.41k|                  return false;
 5786|  26.9k|               }
 5787|  26.9k|            };
_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_:
 5789|  84.4k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  84.4k|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  84.4k|                  return false;
 5792|  84.4k|               }
 5793|  84.4k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 0, False: 84.4k]
  ------------------
 5794|      0|                  return false;
 5795|      0|               }
 5796|  84.4k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 84.4k, False: 0]
  |  Branch (5796:40): [True: 0, False: 0]
  |  Branch (5796:61): [True: 0, False: 0]
  ------------------
 5797|      0|                  return false;
 5798|      0|               }
 5799|       |
 5800|  84.4k|               auto look = word_end;
 5801|  84.4k|               yaml::skip_newline(look, end);
 5802|  84.4k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 0, False: 84.4k]
  ------------------
 5803|      0|                  int32_t line_indent = 0;
 5804|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 0, False: 0]
  |  Branch (5804:41): [True: 0, False: 0]
  ------------------
 5805|      0|                     ++line_indent;
 5806|      0|                     ++look;
 5807|      0|                  }
 5808|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 0, False: 0]
  |  Branch (5808:38): [True: 0, False: 0]
  ------------------
 5809|      0|                     return false;
 5810|      0|                  }
 5811|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 0, False: 0]
  |  Branch (5811:38): [True: 0, False: 0]
  |  Branch (5811:55): [True: 0, False: 0]
  ------------------
 5812|      0|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 0, False: 0]
  ------------------
 5813|      0|                        yaml::skip_newline(look, end);
 5814|      0|                        continue;
 5815|      0|                     }
 5816|      0|                     return false;
 5817|      0|                  }
 5818|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 0, False: 0]
  ------------------
 5819|      0|                     yaml::skip_comment(look, end);
 5820|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 0, False: 0]
  |  Branch (5820:42): [True: 0, False: 0]
  |  Branch (5820:59): [True: 0, False: 0]
  ------------------
 5821|      0|                        yaml::skip_newline(look, end);
 5822|      0|                        continue;
 5823|      0|                     }
 5824|      0|                     return false;
 5825|      0|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|      0|                  {
 5831|      0|                     auto scan = look;
 5832|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 0, False: 0]
  |  Branch (5832:44): [True: 0, False: 0]
  |  Branch (5832:61): [True: 0, False: 0]
  ------------------
 5833|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 0, False: 0]
  ------------------
 5834|      0|                           auto after_colon = scan + 1;
 5835|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 0, False: 0]
  |  Branch (5835:54): [True: 0, False: 0]
  |  Branch (5835:77): [True: 0, False: 0]
  ------------------
 5836|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 0, False: 0]
  |  Branch (5836:56): [True: 0, False: 0]
  ------------------
 5837|      0|                              return false;
 5838|      0|                           }
 5839|      0|                        }
 5840|      0|                        ++scan;
 5841|      0|                     }
 5842|      0|                  }
 5843|       |
 5844|      0|                  return line_indent > ctx.current_indent();
 5845|      0|               }
 5846|  84.4k|               return false;
 5847|  84.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_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj1EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5377|   638k|   {
 5378|   638k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   638k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   638k|         const bool could_be_mapping = [&] {
 5386|   638k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   638k|               return line_could_be_flow_mapping(it, end);
 5388|   638k|            }
 5389|   638k|            else {
 5390|   638k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   638k|            }
 5392|   638k|         }();
 5393|   638k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 248k, False: 390k]
  ------------------
 5394|   248k|            return false;
 5395|   248k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   390k|         auto temp_ctx = ctx.make_speculative();
 5398|   390k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   390k|                                                                                               end);
 5400|   390k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   390k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   390k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 379k, False: 10.9k]
  ------------------
 5403|   379k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   379k|            return true;
 5405|   379k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  10.9k|         ctx.error = temp_ctx.error;
 5410|  10.9k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  10.9k|         return false;
 5412|   390k|      }
 5413|   638k|   }
_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:
 5385|   638k|         const bool could_be_mapping = [&] {
 5386|   638k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   638k|               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|       |            else {
 5390|       |               return yaml::line_could_be_block_mapping(it, end);
 5391|       |            }
 5392|   638k|         }();
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|   319k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|   319k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   319k|                     val = glz::generic{};
 4665|   319k|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|   319k|               };
_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_:
 3633|   545k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   545k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 545k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   545k|         const int32_t parent_indent = ctx.current_indent();
 3644|   545k|         const bool discover_indent = (mapping_indent < 0);
 3645|   545k|         bool first_key = !discover_indent;
 3646|   545k|         bool discovered_first_key_mid_line = false;
 3647|   545k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|  1.39M|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 1.05M, False: 332k]
  ------------------
 3650|  1.05M|            auto line_start = it;
 3651|  1.05M|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 1.05M]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|  1.18M|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 1.16M, False: 12.3k]
  ------------------
 3655|  1.16M|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 26.5k, False: 1.14M]
  ------------------
 3656|  26.5k|                  skip_comment(it, end);
 3657|  26.5k|                  skip_newline(it, end);
 3658|  26.5k|                  first_key = false;
 3659|  26.5k|                  line_indent = 0;
 3660|  26.5k|               }
 3661|  1.14M|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 17.5k, False: 1.12M]
  |  Branch (3661:40): [True: 56.3k, False: 1.06M]
  ------------------
 3662|  73.8k|                  skip_newline(it, end);
 3663|  73.8k|                  first_key = false;
 3664|  73.8k|                  line_indent = 0;
 3665|  73.8k|               }
 3666|  1.06M|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 403k, False: 664k]
  ------------------
 3667|   403k|                  line_start = it;
 3668|   403k|                  line_indent = 0;
 3669|  1.08M|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 1.07M, False: 1.53k]
  |  Branch (3669:39): [True: 676k, False: 402k]
  ------------------
 3670|   676k|                     ++line_indent;
 3671|   676k|                     ++it;
 3672|   676k|                  }
 3673|       |
 3674|   403k|                  bool saw_tab = false;
 3675|   409k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 407k, False: 1.57k]
  |  Branch (3675:40): [True: 2.31k, False: 405k]
  |  Branch (3675:54): [True: 2.91k, False: 402k]
  ------------------
 3676|  5.23k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 3.14k, False: 2.08k]
  |  Branch (3676:43): [True: 2.08k, False: 0]
  ------------------
 3677|  5.23k|                     ++it;
 3678|  5.23k|                  }
 3679|       |
 3680|   403k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 1.57k, False: 402k]
  |  Branch (3680:36): [True: 4.55k, False: 397k]
  |  Branch (3680:51): [True: 3.76k, False: 393k]
  |  Branch (3680:66): [True: 8.88k, False: 385k]
  ------------------
 3681|  18.7k|                     first_key = false;
 3682|  18.7k|                     line_indent = 0;
 3683|  18.7k|                     continue; // Blank or comment line
 3684|  18.7k|                  }
 3685|       |
 3686|   385k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 99, False: 384k]
  ------------------
 3687|     99|                     ctx.error = error_code::syntax_error;
 3688|     99|                     return;
 3689|     99|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|   384k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 382k, False: 2.45k]
  |  Branch (3692:46): [True: 588, False: 381k]
  ------------------
 3693|    588|                     it = line_start;
 3694|    588|                     return;
 3695|    588|                  }
 3696|       |
 3697|   384k|                  first_key = false;
 3698|   384k|                  break; // Found content
 3699|   384k|               }
 3700|   664k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 2.58k, False: 661k]
  ------------------
 3701|  2.58k|                  line_start = it;
 3702|  9.44k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 9.25k, False: 193]
  |  Branch (3702:40): [True: 1.85k, False: 7.40k]
  |  Branch (3702:54): [True: 5.00k, False: 2.39k]
  ------------------
 3703|  2.58k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 193, False: 2.39k]
  |  Branch (3703:36): [True: 384, False: 2.01k]
  |  Branch (3703:51): [True: 1.11k, False: 900]
  |  Branch (3703:66): [True: 785, False: 115]
  ------------------
 3704|  2.47k|                     first_key = false;
 3705|  2.47k|                     line_indent = 0;
 3706|  2.47k|                     continue; // Blank or comment-only line with tab indentation
 3707|  2.47k|                  }
 3708|    115|                  ctx.error = error_code::syntax_error;
 3709|    115|                  return;
 3710|  2.58k|               }
 3711|   661k|               else {
 3712|   661k|                  line_start = it;
 3713|   661k|                  break; // Content at column 0
 3714|   661k|               }
 3715|  1.16M|            }
 3716|       |
 3717|  1.05M|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 12.3k, False: 1.04M]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|  1.04M|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 3.87k, False: 1.04M]
  |  Branch (3721:45): [True: 871, False: 1.04M]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|  1.04M|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 1.04M, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|  1.04M|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 1.04M, False: 0]
  |  Branch (3728:39): [True: 497k, False: 543k]
  |  Branch (3728:62): [True: 231k, False: 266k]
  |  Branch (3728:84): [True: 154k, False: 77.4k]
  ------------------
 3729|   154k|                  it = line_start;
 3730|   154k|                  return;
 3731|   154k|               }
 3732|   887k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 343k, False: 543k]
  |  Branch (3732:43): [True: 31, False: 343k]
  ------------------
 3733|     31|                  it = line_start;
 3734|     31|                  return;
 3735|     31|               }
 3736|   887k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   887k|            bool established_mapping_indent_this_line = false;
 3740|   887k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 543k, False: 343k]
  ------------------
 3741|   543k|               mapping_indent = line_indent;
 3742|   543k|               established_mapping_indent_this_line = true;
 3743|   543k|               discovered_first_key_visual_indent = line_indent;
 3744|   543k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   543k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 543k, False: 0]
  |  Branch (3745:43): [True: 537k, False: 6.50k]
  ------------------
 3746|   537k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   537k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 358, False: 536k]
  ------------------
 3748|    358|                        ctx.error = error_code::syntax_error;
 3749|    358|                        return;
 3750|    358|                     }
 3751|       |
 3752|   536k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   536k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 534k, False: 2.45k]
  |  Branch (3753:49): [True: 405k, False: 129k]
  ------------------
 3754|   405k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   405k|                     }
 3756|   536k|                  }
 3757|   543k|               }
 3758|   543k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   887k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 886k, False: 358]
  |  Branch (3762:36): [True: 886k, False: 0]
  |  Branch (3762:59): [True: 343k, False: 543k]
  ------------------
 3763|   343k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 63.1k, False: 280k]
  ------------------
 3764|  63.1k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 62.4k, False: 659]
  |  Branch (3764:43): [True: 32.5k, False: 29.9k]
  ------------------
 3765|  32.5k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 53, False: 32.4k]
  ------------------
 3766|     53|                     ctx.error = error_code::syntax_error;
 3767|     53|                     return;
 3768|     53|                  }
 3769|  32.4k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 1.50k, False: 30.9k]
  ------------------
 3770|  1.50k|                     it = line_start;
 3771|  1.50k|                     return;
 3772|  1.50k|                  }
 3773|  32.4k|               }
 3774|  30.6k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 2.27k, False: 28.3k]
  ------------------
 3775|  2.27k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 329, False: 1.94k]
  |  Branch (3775:47): [True: 3, False: 1.93k]
  ------------------
 3776|  1.93k|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 1.93k, False: 0]
  |  Branch (3776:49): [True: 1.93k, False: 0]
  |  Branch (3776:72): [True: 15, False: 1.92k]
  ------------------
 3777|    347|                  ctx.error = error_code::syntax_error;
 3778|    347|                  return;
 3779|    347|               }
 3780|  63.1k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   885k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 885k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   885k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 885k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   885k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 358, False: 884k]
  |  Branch (3798:32): [True: 0, False: 884k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   885k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 494k, False: 390k]
  |  Branch (3807:53): [True: 160k, False: 334k]
  |  Branch (3807:94): [True: 39.5k, False: 121k]
  ------------------
 3808|  39.5k|               const auto after_colon = it + 1;
 3809|  39.5k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 34.6k, False: 4.89k]
  ------------------
 3810|  39.5k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 30, False: 39.4k]
  |  Branch (3810:43): [True: 34.6k, False: 4.85k]
  ------------------
 3811|  34.6k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 490, False: 34.1k]
  ------------------
 3812|    490|                  it = line_start;
 3813|    490|                  return;
 3814|    490|               }
 3815|  39.5k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   884k|            int32_t effective_line_indent = line_indent;
 3819|   884k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 884k, False: 358]
  |  Branch (3819:36): [True: 543k, False: 341k]
  ------------------
 3820|   543k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 405k, False: 138k]
  ------------------
 3821|   405k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 355k, False: 49.2k]
  |  Branch (3821:52): [True: 21.5k, False: 334k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   383k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   383k|            }
 3834|       |
 3835|   884k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 38.6k, False: 846k]
  ------------------
 3836|  38.6k|               return;
 3837|  38.6k|            }
 3838|   846k|            first_key = false;
 3839|       |
 3840|   846k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 846k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|       |               auto flow_end = it;
 3847|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|       |               if (bool(ctx.error)) [[unlikely]]
 3849|       |                  return;
 3850|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3851|       |                  it = flow_end;
 3852|       |                  return;
 3853|       |               }
 3854|       |            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   846k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 600k, False: 246k]
  ------------------
 3860|   600k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 338k, False: 261k]
  |  Branch (3860:34): [True: 3.14k, False: 258k]
  ------------------
 3861|   342k|                  auto peek = it;
 3862|   342k|                  skip_inline_ws(peek, end);
 3863|   342k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 341k, False: 235]
  |  Branch (3863:38): [True: 339k, False: 1.97k]
  |  Branch (3863:55): [True: 337k, False: 2.12k]
  |  Branch (3863:72): [True: 333k, False: 4.51k]
  ------------------
 3864|   333k|                     continue; // At leading indent of new line
 3865|   333k|                  }
 3866|   342k|               }
 3867|   266k|               skip_inline_ws(it, end);
 3868|   266k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 266k, False: 235]
  |  Branch (3868:33): [True: 15.8k, False: 250k]
  ------------------
 3869|  15.8k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  15.8k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 15.8k, False: 0]
  ------------------
 3871|  15.8k|                        const char prev = *(it - 1);
 3872|  15.8k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 5.80k, False: 10.0k]
  |  Branch (3872:44): [True: 1.93k, False: 3.87k]
  |  Branch (3872:60): [True: 881, False: 1.05k]
  |  Branch (3872:76): [True: 23, False: 858]
  ------------------
 3873|     23|                           ctx.error = error_code::syntax_error;
 3874|     23|                           return;
 3875|     23|                        }
 3876|  15.8k|                     }
 3877|  15.8k|                  }
 3878|  15.8k|               }
 3879|  15.8k|               skip_comment(it, end);
 3880|   266k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 266k, False: 626]
  |  Branch (3880:34): [True: 79.7k, False: 186k]
  |  Branch (3880:49): [True: 119k, False: 67.4k]
  ------------------
 3881|   198k|                  skip_newline(it, end);
 3882|   198k|               }
 3883|  68.0k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 67.4k, False: 626]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|  67.4k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|  67.4k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 1.12k, False: 66.3k]
  ------------------
 3890|  1.12k|                        ctx.error = error_code::syntax_error;
 3891|  1.12k|                        return;
 3892|  1.12k|                     }
 3893|  67.4k|                  }
 3894|  67.4k|               }
 3895|   266k|            }
 3896|   846k|         }
 3897|   545k|      }
_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:
 4777|   884k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   884k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   884k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   884k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   884k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   884k|                           if (ctx.stream_begin) {
 4788|   884k|                              auto is_line_content_start = [&](auto pos) {
 4789|   884k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   884k|                              };
 4791|       |
 4792|   884k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   884k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   884k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   884k|                                 return line != end && *line == ':';
 4796|   884k|                              };
 4797|       |
 4798|   884k|                              if (!is_line_content_start(it) &&
 4799|   884k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   884k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   884k|                                 ctx.error = error_code::syntax_error;
 4802|   884k|                                 return false;
 4803|   884k|                              }
 4804|   884k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   884k|                           }
 4806|   884k|                        }
 4807|       |
 4808|   884k|                        if (*it == '-' &&
 4809|   884k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   884k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   884k|                           ctx.error = error_code::syntax_error;
 4813|   884k|                           return false;
 4814|   884k|                        }
 4815|       |
 4816|   884k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   884k|                           return false;
 4818|   884k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   884k|                        ctx.pop_indent();
 4820|   884k|                     }
 4821|   884k|                     else {
 4822|   884k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   884k|                        if (nested_indent >= 0) {
 4824|   884k|                           yaml::skip_to_content(it, end);
 4825|   884k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   884k|                              ctx.error = error_code::syntax_error;
 4827|   884k|                              return false;
 4828|   884k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   884k|                           const int32_t value_indent =
 4832|   884k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   884k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   884k|                              return false;
 4835|   884k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   884k|                           ctx.pop_indent();
 4837|   884k|                        }
 4838|   884k|                     }
 4839|   884k|                     return !bool(ctx.error);
 4840|   884k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   884k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 314k, False: 570k]
  |  Branch (4845:37): [True: 313k, False: 671]
  |  Branch (4845:58): [True: 10, False: 313k]
  ------------------
 4846|     10|                     ctx.error = error_code::syntax_error;
 4847|     10|                     return false;
 4848|     10|                  }
 4849|   884k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 314k, False: 570k]
  |  Branch (4849:38): [True: 671, False: 313k]
  |  Branch (4849:57): [True: 96.1k, False: 217k]
  |  Branch (4849:77): [True: 195k, False: 21.8k]
  |  Branch (4849:98): [True: 14.8k, False: 7.06k]
  ------------------
 4850|   307k|                     ++it; // skip '?'
 4851|   307k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   307k|                     const int32_t explicit_value_indicator_indent =
 4854|   307k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 79.8k, False: 227k]
  ------------------
 4855|       |
 4856|   307k|                     key_t key{};
 4857|   307k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   307k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   307k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   307k|                        };
 4861|       |
 4862|   307k|                        auto key_it = it;
 4863|   307k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   307k|                        auto content = key_it;
 4866|   307k|                        yaml::skip_to_content(content, end);
 4867|   307k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   307k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 304k, False: 2.53k]
  |  Branch (4872:47): [True: 95.5k, False: 208k]
  ------------------
 4873|  95.5k|                           auto anchor_probe = content + 1;
 4874|  95.5k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|  95.5k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 95.5k, False: 18]
  ------------------
 4876|  95.5k|                              auto after_anchor = anchor_probe;
 4877|  95.5k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|  95.5k|                              auto value_indicator = after_anchor;
 4880|  95.5k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 91.0k, False: 4.55k]
  |  Branch (4880:61): [True: 3.41k, False: 87.6k]
  ------------------
 4881|  3.41k|                                 key.clear();
 4882|  3.41k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  3.41k|                                 it = value_indicator;
 4884|  3.41k|                                 handled_anchor_only_empty_key = true;
 4885|  3.41k|                              }
 4886|  92.1k|                              else {
 4887|  92.1k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 87.6k, False: 4.55k]
  |  Branch (4887:64): [True: 2.31k, False: 85.2k]
  ------------------
 4888|  2.31k|                                    yaml::skip_comment(value_indicator, end);
 4889|  2.31k|                                 }
 4890|  92.1k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 87.5k, False: 4.57k]
  |  Branch (4890:65): [True: 10.5k, False: 77.0k]
  |  Branch (4890:93): [True: 9.26k, False: 67.7k]
  ------------------
 4891|  19.8k|                                    yaml::skip_newline(value_indicator, end);
 4892|  19.8k|                                    auto value_line = value_indicator;
 4893|  19.8k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  19.8k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 3, False: 19.8k]
  ------------------
 4895|      3|                                       return false;
 4896|  19.8k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 17.6k, False: 2.17k]
  |  Branch (4896:62): [True: 1.91k, False: 15.7k]
  ------------------
 4897|  1.91k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 1.87k, False: 33]
  ------------------
 4898|  1.87k|                                       key.clear();
 4899|  1.87k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  1.87k|                                       it = value_line;
 4901|  1.87k|                                       handled_anchor_only_empty_key = true;
 4902|  1.87k|                                    }
 4903|  17.9k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 15.7k, False: 2.17k]
  |  Branch (4903:67): [True: 33, False: 15.7k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|     33|                                       ctx.error = error_code::syntax_error;
 4908|     33|                                       return false;
 4909|     33|                                    }
 4910|  19.8k|                                 }
 4911|  92.1k|                              }
 4912|  95.5k|                           }
 4913|  95.5k|                        }
 4914|       |
 4915|   306k|                        const bool key_content_spans_lines = [&] {
 4916|   306k|                           auto scan = key_it;
 4917|   306k|                           while (scan != content && scan != end) {
 4918|   306k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   306k|                              ++scan;
 4920|   306k|                           }
 4921|   306k|                           return false;
 4922|   306k|                        }();
 4923|       |
 4924|   306k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 5.29k, False: 301k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  5.29k|                        }
 4927|   301k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 2.53k, False: 299k]
  |  Branch (4927:53): [True: 5.21k, False: 293k]
  |  Branch (4927:72): [True: 2.96k, False: 2.25k]
  ------------------
 4928|  5.49k|                           key.clear();
 4929|  5.49k|                           it = content;
 4930|  5.49k|                        }
 4931|   296k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   296k|                           auto key_node_it = content;
 4937|   296k|                           auto key_node_end = end;
 4938|   296k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   296k|                              auto scan = content;
 4943|  3.62M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 3.46M, False: 160k]
  ------------------
 4944|   576M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 576M, False: 65.6k]
  |  Branch (4944:56): [True: 574M, False: 1.89M]
  |  Branch (4944:73): [True: 572M, False: 1.50M]
  ------------------
 4945|   572M|                                    ++scan;
 4946|   572M|                                 }
 4947|  3.46M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 65.6k, False: 3.40M]
  ------------------
 4948|  65.6k|                                    break;
 4949|  65.6k|                                 }
 4950|       |
 4951|  3.40M|                                 yaml::skip_newline(scan, end);
 4952|  3.40M|                                 auto line_start = scan;
 4953|       |
 4954|  3.40M|                                 int32_t indicator_indent = 0;
 4955|  5.07M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 4.91M, False: 160k]
  |  Branch (4955:56): [True: 1.67M, False: 3.24M]
  ------------------
 4956|  1.67M|                                    ++indicator_indent;
 4957|  1.67M|                                    ++scan;
 4958|  1.67M|                                 }
 4959|       |
 4960|  3.40M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 3.24M, False: 160k]
  |  Branch (4960:53): [True: 531k, False: 2.70M]
  ------------------
 4961|   531k|                                    const auto after_colon = scan + 1;
 4962|   531k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 644, False: 530k]
  ------------------
 4963|   530k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 425k, False: 105k]
  ------------------
 4964|   426k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 69.5k, False: 356k]
  ------------------
 4965|  69.5k|                                       key_node_end = line_start;
 4966|  69.5k|                                       break;
 4967|  69.5k|                                    }
 4968|   531k|                                 }
 4969|  3.40M|                              }
 4970|   296k|                           }
 4971|       |
 4972|   296k|                           glz::generic key_node{};
 4973|   296k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   296k|                           ctx.explicit_mapping_key_context = true;
 4975|   296k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   296k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   296k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 6.81k, False: 289k]
  ------------------
 4978|  6.81k|                              return false;
 4979|   289k|                           it = key_node_it;
 4980|   289k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 76, False: 289k]
  ------------------
 4981|     76|                              return false;
 4982|   289k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   300k|                     yaml::skip_inline_ws(it, end);
 4993|   307k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   307k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 205k, False: 101k]
  |  Branch (4996:40): [True: 25.0k, False: 180k]
  |  Branch (4996:55): [True: 81.5k, False: 99.1k]
  ------------------
 4997|   106k|                        auto probe = it;
 4998|   106k|                        bool found_value_indicator = false;
 4999|       |
 5000|   218k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 143k, False: 75.2k]
  |  Branch (5000:49): [True: 34.8k, False: 108k]
  |  Branch (5000:67): [True: 108k, False: 0]
  ------------------
 5001|   143k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   143k|                           auto value_line = probe;
 5004|   143k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   143k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 24, False: 143k]
  ------------------
 5006|     24|                              return false;
 5007|       |
 5008|   143k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 75.2k, False: 68.3k]
  |  Branch (5008:53): [True: 5.71k, False: 62.5k]
  |  Branch (5008:76): [True: 25.6k, False: 36.9k]
  ------------------
 5009|   106k|                              probe = value_line;
 5010|   106k|                              continue; // blank line
 5011|   106k|                           }
 5012|  36.9k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 5.72k, False: 31.2k]
  ------------------
 5013|  5.72k|                              yaml::skip_comment(value_line, end);
 5014|  5.72k|                              probe = value_line;
 5015|  5.72k|                              continue; // comment-only line
 5016|  5.72k|                           }
 5017|  31.2k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 7.39k, False: 23.8k]
  |  Branch (5017:54): [True: 1.32k, False: 6.07k]
  ------------------
 5018|  1.32k|                              it = value_line;
 5019|  1.32k|                              found_value_indicator = true;
 5020|  1.32k|                           }
 5021|  31.2k|                           break;
 5022|  36.9k|                        }
 5023|       |
 5024|   106k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 1.32k, False: 105k]
  ------------------
 5025|  1.32k|                           yaml::skip_inline_ws(it, end);
 5026|  1.32k|                        }
 5027|   106k|                     }
 5028|       |
 5029|   306k|                     val_t val{};
 5030|   306k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 205k, False: 101k]
  |  Branch (5030:39): [True: 86.2k, False: 119k]
  ------------------
 5031|  86.2k|                        ++it;
 5032|  86.2k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 84.6k, False: 1.58k]
  |  Branch (5032:42): [True: 5, False: 84.6k]
  ------------------
 5033|      5|                           ctx.error = error_code::syntax_error;
 5034|      5|                           return false;
 5035|      5|                        }
 5036|  86.2k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 84.6k, False: 1.58k]
  |  Branch (5036:43): [True: 1.86k, False: 82.8k]
  |  Branch (5036:58): [True: 5.46k, False: 77.3k]
  ------------------
 5037|  7.33k|                           auto probe = it;
 5038|  7.33k|                           yaml::skip_newline(probe, end);
 5039|  15.0k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 13.8k, False: 1.24k]
  |  Branch (5039:51): [True: 7.74k, False: 6.09k]
  ------------------
 5040|  7.33k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 6.09k, False: 1.24k]
  |  Branch (5040:48): [True: 907, False: 5.18k]
  |  Branch (5040:65): [True: 899, False: 8]
  |  Branch (5040:89): [True: 2, False: 897]
  ------------------
 5041|      2|                              ctx.error = error_code::syntax_error;
 5042|      2|                              return false;
 5043|      2|                           }
 5044|  7.33k|                        }
 5045|  86.2k|                        yaml::skip_inline_ws(it, end);
 5046|  86.2k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 978, False: 85.2k]
  ------------------
 5047|    978|                           return false;
 5048|  86.2k|                     }
 5049|       |
 5050|   306k|                     value.emplace(std::move(key), std::move(val));
 5051|   306k|                     return true;
 5052|   306k|                  }
 5053|       |
 5054|   577k|                  key_t key{};
 5055|   577k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   577k|                     auto key_probe = it;
 5057|   577k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   577k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 577k, False: 0]
  |  Branch (5058:74): [True: 1.85k, False: 575k]
  |  Branch (5058:95): [True: 2.10k, False: 573k]
  ------------------
 5059|   577k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 3.95k, False: 573k]
  ------------------
 5060|  3.95k|                        glz::generic key_node{};
 5061|  3.95k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  3.95k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 883, False: 3.07k]
  ------------------
 5063|    883|                           return false;
 5064|  3.07k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 2, False: 3.07k]
  ------------------
 5065|      2|                           return false;
 5066|  3.07k|                     }
 5067|   573k|                     else {
 5068|   573k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 3.05k, False: 570k]
  ------------------
 5069|  3.05k|                           return false;
 5070|  3.05k|                        }
 5071|   573k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   573k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   577k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 5.72k, False: 571k]
  |  Branch (5081:36): [True: 1.72k, False: 569k]
  ------------------
 5082|  3.51k|                     ctx.error = error_code::syntax_error;
 5083|  3.51k|                     return false;
 5084|  3.51k|                  }
 5085|   573k|                  ++it;
 5086|   573k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   573k|                  val_t val{};
 5089|   573k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 23.2k, False: 550k]
  ------------------
 5090|  23.2k|                     return false;
 5091|       |
 5092|   550k|                  value.emplace(std::move(key), std::move(val));
 5093|   550k|                  return true;
 5094|   573k|               });
_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:
 4915|   306k|                        const bool key_content_spans_lines = [&] {
 4916|   306k|                           auto scan = key_it;
 4917|   331k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 239k, False: 92.1k]
  |  Branch (4917:54): [True: 239k, False: 0]
  ------------------
 4918|   239k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 197k, False: 41.9k]
  |  Branch (4918:52): [True: 17.3k, False: 24.5k]
  ------------------
 4919|  24.5k|                              ++scan;
 4920|  24.5k|                           }
 4921|  92.1k|                           return false;
 4922|   306k|                        }();
_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_:
 4858|   289k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   289k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   289k|                        };
_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_:
 4778|   656k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   656k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 649k, False: 6.42k]
  |  Branch (4779:39): [True: 483k, False: 166k]
  ------------------
 4780|   483k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   483k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   483k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 483k, False: 0]
  ------------------
 4788|   483k|                              auto is_line_content_start = [&](auto pos) {
 4789|   483k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   483k|                              };
 4791|       |
 4792|   483k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   483k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   483k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   483k|                                 return line != end && *line == ':';
 4796|   483k|                              };
 4797|       |
 4798|   483k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 483k, False: 0]
  ------------------
 4799|   483k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 34.0k, False: 449k]
  ------------------
 4800|  34.0k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 961, False: 33.0k]
  ------------------
 4801|    961|                                 ctx.error = error_code::syntax_error;
 4802|    961|                                 return false;
 4803|    961|                              }
 4804|   482k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   482k|                           }
 4806|   483k|                        }
 4807|       |
 4808|   483k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 1.96k, False: 481k]
  ------------------
 4809|  1.96k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 10, False: 1.95k]
  |  Branch (4809:49): [True: 246, False: 1.71k]
  ------------------
 4810|    256|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 16, False: 240]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|     16|                           ctx.error = error_code::syntax_error;
 4813|     16|                           return false;
 4814|     16|                        }
 4815|       |
 4816|   483k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 483k]
  ------------------
 4817|      0|                           return false;
 4818|   483k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   483k|                        ctx.pop_indent();
 4820|   483k|                     }
 4821|   172k|                     else {
 4822|   172k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   172k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 27.1k, False: 145k]
  ------------------
 4824|  27.1k|                           yaml::skip_to_content(it, end);
 4825|  27.1k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 27.1k, False: 0]
  |  Branch (4825:45): [True: 0, False: 27.1k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  27.1k|                           const int32_t value_indent =
 4832|  27.1k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 27.1k]
  ------------------
 4833|  27.1k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 27.1k]
  ------------------
 4834|      0|                              return false;
 4835|  27.1k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  27.1k|                           ctx.pop_indent();
 4837|  27.1k|                        }
 4838|   172k|                     }
 4839|   656k|                     return !bool(ctx.error);
 4840|   656k|                  };
_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_:
 4788|   483k|                              auto is_line_content_start = [&](auto pos) {
 4789|   483k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   483k|                              };
_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_:
 4792|   516k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   516k|                                 const char* line = ctx.line_begin_of(pos);
 4794|  1.08M|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 1.08M, False: 0]
  |  Branch (4794:57): [True: 566k, False: 518k]
  |  Branch (4794:73): [True: 1.25k, False: 516k]
  ------------------
 4795|   516k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 516k, False: 0]
  |  Branch (4795:56): [True: 282k, False: 233k]
  ------------------
 4796|   516k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|   594k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   594k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 594k]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|   594k|            }
_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|   129k|      {
  301|   129k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 129k]
  |  Branch (301:27): [True: 0, False: 129k]
  ------------------
  302|       |
  303|   129k|         ++it; // skip '*'
  304|   129k|         auto name = parse_anchor_name(it, end);
  305|   129k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 93, False: 129k]
  ------------------
  306|     93|            ctx.error = error_code::syntax_error;
  307|     93|            return true;
  308|     93|         }
  309|       |
  310|   129k|         auto anchor_it = ctx.anchors.find(name);
  311|   129k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 988, False: 128k]
  ------------------
  312|    988|            ctx.error = error_code::syntax_error; // undefined alias
  313|    988|            return true;
  314|    988|         }
  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|   128k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   128k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.99k, False: 126k]
  ------------------
  322|  1.99k|            return true;
  323|  1.99k|         }
  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|   126k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 67, False: 126k]
  ------------------
  329|     67|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     67|            return true;
  331|     67|         }
  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|   126k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   126k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 5, False: 126k]
  ------------------
  339|      5|            return true;
  340|       |
  341|   126k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 12, False: 126k]
  ------------------
  342|     12|            ctx.error = error_code::exceeded_max_expansion;
  343|     12|            ctx.custom_error_message = "alias expansion";
  344|     12|            return true;
  345|     12|         }
  346|       |
  347|   126k|         auto replay_it = span.begin;
  348|   126k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   126k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   126k|         ctx.indent_stack.clear();
  353|   126k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 105k, False: 20.3k]
  ------------------
  354|   105k|            ctx.push_indent(span.base_indent - 1);
  355|   105k|         }
  356|       |
  357|   126k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   126k|         using V = std::remove_cvref_t<T>;
  360|   126k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   126k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   126k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   126k|         return true;
  367|   126k|      }
_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_:
 5205|   189k|      {
 5206|   189k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   189k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   189k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   189k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   189k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 189k, False: 0]
  ------------------
 5216|   189k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   189k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1892|   193k|      {
 1893|   193k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 9.77k, False: 184k]
  ------------------
 1894|  9.77k|            return;
 1895|       |
 1896|   184k|         yaml::node_preamble_state preamble{};
 1897|   184k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 5.54k, False: 178k]
  ------------------
 1898|   184k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  5.54k|            return;
 1900|       |
 1901|   178k|         std::string str;
 1902|   178k|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|   178k|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 178k, False: 0]
  ------------------
 1905|    912|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 912, False: 177k]
  ------------------
 1906|    912|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|    912|            break;
 1908|  2.23k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 2.23k, False: 176k]
  ------------------
 1909|  2.23k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  2.23k|            break;
 1911|  1.90k|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 1.90k, False: 176k]
  ------------------
 1912|  3.09k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 1.19k, False: 177k]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  3.09k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  3.09k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 806, False: 2.29k]
  ------------------
 1918|  3.09k|            break;
 1919|   172k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 172k, False: 6.24k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|   172k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|   172k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1923:20): [True: 148k, False: 23.2k]
  ------------------
 1924|   148k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|   148k|               }
 1926|  23.2k|               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|  23.2k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|  23.2k|               }
 1930|       |            }
 1931|       |            else {
 1932|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|       |            }
 1934|   172k|            break;
 1935|   178k|         }
 1936|       |
 1937|   178k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 178k, False: 407]
  ------------------
 1938|   178k|            value = std::move(str);
 1939|   178k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|   178k|         }
 1941|   178k|      }
_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|   184k|      {
  466|   184k|         skip_inline_ws(it, end);
  467|       |
  468|   184k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 7, False: 184k]
  ------------------
  469|      7|            if constexpr (!AllowEmptyInput) {
  470|      7|               ctx.error = error_code::unexpected_end;
  471|      7|            }
  472|      7|            return true;
  473|      7|         }
  474|       |
  475|   184k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   184k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 12, False: 184k]
  ------------------
  477|     12|            ctx.error = error_code::syntax_error;
  478|     12|            return true;
  479|     12|         }
  480|   184k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 17, False: 184k]
  ------------------
  481|     17|            ctx.error = error_code::syntax_error;
  482|     17|            return true;
  483|     17|         }
  484|       |
  485|   184k|         skip_inline_ws(it, end);
  486|       |
  487|   184k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 21, False: 184k]
  ------------------
  488|     21|            if constexpr (!AllowEmptyInput) {
  489|     21|               ctx.error = error_code::unexpected_end;
  490|     21|            }
  491|     21|            return true;
  492|     21|         }
  493|       |
  494|   184k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.48k, False: 178k]
  ------------------
  495|  5.48k|            return true;
  496|  5.48k|         }
  497|       |
  498|   178k|         return false;
  499|   184k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1898|   184k|                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|   184k|      {
  409|   184k|         state.has_anchor = false;
  410|   184k|         state.anchor_name.clear();
  411|   184k|         state.anchor_start = nullptr;
  412|   184k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   184k|         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|   184k|            else {
  421|   184k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 5.42k, False: 178k]
  ------------------
  422|   184k|            }
  423|   184k|         }
  424|       |
  425|   184k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 178k, False: 5.42k]
  |  Branch (425:27): [True: 4.18k, False: 174k]
  ------------------
  426|  4.18k|            ++it;
  427|  4.18k|            auto name = parse_anchor_name(it, end);
  428|  4.18k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 11, False: 4.17k]
  ------------------
  429|     11|               ctx.error = error_code::syntax_error;
  430|     11|               return true;
  431|     11|            }
  432|  4.17k|            skip_inline_ws(it, end);
  433|  4.17k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 49, False: 4.12k]
  ------------------
  434|     49|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     49|                  ctx.error = error_code::unexpected_end;
  436|     49|               }
  437|     49|               return true;
  438|     49|            }
  439|  4.12k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  4.12k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 3, False: 4.11k]
  ------------------
  441|      3|                  ctx.error = error_code::syntax_error;
  442|      3|                  return true;
  443|      3|               }
  444|  4.12k|            }
  445|  4.11k|            state.has_anchor = true;
  446|  4.12k|            state.anchor_name = std::string(name);
  447|  4.12k|            state.anchor_start = &*it;
  448|  4.12k|         }
  449|       |
  450|   183k|         return false;
  451|   184k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   184k|      {
  301|   184k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 184k]
  |  Branch (301:27): [True: 178k, False: 5.42k]
  ------------------
  302|       |
  303|  5.42k|         ++it; // skip '*'
  304|  5.42k|         auto name = parse_anchor_name(it, end);
  305|  5.42k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 7, False: 5.41k]
  ------------------
  306|      7|            ctx.error = error_code::syntax_error;
  307|      7|            return true;
  308|      7|         }
  309|       |
  310|  5.41k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.41k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 58, False: 5.36k]
  ------------------
  312|     58|            ctx.error = error_code::syntax_error; // undefined alias
  313|     58|            return true;
  314|     58|         }
  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.36k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.36k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 894, False: 4.46k]
  ------------------
  322|    894|            return true;
  323|    894|         }
  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.46k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 24, False: 4.44k]
  ------------------
  329|     24|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     24|            return true;
  331|     24|         }
  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.44k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  4.44k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 4.44k]
  ------------------
  339|      2|            return true;
  340|       |
  341|  4.44k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 4.44k]
  ------------------
  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.44k|         auto replay_it = span.begin;
  348|  4.44k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  4.44k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  4.44k|         ctx.indent_stack.clear();
  353|  4.44k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 4.07k, False: 364]
  ------------------
  354|  4.07k|            ctx.push_indent(span.base_indent - 1);
  355|  4.07k|         }
  356|       |
  357|  4.44k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  4.44k|         using V = std::remove_cvref_t<T>;
  360|  4.44k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  4.44k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  4.44k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  4.44k|         return true;
  367|  4.44k|      }
_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_:
 5205|  43.1k|      {
 5206|  43.1k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  43.1k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  43.1k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  43.1k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  43.1k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 43.1k, False: 0]
  ------------------
 5216|  43.1k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  43.1k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2047|  44.9k|      {
 2048|  44.9k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 44.9k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|  44.9k|         yaml::node_preamble_state preamble{};
 2052|  44.9k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 5.55k, False: 39.4k]
  ------------------
 2053|  44.9k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  44.9k|                   return yaml::tag_valid_for_float(tag);
 2055|  44.9k|                }
 2056|  44.9k|                else {
 2057|  44.9k|                   return yaml::tag_valid_for_int(tag);
 2058|  44.9k|                }
 2059|  44.9k|             }))
 2060|  5.55k|            return;
 2061|       |
 2062|  39.4k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|  39.4k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|  39.4k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|  39.4k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 10.3k, False: 29.1k]
  ------------------
 2070|  10.3k|               ++it;
 2071|  10.3k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 9.59k, False: 746]
  |  Branch (2071:38): [True: 1.38k, False: 8.20k]
  |  Branch (2071:74): [True: 170, False: 8.03k]
  ------------------
 2072|  8.03k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 44, False: 7.99k]
  ------------------
 2073|  1.60k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  1.60k|                  it += 3;
 2075|  1.60k|                  finalize();
 2076|  1.60k|                  return;
 2077|  1.60k|               }
 2078|  8.73k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 7.99k, False: 746]
  |  Branch (2078:38): [True: 252, False: 7.74k]
  |  Branch (2078:74): [True: 189, False: 7.55k]
  ------------------
 2079|  7.55k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 15, False: 7.53k]
  ------------------
 2080|    456|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|    456|                  it += 3;
 2082|    456|                  finalize();
 2083|    456|                  return;
 2084|    456|               }
 2085|  8.28k|               it = start;
 2086|  8.28k|            }
 2087|       |
 2088|  37.3k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 2.23k, False: 35.1k]
  |  Branch (2088:31): [True: 4.13k, False: 31.0k]
  ------------------
 2089|  6.36k|               const char sign = *it;
 2090|  6.36k|               ++it;
 2091|  6.36k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 6.15k, False: 215]
  |  Branch (2091:33): [True: 2.64k, False: 3.50k]
  ------------------
 2092|  2.64k|                  ++it;
 2093|  2.64k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 1.93k, False: 705]
  |  Branch (2093:41): [True: 408, False: 1.53k]
  |  Branch (2093:77): [True: 342, False: 1.18k]
  ------------------
 2094|  1.35k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 603, False: 586]
  ------------------
 2095|  1.35k|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 753, False: 600]
  ------------------
 2096|    753|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|    753|                     }
 2098|    600|                     else {
 2099|    600|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|    600|                     }
 2101|  1.35k|                     it += 3;
 2102|  1.35k|                     finalize();
 2103|  1.35k|                     return;
 2104|  1.35k|                  }
 2105|  2.64k|               }
 2106|  5.01k|               it = start;
 2107|  5.01k|            }
 2108|  37.3k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|  36.0k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  22.8M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 22.8M, False: 8.27k]
  ------------------
 2115|  22.8M|            const char c = *it;
 2116|  22.8M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 9.19k, False: 22.8M]
  |  Branch (2116:29): [True: 2.53k, False: 22.8M]
  |  Branch (2116:42): [True: 3.83k, False: 22.8M]
  |  Branch (2116:55): [True: 1.80k, False: 22.8M]
  |  Branch (2116:68): [True: 1.86k, False: 22.8M]
  |  Branch (2116:80): [True: 614, False: 22.8M]
  |  Branch (2116:92): [True: 1.86k, False: 22.8M]
  |  Branch (2116:104): [True: 4.35k, False: 22.8M]
  ------------------
 2117|  26.0k|               break;
 2118|  26.0k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  22.8M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 24.2k, False: 22.8M]
  ------------------
 2121|  24.2k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 804, False: 23.4k]
  |  Branch (2121:39): [True: 3.33k, False: 20.1k]
  |  Branch (2121:59): [True: 205, False: 19.9k]
  |  Branch (2121:80): [True: 408, False: 19.5k]
  |  Branch (2121:101): [True: 351, False: 19.1k]
  ------------------
 2122|  5.10k|                  break;
 2123|  5.10k|               }
 2124|  24.2k|            }
 2125|  22.8M|            ++it;
 2126|  22.8M|         }
 2127|       |
 2128|  39.4k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|  39.4k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 2.07k, False: 37.3k]
  ------------------
 2131|  2.07k|            ctx.error = error_code::parse_number_failure;
 2132|  2.07k|            return;
 2133|  2.07k|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|  37.3k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|  37.3k|            bool negative = false;
 2186|  37.3k|            std::string_view digits = num_str;
 2187|       |
 2188|  37.3k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 33.9k, False: 3.40k]
  |  Branch (2188:37): [True: 3.53k, False: 30.4k]
  |  Branch (2188:62): [True: 1.47k, False: 28.9k]
  ------------------
 2189|  5.01k|               negative = (digits.front() == '-');
 2190|  5.01k|               digits.remove_prefix(1);
 2191|  5.01k|            }
 2192|       |
 2193|  37.3k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 25.6k, False: 11.6k]
  |  Branch (2193:38): [True: 9.98k, False: 15.7k]
  ------------------
 2194|  9.98k|               int base = 10;
 2195|  9.98k|               size_t offset = 0;
 2196|       |
 2197|  9.98k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 3.77k, False: 6.20k]
  |  Branch (2197:40): [True: 1.15k, False: 5.05k]
  ------------------
 2198|  4.93k|                  base = 16;
 2199|  4.93k|                  offset = 2;
 2200|  4.93k|               }
 2201|  5.05k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 166, False: 4.88k]
  |  Branch (2201:45): [True: 429, False: 4.45k]
  ------------------
 2202|    595|                  base = 8;
 2203|    595|                  offset = 2;
 2204|    595|               }
 2205|  4.45k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 188, False: 4.26k]
  |  Branch (2205:45): [True: 887, False: 3.38k]
  ------------------
 2206|  1.07k|                  base = 2;
 2207|  1.07k|                  offset = 2;
 2208|  1.07k|               }
 2209|       |
 2210|  9.98k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 6.60k, False: 3.38k]
  ------------------
 2211|  6.60k|                  auto raw_digits = digits.substr(offset);
 2212|  6.60k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  6.60k|                  std::string clean_storage;
 2215|  6.60k|                  std::string_view clean_view;
 2216|  6.60k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 3.19k, False: 3.40k]
  ------------------
 2217|  3.19k|                     clean_storage.reserve(raw_digits.size());
 2218|  4.07M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 4.07M, False: 3.19k]
  ------------------
 2219|  4.07M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 4.07M, False: 5.55k]
  ------------------
 2220|  4.07M|                           clean_storage.push_back(c);
 2221|  4.07M|                        }
 2222|  4.07M|                     }
 2223|  3.19k|                     clean_view = clean_storage;
 2224|  3.19k|                  }
 2225|  3.40k|                  else {
 2226|  3.40k|                     clean_view = raw_digits;
 2227|  3.40k|                  }
 2228|       |
 2229|  6.60k|                  uint64_t parsed_int{};
 2230|  6.60k|                  auto [ptr, ec] =
 2231|  6.60k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  6.60k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 3.04k, False: 3.56k]
  |  Branch (2232:44): [True: 1.73k, False: 1.82k]
  ------------------
 2233|  4.77k|                     ctx.error = error_code::parse_number_failure;
 2234|  4.77k|                     finalize();
 2235|  4.77k|                     return;
 2236|  4.77k|                  }
 2237|       |
 2238|  1.82k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  1.82k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 961, False: 868]
  ------------------
 2240|  1.82k|                  finalize();
 2241|  1.82k|                  return;
 2242|  6.60k|               }
 2243|  9.98k|            }
 2244|  37.3k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|  30.7k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|  37.3k|         std::string clean_storage;
 2250|  37.3k|         std::string_view clean_view;
 2251|       |
 2252|  37.3k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 1.97k, False: 35.3k]
  ------------------
 2253|  1.97k|            clean_storage.reserve(num_str.size());
 2254|  1.92M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 1.92M, False: 1.97k]
  ------------------
 2255|  1.92M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 1.91M, False: 4.63k]
  ------------------
 2256|  1.91M|                  clean_storage.push_back(c);
 2257|  1.91M|               }
 2258|  1.92M|            }
 2259|  1.97k|            clean_view = clean_storage;
 2260|  1.97k|         }
 2261|  35.3k|         else {
 2262|  35.3k|            clean_view = num_str;
 2263|  35.3k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|  37.3k|         auto parse_view = clean_view;
 2268|  37.3k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 27.1k, False: 10.2k]
  |  Branch (2268:37): [True: 3.53k, False: 23.6k]
  ------------------
 2269|  3.53k|            parse_view.remove_prefix(1);
 2270|  3.53k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 571, False: 2.96k]
  ------------------
 2271|    571|               ctx.error = error_code::parse_number_failure;
 2272|    571|               return;
 2273|    571|            }
 2274|  3.53k|         }
 2275|       |
 2276|  36.7k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|  36.7k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|  36.7k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 21.3k, False: 15.4k]
  |  Branch (2279:45): [True: 11.0k, False: 4.44k]
  ------------------
 2280|  22.3k|               ctx.error = error_code::parse_number_failure;
 2281|  22.3k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|  36.7k|         finalize();
 2292|  36.7k|      }
_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|  44.9k|      {
  466|  44.9k|         skip_inline_ws(it, end);
  467|       |
  468|  44.9k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 286, False: 44.7k]
  ------------------
  469|    286|            if constexpr (!AllowEmptyInput) {
  470|    286|               ctx.error = error_code::unexpected_end;
  471|    286|            }
  472|    286|            return true;
  473|    286|         }
  474|       |
  475|  44.7k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  44.7k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 555, False: 44.1k]
  ------------------
  477|    555|            ctx.error = error_code::syntax_error;
  478|    555|            return true;
  479|    555|         }
  480|  44.1k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 181, False: 43.9k]
  ------------------
  481|    181|            ctx.error = error_code::syntax_error;
  482|    181|            return true;
  483|    181|         }
  484|       |
  485|  43.9k|         skip_inline_ws(it, end);
  486|       |
  487|  43.9k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 147, False: 43.8k]
  ------------------
  488|    147|            if constexpr (!AllowEmptyInput) {
  489|    147|               ctx.error = error_code::unexpected_end;
  490|    147|            }
  491|    147|            return true;
  492|    147|         }
  493|       |
  494|  43.8k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 4.38k, False: 39.4k]
  ------------------
  495|  4.38k|            return true;
  496|  4.38k|         }
  497|       |
  498|  39.4k|         return false;
  499|  43.8k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2052|  44.1k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|  44.1k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  44.1k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|  44.1k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  43.8k|      {
  409|  43.8k|         state.has_anchor = false;
  410|  43.8k|         state.anchor_name.clear();
  411|  43.8k|         state.anchor_start = nullptr;
  412|  43.8k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  43.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|  43.8k|            else {
  421|  43.8k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.61k, False: 40.2k]
  ------------------
  422|  43.8k|            }
  423|  43.8k|         }
  424|       |
  425|  43.8k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 40.2k, False: 3.61k]
  |  Branch (425:27): [True: 3.88k, False: 36.3k]
  ------------------
  426|  3.88k|            ++it;
  427|  3.88k|            auto name = parse_anchor_name(it, end);
  428|  3.88k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 328, False: 3.55k]
  ------------------
  429|    328|               ctx.error = error_code::syntax_error;
  430|    328|               return true;
  431|    328|            }
  432|  3.55k|            skip_inline_ws(it, end);
  433|  3.55k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 437, False: 3.12k]
  ------------------
  434|    437|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    437|                  ctx.error = error_code::unexpected_end;
  436|    437|               }
  437|    437|               return true;
  438|    437|            }
  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.12k|            state.has_anchor = true;
  446|  3.12k|            state.anchor_name = std::string(name);
  447|  3.12k|            state.anchor_start = &*it;
  448|  3.12k|         }
  449|       |
  450|  43.0k|         return false;
  451|  43.8k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  43.8k|      {
  301|  43.8k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 43.8k]
  |  Branch (301:27): [True: 40.2k, 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: 592, False: 3.02k]
  ------------------
  306|    592|            ctx.error = error_code::syntax_error;
  307|    592|            return true;
  308|    592|         }
  309|       |
  310|  3.02k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.02k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 972, False: 2.05k]
  ------------------
  312|    972|            ctx.error = error_code::syntax_error; // undefined alias
  313|    972|            return true;
  314|    972|         }
  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.05k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.05k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 145, False: 1.90k]
  ------------------
  322|    145|            return true;
  323|    145|         }
  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.90k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 11, False: 1.89k]
  ------------------
  329|     11|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     11|            return true;
  331|     11|         }
  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.89k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.89k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 4, False: 1.89k]
  ------------------
  339|      4|            return true;
  340|       |
  341|  1.89k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.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|  1.89k|         auto replay_it = span.begin;
  348|  1.89k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.89k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.89k|         ctx.indent_stack.clear();
  353|  1.89k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.39k, False: 496]
  ------------------
  354|  1.39k|            ctx.push_indent(span.base_indent - 1);
  355|  1.39k|         }
  356|       |
  357|  1.89k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.89k|         using V = std::remove_cvref_t<T>;
  360|  1.89k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.89k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.89k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.89k|         return true;
  367|  1.89k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|  36.7k|         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_:
 5205|  11.7k|      {
 5206|  11.7k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  11.7k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  11.7k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  11.7k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  11.7k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 11.7k, False: 0]
  ------------------
 5216|  11.7k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  11.7k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2012|  12.4k|      {
 2013|  12.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 12.4k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  12.4k|         yaml::node_preamble_state preamble{};
 2017|  12.4k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 1.38k, False: 11.0k]
  ------------------
 2018|  12.4k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|  1.38k|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  11.0k|         std::string str;
 2023|  11.0k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  11.0k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 3.31k, False: 7.71k]
  |  Branch (2025:31): [True: 2.10k, False: 5.61k]
  |  Branch (2025:48): [True: 48, False: 5.56k]
  |  Branch (2025:65): [True: 244, False: 5.31k]
  |  Branch (2025:81): [True: 270, False: 5.04k]
  |  Branch (2025:97): [True: 3, False: 5.04k]
  ------------------
 2026|  6.92k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 651, False: 4.39k]
  |  Branch (2026:29): [True: 108, False: 4.28k]
  |  Branch (2026:44): [True: 178, False: 4.10k]
  ------------------
 2027|  6.92k|            value = true;
 2028|  6.92k|         }
 2029|  4.10k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 581, False: 3.52k]
  |  Branch (2029:37): [True: 435, False: 3.09k]
  |  Branch (2029:55): [True: 896, False: 2.19k]
  |  Branch (2029:73): [True: 1.17k, False: 1.02k]
  |  Branch (2029:88): [True: 616, False: 407]
  |  Branch (2029:103): [True: 26, False: 381]
  ------------------
 2030|  3.78k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 37, False: 344]
  |  Branch (2030:35): [True: 3, False: 341]
  |  Branch (2030:51): [True: 21, False: 320]
  ------------------
 2031|  3.78k|            value = false;
 2032|  3.78k|         }
 2033|    320|         else {
 2034|    320|            ctx.error = error_code::expected_true_or_false;
 2035|    320|         }
 2036|       |
 2037|  11.0k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  11.0k|      }
_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|  12.4k|      {
  466|  12.4k|         skip_inline_ws(it, end);
  467|       |
  468|  12.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 3, False: 12.4k]
  ------------------
  469|      3|            if constexpr (!AllowEmptyInput) {
  470|      3|               ctx.error = error_code::unexpected_end;
  471|      3|            }
  472|      3|            return true;
  473|      3|         }
  474|       |
  475|  12.4k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  12.4k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 12.4k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|  12.4k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 12.4k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|  12.4k|         skip_inline_ws(it, end);
  486|       |
  487|  12.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 4, False: 12.4k]
  ------------------
  488|      4|            if constexpr (!AllowEmptyInput) {
  489|      4|               ctx.error = error_code::unexpected_end;
  490|      4|            }
  491|      4|            return true;
  492|      4|         }
  493|       |
  494|  12.4k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 1.37k, False: 11.0k]
  ------------------
  495|  1.37k|            return true;
  496|  1.37k|         }
  497|       |
  498|  11.0k|         return false;
  499|  12.4k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2018|  12.4k|                                             [](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|  12.4k|      {
  409|  12.4k|         state.has_anchor = false;
  410|  12.4k|         state.anchor_name.clear();
  411|  12.4k|         state.anchor_start = nullptr;
  412|  12.4k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  12.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|  12.4k|            else {
  421|  12.4k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 1.35k, False: 11.0k]
  ------------------
  422|  12.4k|            }
  423|  12.4k|         }
  424|       |
  425|  12.4k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 11.0k, False: 1.35k]
  |  Branch (425:27): [True: 1.39k, False: 9.66k]
  ------------------
  426|  1.39k|            ++it;
  427|  1.39k|            auto name = parse_anchor_name(it, end);
  428|  1.39k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 6, False: 1.38k]
  ------------------
  429|      6|               ctx.error = error_code::syntax_error;
  430|      6|               return true;
  431|      6|            }
  432|  1.38k|            skip_inline_ws(it, end);
  433|  1.38k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 19, False: 1.36k]
  ------------------
  434|     19|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     19|                  ctx.error = error_code::unexpected_end;
  436|     19|               }
  437|     19|               return true;
  438|     19|            }
  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.36k|            state.has_anchor = true;
  446|  1.36k|            state.anchor_name = std::string(name);
  447|  1.36k|            state.anchor_start = &*it;
  448|  1.36k|         }
  449|       |
  450|  12.3k|         return false;
  451|  12.4k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  12.4k|      {
  301|  12.4k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 12.4k]
  |  Branch (301:27): [True: 11.0k, False: 1.35k]
  ------------------
  302|       |
  303|  1.35k|         ++it; // skip '*'
  304|  1.35k|         auto name = parse_anchor_name(it, end);
  305|  1.35k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 5, False: 1.34k]
  ------------------
  306|      5|            ctx.error = error_code::syntax_error;
  307|      5|            return true;
  308|      5|         }
  309|       |
  310|  1.34k|         auto anchor_it = ctx.anchors.find(name);
  311|  1.34k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 51, False: 1.29k]
  ------------------
  312|     51|            ctx.error = error_code::syntax_error; // undefined alias
  313|     51|            return true;
  314|     51|         }
  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.29k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.29k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 664, False: 630]
  ------------------
  322|    664|            return true;
  323|    664|         }
  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|    630|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 6, False: 624]
  ------------------
  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|    624|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    624|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 622]
  ------------------
  339|      2|            return true;
  340|       |
  341|    622|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 622]
  ------------------
  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|    622|         auto replay_it = span.begin;
  348|    622|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    622|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    622|         ctx.indent_stack.clear();
  353|    622|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 584, False: 38]
  ------------------
  354|    584|            ctx.push_indent(span.base_indent - 1);
  355|    584|         }
  356|       |
  357|    622|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    622|         using V = std::remove_cvref_t<T>;
  360|    622|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    622|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    622|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    622|         return true;
  367|    622|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2398|  2.86k|      {
 2399|  2.86k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 2.86k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  2.86k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  2.86k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 15, False: 2.85k]
  ------------------
 2405|     15|            ctx.error = error_code::unexpected_end;
 2406|     15|            return;
 2407|     15|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  2.85k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 767, False: 2.08k]
  ------------------
 2411|    767|            ++it;
 2412|    767|            return;
 2413|    767|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  2.08k|         auto start = it;
 2417|  9.64k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 9.31k, False: 329]
  |  Branch (2417:30): [True: 7.55k, False: 1.75k]
  ------------------
 2418|  7.55k|            ++it;
 2419|  7.55k|         }
 2420|       |
 2421|  2.08k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  2.08k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 58, False: 2.02k]
  ------------------
 2423|     58|            ctx.error = error_code::syntax_error;
 2424|     58|         }
 2425|  2.08k|      }
_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_:
 5205|   147k|      {
 5206|   147k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   147k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   147k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   147k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   147k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 147k, False: 0]
  ------------------
 5216|   147k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   147k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4098|   150k|      {
 4099|   150k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 150k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|   150k|         auto peek = it;
 4104|   150k|         yaml::node_preamble_state preamble{};
 4105|   150k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 3.50k, False: 146k]
  ------------------
 4106|   150k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  3.50k|            it = peek;
 4108|  3.50k|            return;
 4109|  3.50k|         }
 4110|       |
 4111|   146k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 52.4k, False: 94.3k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|  52.4k|            it = peek;
 4114|  52.4k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|  52.4k|         }
 4116|  94.3k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 94.1k, False: 179]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|  94.1k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 61, False: 94.0k]
  |  Branch (4119:57): [True: 2.29k, False: 91.7k]
  ------------------
 4120|  2.35k|               it = peek;
 4121|  2.35k|            }
 4122|  94.1k|            int32_t seq_indent = ctx.current_indent();
 4123|  94.1k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 94.0k, False: 117]
  |  Branch (4123:31): [True: 86.3k, False: 7.61k]
  ------------------
 4124|  86.3k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 64.5k, False: 21.8k]
  |  Branch (4124:62): [True: 32.8k, False: 31.7k]
  ------------------
 4125|  86.3k|                                                          : (ctx.current_indent() + 1);
 4126|  86.3k|            }
 4127|  94.1k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|  94.1k|         }
 4129|    179|         else {
 4130|    179|            ctx.error = error_code::syntax_error;
 4131|    179|         }
 4132|       |
 4133|   146k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|   146k|      }
_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|   150k|      {
  466|   150k|         skip_inline_ws(it, end);
  467|       |
  468|   150k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 5, False: 150k]
  ------------------
  469|      5|            if constexpr (!AllowEmptyInput) {
  470|      5|               ctx.error = error_code::unexpected_end;
  471|      5|            }
  472|      5|            return true;
  473|      5|         }
  474|       |
  475|   150k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   150k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 150k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|   150k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 3, False: 150k]
  ------------------
  481|      3|            ctx.error = error_code::syntax_error;
  482|      3|            return true;
  483|      3|         }
  484|       |
  485|   150k|         skip_inline_ws(it, end);
  486|       |
  487|   150k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 6, False: 150k]
  ------------------
  488|      6|            if constexpr (!AllowEmptyInput) {
  489|      6|               ctx.error = error_code::unexpected_end;
  490|      6|            }
  491|      6|            return true;
  492|      6|         }
  493|       |
  494|   150k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 3.48k, False: 146k]
  ------------------
  495|  3.48k|            return true;
  496|  3.48k|         }
  497|       |
  498|   146k|         return false;
  499|   150k|      }
_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_:
 4106|   150k|                                             [](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|   150k|      {
  409|   150k|         state.has_anchor = false;
  410|   150k|         state.anchor_name.clear();
  411|   150k|         state.anchor_start = nullptr;
  412|   150k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   150k|         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|   150k|            else {
  421|   150k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 3.45k, False: 146k]
  ------------------
  422|   150k|            }
  423|   150k|         }
  424|       |
  425|   150k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 146k, False: 3.45k]
  |  Branch (425:27): [True: 3.07k, False: 143k]
  ------------------
  426|  3.07k|            ++it;
  427|  3.07k|            auto name = parse_anchor_name(it, end);
  428|  3.07k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 10, False: 3.06k]
  ------------------
  429|     10|               ctx.error = error_code::syntax_error;
  430|     10|               return true;
  431|     10|            }
  432|  3.06k|            skip_inline_ws(it, end);
  433|  3.06k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 23, False: 3.03k]
  ------------------
  434|     23|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     23|                  ctx.error = error_code::unexpected_end;
  436|     23|               }
  437|     23|               return true;
  438|     23|            }
  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.03k|            state.has_anchor = true;
  446|  3.03k|            state.anchor_name = std::string(name);
  447|  3.03k|            state.anchor_start = &*it;
  448|  3.03k|         }
  449|       |
  450|   150k|         return false;
  451|   150k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   150k|      {
  301|   150k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 150k]
  |  Branch (301:27): [True: 146k, False: 3.45k]
  ------------------
  302|       |
  303|  3.45k|         ++it; // skip '*'
  304|  3.45k|         auto name = parse_anchor_name(it, end);
  305|  3.45k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 7, False: 3.44k]
  ------------------
  306|      7|            ctx.error = error_code::syntax_error;
  307|      7|            return true;
  308|      7|         }
  309|       |
  310|  3.44k|         auto anchor_it = ctx.anchors.find(name);
  311|  3.44k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 55, False: 3.39k]
  ------------------
  312|     55|            ctx.error = error_code::syntax_error; // undefined alias
  313|     55|            return true;
  314|     55|         }
  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.39k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  3.39k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 701, False: 2.69k]
  ------------------
  322|    701|            return true;
  323|    701|         }
  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.69k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 3, False: 2.68k]
  ------------------
  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|  2.68k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.68k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 2.68k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  2.68k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.68k]
  ------------------
  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.68k|         auto replay_it = span.begin;
  348|  2.68k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.68k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.68k|         ctx.indent_stack.clear();
  353|  2.68k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.42k, False: 264]
  ------------------
  354|  2.42k|            ctx.push_indent(span.base_indent - 1);
  355|  2.42k|         }
  356|       |
  357|  2.68k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.68k|         using V = std::remove_cvref_t<T>;
  360|  2.68k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.68k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.68k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.68k|         return true;
  367|  2.68k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|  52.4k|      {
 2597|  52.4k|         using V = std::remove_cvref_t<T>;
 2598|  52.4k|         using value_type = typename V::value_type;
 2599|       |
 2600|  52.4k|         struct sequence_container_adapter
 2601|  52.4k|         {
 2602|  52.4k|            size_t index = 0;
 2603|       |
 2604|  52.4k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|  52.4k|            {
 2606|  52.4k|               if constexpr (!resizable<V>) {
 2607|  52.4k|                  return index >= container.size();
 2608|  52.4k|               }
 2609|  52.4k|               else {
 2610|  52.4k|                  (void)container;
 2611|  52.4k|                  return false;
 2612|  52.4k|               }
 2613|  52.4k|            }
 2614|       |
 2615|  52.4k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|  52.4k|            inline void append(V& container, value_type&& element) noexcept
 2618|  52.4k|            {
 2619|  52.4k|               if constexpr (emplace_backable<V>) {
 2620|  52.4k|                  container.emplace_back(std::move(element));
 2621|  52.4k|               }
 2622|  52.4k|               else if constexpr (emplaceable<V>) {
 2623|  52.4k|                  container.emplace(std::move(element));
 2624|  52.4k|               }
 2625|  52.4k|            }
 2626|  52.4k|         };
 2627|       |
 2628|  52.4k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 52.4k]
  |  Branch (2628:27): [True: 0, False: 52.4k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|  52.4k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|  52.4k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|  52.4k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|  52.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 24, False: 52.4k]
  ------------------
 2641|     24|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|  52.4k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 51.2k, False: 1.19k]
  |  Branch (2644:27): [True: 5.60k, False: 45.6k]
  ------------------
 2645|  5.60k|            ++it;
 2646|  5.60k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  5.60k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 23, False: 5.58k]
  ------------------
 2648|     23|               return;
 2649|  5.58k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|  5.58k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2650:20): [True: 181, False: 5.40k]
  ------------------
 2651|    181|                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|    181|               }
 2653|  5.58k|            }
 2654|  5.58k|            return;
 2655|  5.60k|         }
 2656|       |
 2657|  46.8k|         bool just_saw_comma = false;
 2658|  46.8k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  46.8k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|  87.5k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 84.4k, False: 3.09k]
  ------------------
 2663|  84.4k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|  84.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 84.4k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|  84.4k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 84.4k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|  84.4k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 6.07k, False: 78.4k]
  ------------------
 2673|  6.07k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 6.07k, False: 0]
  ------------------
 2674|  6.07k|                     ++it;
 2675|  6.07k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  6.07k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 9, False: 6.06k]
  ------------------
 2677|      9|                        return;
 2678|  6.06k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|  6.06k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2679:29): [True: 159, False: 5.90k]
  ------------------
 2680|    159|                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|    159|                        }
 2682|  6.06k|                     }
 2683|  6.06k|                     return;
 2684|  6.07k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  6.07k|               }
 2688|       |
 2689|  78.4k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 521, False: 77.8k]
  |  Branch (2689:34): [True: 29, False: 77.8k]
  ------------------
 2690|    550|                  ctx.error = error_code::syntax_error;
 2691|    550|                  return;
 2692|    550|               }
 2693|  77.8k|               just_saw_comma = false;
 2694|       |
 2695|  77.8k|               value_type element{};
 2696|  77.8k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|  77.8k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 25.4k, False: 52.4k]
  ------------------
 2699|  25.4k|                  return;
 2700|       |
 2701|  52.4k|               bool saw_line_break_before_separator = false;
 2702|  52.4k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|  52.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 18, False: 52.4k]
  ------------------
 2704|     18|                  return;
 2705|       |
 2706|  52.4k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 48.5k, False: 3.88k]
  |  Branch (2706:33): [True: 12.0k, False: 36.4k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  12.0k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 70, False: 12.0k]
  ------------------
 2709|     70|                     ctx.error = error_code::syntax_error;
 2710|     70|                     return;
 2711|     70|                  }
 2712|  12.0k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  12.0k|                     glz::generic key_node = std::move(element);
 2714|  12.0k|                     ++it;
 2715|  12.0k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  12.0k|                     glz::generic mapped{};
 2718|  12.0k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  12.0k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 623, False: 11.3k]
  ------------------
 2720|    623|                        return;
 2721|       |
 2722|  11.3k|                     std::string key;
 2723|  11.3k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 3, False: 11.3k]
  ------------------
 2724|      3|                        return;
 2725|       |
 2726|  11.3k|                     glz::generic pair{};
 2727|  11.3k|                     pair[key] = std::move(mapped);
 2728|  11.3k|                     element = std::move(pair);
 2729|       |
 2730|  11.3k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  11.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 7, False: 11.3k]
  ------------------
 2732|      7|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  12.0k|               }
 2739|       |
 2740|  52.3k|               adapter.append(value, std::move(element));
 2741|       |
 2742|  52.3k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 4.11k, False: 48.2k]
  ------------------
 2743|  4.11k|                  ctx.error = error_code::unexpected_end;
 2744|  4.11k|                  return;
 2745|  4.11k|               }
 2746|       |
 2747|  48.2k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 5.21k, False: 43.0k]
  ------------------
 2748|  5.21k|                  ++it;
 2749|  5.21k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  5.21k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 128, False: 5.08k]
  ------------------
 2751|    128|                     return;
 2752|  5.08k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|  5.08k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2753:26): [True: 416, False: 4.67k]
  ------------------
 2754|    416|                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|    416|                     }
 2756|  5.08k|                  }
 2757|  5.08k|                  return;
 2758|  5.21k|               }
 2759|  43.0k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 40.7k, False: 2.21k]
  ------------------
 2760|  40.7k|                  ++it;
 2761|  40.7k|                  just_saw_comma = true;
 2762|  40.7k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  40.7k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 10, False: 40.7k]
  ------------------
 2764|     10|                     return;
 2765|  40.7k|               }
 2766|  2.21k|               else {
 2767|  2.21k|                  ctx.error = error_code::syntax_error;
 2768|  2.21k|                  return;
 2769|  2.21k|               }
 2770|  48.2k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  46.8k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|   146k|      {
 2581|   146k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|   146k|            if constexpr (!check_append_arrays(Opts)) {
 2584|   146k|               value.clear();
 2585|   146k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|   146k|      }
_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_:
 2618|  51.6k|            {
 2619|  51.6k|               if constexpr (emplace_backable<V>) {
 2620|  51.6k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|  51.6k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|  94.1k|      {
 3082|  94.1k|         using V = std::remove_cvref_t<T>;
 3083|  94.1k|         using value_type = typename V::value_type;
 3084|       |
 3085|  94.1k|         struct sequence_container_adapter
 3086|  94.1k|         {
 3087|  94.1k|            size_t index = 0;
 3088|       |
 3089|  94.1k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|  94.1k|            {
 3091|  94.1k|               if constexpr (!resizable<V>) {
 3092|  94.1k|                  return index >= container.size();
 3093|  94.1k|               }
 3094|  94.1k|               else {
 3095|  94.1k|                  (void)container;
 3096|  94.1k|                  return false;
 3097|  94.1k|               }
 3098|  94.1k|            }
 3099|       |
 3100|  94.1k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|  94.1k|            inline void append(V& container, value_type&& element) noexcept
 3103|  94.1k|            {
 3104|  94.1k|               if constexpr (emplace_backable<V>) {
 3105|  94.1k|                  container.emplace_back(std::move(element));
 3106|  94.1k|               }
 3107|  94.1k|               else if constexpr (emplaceable<V>) {
 3108|  94.1k|                  container.emplace(std::move(element));
 3109|  94.1k|               }
 3110|  94.1k|            }
 3111|  94.1k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|  94.1k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|  94.1k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|  94.1k|         bool first_item = true;
 3122|  94.1k|         bool has_pending_item_anchor = false;
 3123|  94.1k|         std::string pending_item_anchor_name{};
 3124|  94.1k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|   262k|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 200k, False: 62.6k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|   200k|            int32_t line_indent = 0;
 3137|   200k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|   200k|            auto line_start = it;
 3139|       |
 3140|   294k|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 290k, False: 4.53k]
  ------------------
 3141|   290k|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 24.4k, False: 265k]
  ------------------
 3142|  24.4k|                  skip_comment(it, end);
 3143|  24.4k|                  skip_newline(it, end);
 3144|  24.4k|                  line_start = it;
 3145|  24.4k|                  line_indent = 0;
 3146|  24.4k|               }
 3147|   265k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 30.7k, False: 235k]
  |  Branch (3147:40): [True: 22.8k, False: 212k]
  ------------------
 3148|  53.5k|                  skip_newline(it, end);
 3149|  53.5k|                  line_start = it;
 3150|  53.5k|                  line_indent = 0;
 3151|  53.5k|               }
 3152|   212k|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 36.9k, False: 175k]
  ------------------
 3153|  36.9k|                  line_start = it;
 3154|  36.9k|                  line_indent = 0;
 3155|  89.6k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 89.1k, False: 533]
  |  Branch (3155:39): [True: 52.6k, False: 36.4k]
  ------------------
 3156|  52.6k|                     ++line_indent;
 3157|  52.6k|                     ++it;
 3158|  52.6k|                  }
 3159|       |
 3160|  36.9k|                  bool saw_tab = false;
 3161|  38.9k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 38.3k, False: 556]
  |  Branch (3161:40): [True: 857, False: 37.4k]
  |  Branch (3161:54): [True: 1.11k, False: 36.3k]
  ------------------
 3162|  1.96k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 1.71k, False: 254]
  |  Branch (3162:43): [True: 254, False: 0]
  ------------------
 3163|  1.96k|                     ++it;
 3164|  1.96k|                  }
 3165|       |
 3166|  36.9k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 556, False: 36.3k]
  |  Branch (3166:36): [True: 671, False: 35.7k]
  |  Branch (3166:51): [True: 1.05k, False: 34.6k]
  |  Branch (3166:66): [True: 11.8k, False: 22.8k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|  14.1k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 13.5k, False: 556]
  |  Branch (3168:39): [True: 11.8k, False: 1.72k]
  ------------------
 3169|  11.8k|                        skip_comment(it, end);
 3170|  11.8k|                     }
 3171|  14.1k|                     line_indent = 0;
 3172|  14.1k|                     continue;
 3173|  14.1k|                  }
 3174|       |
 3175|  22.8k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 18, False: 22.8k]
  ------------------
 3176|     18|                     ctx.error = error_code::syntax_error;
 3177|     18|                     return;
 3178|     18|                  }
 3179|  22.8k|                  break; // Found content
 3180|  22.8k|               }
 3181|   175k|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 2.66k, False: 172k]
  ------------------
 3182|  2.66k|                  line_start = it;
 3183|  9.65k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 9.49k, False: 156]
  |  Branch (3183:40): [True: 1.27k, False: 8.21k]
  |  Branch (3183:54): [True: 5.71k, False: 2.50k]
  ------------------
 3184|  2.66k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 156, False: 2.50k]
  |  Branch (3184:36): [True: 529, False: 1.97k]
  |  Branch (3184:51): [True: 840, False: 1.13k]
  |  Branch (3184:66): [True: 1.10k, False: 38]
  ------------------
 3185|  2.62k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 2.46k, False: 156]
  |  Branch (3185:39): [True: 1.10k, False: 1.36k]
  ------------------
 3186|  1.10k|                        skip_comment(it, end);
 3187|  1.10k|                     }
 3188|  2.62k|                     line_indent = 0;
 3189|  2.62k|                     continue;
 3190|  2.62k|                  }
 3191|     38|                  ctx.error = error_code::syntax_error;
 3192|     38|                  return;
 3193|  2.66k|               }
 3194|   172k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|   172k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 94.1k, False: 78.6k]
  |  Branch (3198:37): [True: 94.0k, False: 117]
  ------------------
 3199|  94.0k|                     line_indent = sequence_indent;
 3200|  94.0k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|  94.0k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 94.0k, False: 0]
  |  Branch (3201:49): [True: 93.3k, False: 693]
  ------------------
 3202|  93.3k|                           auto probe = it;
 3203|  93.3k|                           int32_t leading_ws = 0;
 3204|  93.3k|                           bool saw_tab = false;
 3205|   177k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 177k, False: 127]
  |  Branch (3205:64): [True: 75.7k, False: 101k]
  |  Branch (3205:87): [True: 8.33k, False: 93.1k]
  ------------------
 3206|  84.1k|                              --probe;
 3207|  84.1k|                              ++leading_ws;
 3208|  84.1k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 7.90k, False: 76.2k]
  |  Branch (3208:52): [True: 531, False: 75.6k]
  ------------------
 3209|  84.1k|                           }
 3210|  93.3k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 127, False: 93.1k]
  |  Branch (3210:61): [True: 33.0k, False: 60.1k]
  |  Branch (3210:85): [True: 10.5k, False: 49.6k]
  ------------------
 3211|  43.6k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 32, False: 43.6k]
  ------------------
 3212|     32|                                 ctx.error = error_code::syntax_error;
 3213|     32|                                 return;
 3214|     32|                              }
 3215|  43.6k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|  43.6k|                           }
 3217|  93.3k|                        }
 3218|  94.0k|                     }
 3219|  94.0k|                  }
 3220|  93.9k|                  break;
 3221|   172k|               }
 3222|   290k|            }
 3223|       |
 3224|   200k|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 4.53k, False: 195k]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|   195k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 3.30k, False: 192k]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|   192k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 12.5k, False: 179k]
  ------------------
 3231|  12.5k|               it = line_start;
 3232|  12.5k|               return;
 3233|  12.5k|            }
 3234|       |
 3235|   179k|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 25.2k, False: 154k]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  25.2k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 22, False: 25.2k]
  ------------------
 3240|     22|                  ctx.error = error_code::syntax_error;
 3241|     22|                  return;
 3242|     22|               }
 3243|       |
 3244|  25.2k|               ++it;
 3245|  25.2k|               auto pending_name = parse_anchor_name(it, end);
 3246|  25.2k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 13, False: 25.2k]
  ------------------
 3247|     13|                  ctx.error = error_code::syntax_error;
 3248|     13|                  return;
 3249|     13|               }
 3250|  25.2k|               skip_inline_ws(it, end);
 3251|  25.2k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 25.1k, False: 53]
  |  Branch (3251:33): [True: 12.6k, False: 12.5k]
  ------------------
 3252|  12.6k|                  skip_comment(it, end);
 3253|  12.6k|               }
 3254|       |
 3255|  25.2k|               has_pending_item_anchor = true;
 3256|  25.2k|               pending_item_anchor_name = std::string(pending_name);
 3257|  25.2k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  25.2k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 74, False: 25.1k]
  |  Branch (3259:34): [True: 10.8k, False: 14.2k]
  |  Branch (3259:49): [True: 48, False: 10.8k]
  ------------------
 3260|    122|                  ctx.error = error_code::syntax_error;
 3261|    122|                  return;
 3262|    122|               }
 3263|       |
 3264|  25.1k|               skip_newline(it, end);
 3265|  25.1k|               continue;
 3266|  25.2k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|   154k|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 7.94k, False: 146k]
  ------------------
 3270|  7.94k|               it = line_start;
 3271|  7.94k|               return;
 3272|  7.94k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|   146k|            dash_col = line_indent;
 3278|   146k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   146k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 146k, False: 32]
  ------------------
 3280|   146k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|   146k|               }
 3282|   146k|            }
 3283|       |
 3284|   146k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|   146k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 143k, False: 2.97k]
  |  Branch (3287:30): [True: 1.96k, False: 141k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  1.96k|               it = line_start;
 3290|  1.96k|               return;
 3291|  1.96k|            }
 3292|       |
 3293|   144k|            bool saw_tab_after_dash = false;
 3294|   232k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 229k, False: 3.08k]
  |  Branch (3294:34): [True: 79.1k, False: 150k]
  |  Branch (3294:48): [True: 8.83k, False: 141k]
  ------------------
 3295|  87.9k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 1.77k, False: 86.2k]
  |  Branch (3295:59): [True: 7.40k, False: 78.8k]
  ------------------
 3296|  87.9k|               ++it;
 3297|  87.9k|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|   144k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 7.40k, False: 137k]
  |  Branch (3299:39): [True: 7.36k, False: 35]
  |  Branch (3299:52): [True: 3.16k, False: 4.20k]
  ------------------
 3300|  3.16k|               const auto after_dash = it + 1;
 3301|  3.16k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 4, False: 3.16k]
  |  Branch (3301:41): [True: 3, False: 3.16k]
  ------------------
 3302|      7|                  ctx.error = error_code::syntax_error;
 3303|      7|                  return;
 3304|      7|               }
 3305|  3.16k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|   144k|            auto parse_element = [&](auto& element) {
 3309|   144k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|   144k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   144k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|   144k|                     return;
 3319|   144k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   144k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   144k|                  ctx.sequence_item_value_context = true;
 3322|   144k|                  ctx.sequence_dash_indent = dash_col;
 3323|   144k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   144k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   144k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   144k|                  ctx.pop_indent();
 3327|   144k|               }
 3328|   144k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   144k|                  skip_ws_and_comment(it, end);
 3331|   144k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   144k|                  auto nested_start = it;
 3335|   144k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   144k|                  if (bool(ctx.error)) [[unlikely]]
 3337|   144k|                     return;
 3338|   144k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   144k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|   144k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|   144k|                     const int32_t element_indent =
 3350|   144k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|   144k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|   144k|                        return;
 3353|   144k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|   144k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|   144k|                     ctx.sequence_item_value_context = true;
 3356|   144k|                     ctx.sequence_dash_indent = dash_col;
 3357|   144k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|   144k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|   144k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|   144k|                     ctx.pop_indent();
 3361|   144k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   144k|               }
 3364|       |
 3365|   144k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|   144k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|   144k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|   144k|                                                                      pending_item_anchor_indent};
 3369|   144k|                  has_pending_item_anchor = false;
 3370|   144k|               }
 3371|   144k|            };
 3372|       |
 3373|   144k|            if constexpr (emplace_backable<V>) {
 3374|   144k|               auto& element = value.emplace_back();
 3375|   144k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|   144k|            first_item = false;
 3394|       |
 3395|   144k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 923, False: 143k]
  ------------------
 3396|    923|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|   144k|         }
 3401|  94.1k|      }
_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_:
 3308|   144k|            auto parse_element = [&](auto& element) {
 3309|   144k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 141k, False: 3.05k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|   144k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 141k, False: 3.05k]
  |  Branch (3312:33): [True: 69.0k, False: 72.3k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  69.0k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 69.0k]
  ------------------
 3318|      0|                     return;
 3319|  69.0k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  69.0k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  69.0k|                  ctx.sequence_item_value_context = true;
 3322|  69.0k|                  ctx.sequence_dash_indent = dash_col;
 3323|  69.0k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  69.0k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  69.0k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  69.0k|                  ctx.pop_indent();
 3327|  69.0k|               }
 3328|  75.4k|               else {
 3329|       |                  // Value on next line - nested block
 3330|  75.4k|                  skip_ws_and_comment(it, end);
 3331|  75.4k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  75.4k|                  auto nested_start = it;
 3335|  75.4k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  75.4k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 9, False: 75.4k]
  ------------------
 3337|      9|                     return;
 3338|  75.4k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  75.4k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 816, False: 74.5k]
  ------------------
 3344|  75.4k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 34.5k, False: 40.8k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  34.5k|                     const int32_t element_indent =
 3350|  34.5k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 34.5k]
  ------------------
 3351|  34.5k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 34.5k]
  ------------------
 3352|      0|                        return;
 3353|  34.5k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  34.5k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  34.5k|                     ctx.sequence_item_value_context = true;
 3356|  34.5k|                     ctx.sequence_dash_indent = dash_col;
 3357|  34.5k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  34.5k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  34.5k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  34.5k|                     ctx.pop_indent();
 3361|  34.5k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  75.4k|               }
 3364|       |
 3365|   144k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 14.8k, False: 129k]
  |  Branch (3365:47): [True: 14.7k, False: 84]
  ------------------
 3366|  14.7k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 12.6k, False: 2.08k]
  ------------------
 3367|  14.7k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  14.7k|                                                                      pending_item_anchor_indent};
 3369|  14.7k|                  has_pending_item_anchor = false;
 3370|  14.7k|               }
 3371|   144k|            };
_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_:
 5423|   334k|   {
 5424|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|       |            int depth = 0;
 5432|       |            while (pos != stop) {
 5433|       |               const char c = *pos;
 5434|       |               if (c == '"' || c == '\'') {
 5435|       |                  const char quote = c;
 5436|       |                  ++pos;
 5437|       |                  while (pos != stop && *pos != quote) {
 5438|       |                     if (*pos == '\\' && quote == '"') {
 5439|       |                        ++pos;
 5440|       |                        if (pos != stop) ++pos;
 5441|       |                     }
 5442|       |                     else {
 5443|       |                        ++pos;
 5444|       |                     }
 5445|       |                  }
 5446|       |                  if (pos != stop) ++pos;
 5447|       |                  continue;
 5448|       |               }
 5449|       |               if (c == '[' || c == '{') {
 5450|       |                  ++depth;
 5451|       |                  ++pos;
 5452|       |                  continue;
 5453|       |               }
 5454|       |               if (c == ']' || c == '}') {
 5455|       |                  if (depth == 0) return false;
 5456|       |                  --depth;
 5457|       |                  ++pos;
 5458|       |                  continue;
 5459|       |               }
 5460|       |               if (c == ',' && depth == 0) return false;
 5461|       |               if (c == ':' && depth == 0) {
 5462|       |                  auto next = pos + 1;
 5463|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|       |               }
 5465|       |               ++pos;
 5466|       |            }
 5467|       |            return false;
 5468|       |         };
 5469|       |
 5470|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5471|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5472|       |               return;
 5473|       |            }
 5474|       |            if (bool(ctx.error)) {
 5475|       |               return;
 5476|       |            }
 5477|       |         }
 5478|       |
 5479|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|       |         return;
 5481|       |      }
 5482|       |
 5483|   334k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 167k, False: 167k]
  ------------------
 5484|   167k|         return;
 5485|   167k|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|   167k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 11.2k, False: 155k]
  ------------------
 5488|  11.2k|         return;
 5489|  11.2k|      }
 5490|   155k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|   155k|   }
_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_:
 5848|  31.8k|            auto is_word_boundary = [&](const auto ptr) {
 5849|  31.8k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 735, False: 31.1k]
  ------------------
 5850|    735|                  return true;
 5851|    735|               }
 5852|  31.1k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 20.1k, False: 10.9k]
  ------------------
 5853|  20.1k|                  auto next = ptr + 1;
 5854|  20.1k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 1.32k, False: 18.8k]
  |  Branch (5854:43): [True: 13.9k, False: 4.86k]
  |  Branch (5854:59): [True: 2.10k, False: 2.75k]
  |  Branch (5854:76): [True: 1.26k, False: 1.49k]
  |  Branch (5854:93): [True: 945, False: 548]
  ------------------
 5855|  20.1k|               }
 5856|  10.9k|               return is_plain_scalar_boundary(*ptr);
 5857|  31.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_ENKUlcE_clEc:
 5774|  10.9k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  10.9k|               switch (ch) {
 5776|    628|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 628, False: 10.3k]
  ------------------
 5777|  1.39k|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 766, False: 10.1k]
  ------------------
 5778|  4.87k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 3.48k, False: 7.46k]
  ------------------
 5779|  9.03k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 4.15k, False: 6.78k]
  ------------------
 5780|  9.03k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 7, False: 10.9k]
  ------------------
 5781|  9.06k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 23, False: 10.9k]
  ------------------
 5782|  9.08k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 23, False: 10.9k]
  ------------------
 5783|  9.08k|                  return true;
 5784|  1.85k|               default:
  ------------------
  |  Branch (5784:16): [True: 1.85k, False: 9.08k]
  ------------------
 5785|  1.85k|                  return false;
 5786|  10.9k|               }
 5787|  10.9k|            };
_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_:
 5789|  29.4k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5791|       |                  return false;
 5792|       |               }
 5793|  29.4k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 1.39k, False: 28.0k]
  ------------------
 5794|  1.39k|                  return false;
 5795|  1.39k|               }
 5796|  28.0k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 574, False: 27.4k]
  |  Branch (5796:40): [True: 24.0k, False: 3.46k]
  |  Branch (5796:61): [True: 19.8k, False: 4.15k]
  ------------------
 5797|  20.4k|                  return false;
 5798|  20.4k|               }
 5799|       |
 5800|  7.61k|               auto look = word_end;
 5801|  7.61k|               yaml::skip_newline(look, end);
 5802|  26.1k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 24.7k, False: 1.40k]
  ------------------
 5803|  24.7k|                  int32_t line_indent = 0;
 5804|  37.4k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 37.3k, False: 91]
  |  Branch (5804:41): [True: 12.6k, False: 24.6k]
  ------------------
 5805|  12.6k|                     ++line_indent;
 5806|  12.6k|                     ++look;
 5807|  12.6k|                  }
 5808|  24.7k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 24.6k, False: 91]
  |  Branch (5808:38): [True: 743, False: 23.9k]
  ------------------
 5809|    743|                     return false;
 5810|    743|                  }
 5811|  24.0k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 91, False: 23.9k]
  |  Branch (5811:38): [True: 2.61k, False: 21.3k]
  |  Branch (5811:55): [True: 7.91k, False: 13.4k]
  ------------------
 5812|  10.6k|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 10.5k, False: 91]
  ------------------
 5813|  10.5k|                        yaml::skip_newline(look, end);
 5814|  10.5k|                        continue;
 5815|  10.5k|                     }
 5816|     91|                     return false;
 5817|  10.6k|                  }
 5818|  13.4k|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 8.05k, False: 5.35k]
  ------------------
 5819|  8.05k|                     yaml::skip_comment(look, end);
 5820|  8.05k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 8.02k, False: 22]
  |  Branch (5820:42): [True: 6.10k, False: 1.92k]
  |  Branch (5820:59): [True: 1.92k, False: 0]
  ------------------
 5821|  8.02k|                        yaml::skip_newline(look, end);
 5822|  8.02k|                        continue;
 5823|  8.02k|                     }
 5824|     22|                     return false;
 5825|  8.05k|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  5.35k|                  {
 5831|  5.35k|                     auto scan = look;
 5832|   553k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 552k, False: 197]
  |  Branch (5832:44): [True: 552k, False: 459]
  |  Branch (5832:61): [True: 552k, False: 305]
  ------------------
 5833|   552k|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 19.6k, False: 532k]
  ------------------
 5834|  19.6k|                           auto after_colon = scan + 1;
 5835|  19.6k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 49, False: 19.6k]
  |  Branch (5835:54): [True: 2.28k, False: 17.3k]
  |  Branch (5835:77): [True: 891, False: 16.4k]
  ------------------
 5836|  16.4k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 238, False: 16.1k]
  |  Branch (5836:56): [True: 934, False: 15.2k]
  ------------------
 5837|  4.39k|                              return false;
 5838|  4.39k|                           }
 5839|  19.6k|                        }
 5840|   547k|                        ++scan;
 5841|   547k|                     }
 5842|  5.35k|                  }
 5843|       |
 5844|    961|                  return line_indent > ctx.current_indent();
 5845|  5.35k|               }
 5846|  1.40k|               return false;
 5847|  7.61k|            };
_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_:
 5377|   412k|   {
 5378|   412k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   412k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   412k|         const bool could_be_mapping = [&] {
 5386|   412k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   412k|               return line_could_be_flow_mapping(it, end);
 5388|   412k|            }
 5389|   412k|            else {
 5390|   412k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   412k|            }
 5392|   412k|         }();
 5393|   412k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 171k, False: 241k]
  ------------------
 5394|   171k|            return false;
 5395|   171k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   241k|         auto temp_ctx = ctx.make_speculative();
 5398|   241k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   241k|                                                                                               end);
 5400|   241k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   241k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   241k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 220k, False: 21.0k]
  ------------------
 5403|   220k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   220k|            return true;
 5405|   220k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  21.0k|         ctx.error = temp_ctx.error;
 5410|  21.0k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  21.0k|         return false;
 5412|   241k|      }
 5413|   412k|   }
_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:
 5385|   412k|         const bool could_be_mapping = [&] {
 5386|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5387|       |               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|   412k|            else {
 5390|   412k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   412k|            }
 5392|   412k|         }();
_ZZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_ENKUlT_E_clISD_EEDaSM_:
  145|    867|               auto is_document_start = [&](auto pos) {
  146|    867|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (146:23): [True: 575, False: 292]
  |  Branch (146:41): [True: 248, False: 327]
  |  Branch (146:58): [True: 218, False: 30]
  |  Branch (146:75): [True: 209, False: 9]
  ------------------
  147|    209|                     auto after = pos + 3;
  148|    209|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (148:29): [True: 11, False: 198]
  |  Branch (148:45): [True: 49, False: 149]
  |  Branch (148:62): [True: 97, False: 52]
  |  Branch (148:80): [True: 27, False: 25]
  |  Branch (148:98): [True: 20, False: 5]
  ------------------
  149|      5|                            *after == '#';
  ------------------
  |  Branch (149:29): [True: 2, False: 3]
  ------------------
  150|    209|                  }
  151|    658|                  return false;
  152|    867|               };
_ZN3glz9read_yamlITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10contiguousERNSt3__16vectorIcNS8_9allocatorIcEEEEEENS_9error_ctxEOT0_OT1_:
 6606|  32.8k|   {
 6607|  32.8k|      if (buffer.empty()) {
  ------------------
  |  Branch (6607:11): [True: 0, False: 32.8k]
  ------------------
 6608|      0|         using V = std::remove_cvref_t<T>;
 6609|      0|         if constexpr (requires { value = nullptr; }) {
 6610|      0|            value = nullptr;
 6611|      0|            return {};
 6612|       |         }
 6613|       |         else if constexpr (nullable_like<V>) {
 6614|       |            value = {};
 6615|       |            return {};
 6616|       |         }
 6617|      0|      }
 6618|      0|      yaml::yaml_context ctx{};
 6619|  32.8k|      return read<set_yaml<Opts>()>(std::forward<T>(value), std::forward<Buffer>(buffer), ctx);
 6620|  32.8k|   }
_ZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
   69|  32.8k|      {
   70|  32.8k|         if constexpr (requires { ctx.stream_begin; }) {
   71|  32.8k|            if (!ctx.stream_begin && it != end) {
  ------------------
  |  Branch (71:17): [True: 32.8k, False: 0]
  |  Branch (71:38): [True: 32.8k, False: 0]
  ------------------
   72|  32.8k|               ctx.stream_begin = &*it;
   73|       |               // The line memo holds pointers into whatever buffer filled it, so a reused
   74|       |               // context must not carry a previous read's into this one.
   75|  32.8k|               if constexpr (requires { ctx.reset_line_memo(); }) {
   76|  32.8k|                  ctx.reset_line_memo();
   77|  32.8k|               }
   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|  32.8k|               if constexpr (requires { ctx.alias_expansion_budget; } && requires { size_t(end - it); }) {
   82|  32.8k|                  const size_t scaled = size_t(end - it) * yaml::max_alias_expansion_factor;
   83|  32.8k|                  ctx.alias_expansion_budget =
   84|  32.8k|                     scaled > yaml::min_alias_expansion_bytes ? scaled : yaml::min_alias_expansion_bytes;
  ------------------
  |  Branch (84:22): [True: 164, False: 32.6k]
  ------------------
   85|  32.8k|               }
   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|  32.8k|               if constexpr (requires { ctx.key_expansion_budget; } && requires { size_t(end - it); }) {
   89|  32.8k|                  const size_t scaled = size_t(end - it) * yaml::max_key_expansion_factor;
   90|  32.8k|                  ctx.key_expansion_budget =
   91|  32.8k|                     scaled > yaml::min_key_expansion_bytes ? scaled : yaml::min_key_expansion_bytes;
  ------------------
  |  Branch (91:22): [True: 164, False: 32.6k]
  ------------------
   92|  32.8k|               }
   93|  32.8k|            }
   94|  32.8k|         }
   95|       |         // Skip YAML directives and document start marker (---) if present
   96|  32.8k|         yaml::skip_document_start(it, end, ctx);
   97|  32.8k|         if (bool(ctx.error)) [[unlikely]] {
  ------------------
  |  Branch (97:14): [True: 254, False: 32.5k]
  ------------------
   98|    254|            return;
   99|    254|         }
  100|       |
  101|  32.5k|         using V = std::remove_cvref_t<T>;
  102|  32.5k|         if (it == end) {
  ------------------
  |  Branch (102:14): [True: 18, False: 32.5k]
  ------------------
  103|       |            // An empty document is a valid YAML null document.
  104|     18|            if constexpr (requires { value = nullptr; }) {
  105|     18|               value = nullptr;
  106|     18|               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|     18|         }
  117|       |
  118|       |         // A bare document boundary marker at root denotes an empty document.
  119|       |         // Examples: "---\n---\n", "# comment\n...\n"
  120|  32.5k|         if (yaml::at_document_start(it, end) || yaml::at_document_end(it, end)) {
  ------------------
  |  Branch (120:14): [True: 24, False: 32.5k]
  |  Branch (120:50): [True: 2, False: 32.5k]
  ------------------
  121|      8|            if constexpr (requires { value = nullptr; }) {
  122|      8|               value = nullptr;
  123|      8|               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|      8|         }
  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|  32.5k|         if constexpr (!check_partial_read(Opts)) {
  144|  32.5k|            if (!bool(ctx.error) && ctx.current_indent() < 0) {
  ------------------
  |  Branch (144:17): [True: 5.19k, False: 27.3k]
  |  Branch (144:37): [True: 5.19k, False: 0]
  ------------------
  145|  5.19k|               auto is_document_start = [&](auto pos) {
  146|  5.19k|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  147|  5.19k|                     auto after = pos + 3;
  148|  5.19k|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  149|  5.19k|                            *after == '#';
  150|  5.19k|                  }
  151|  5.19k|                  return false;
  152|  5.19k|               };
  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|  5.19k|               if constexpr (requires { ctx.line_prefix_before(it); }) {
  162|  5.19k|                  if (it != end && ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (162:23): [True: 1.24k, False: 3.94k]
  |  Branch (162:23): [True: 800, False: 4.39k]
  |  Branch (162:36): [True: 800, False: 446]
  ------------------
  163|    800|                     auto rest = it;
  164|  3.21k|                     while (rest != end && (*rest == ' ' || *rest == '\t')) ++rest;
  ------------------
  |  Branch (164:29): [True: 3.21k, False: 0]
  |  Branch (164:45): [True: 576, False: 2.63k]
  |  Branch (164:61): [True: 1.83k, False: 800]
  ------------------
  165|    800|                     if (rest != end && *rest != '\n' && *rest != '\r' && *rest != '#') {
  ------------------
  |  Branch (165:26): [True: 800, False: 0]
  |  Branch (165:41): [True: 681, False: 119]
  |  Branch (165:58): [True: 544, False: 137]
  |  Branch (165:75): [True: 462, False: 82]
  ------------------
  166|    462|                        ctx.error = error_code::syntax_error;
  167|    462|                        return;
  168|    462|                     }
  169|    800|                  }
  170|  5.19k|               }
  171|       |
  172|  4.72k|               auto tail_scan = it;
  173|  5.19k|               bool seen_document_end_marker = false;
  174|  12.6k|               while (tail_scan != end) {
  ------------------
  |  Branch (174:23): [True: 8.18k, False: 4.51k]
  ------------------
  175|  8.18k|                  auto line = tail_scan;
  176|  12.3k|                  while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (176:26): [True: 12.3k, False: 0]
  |  Branch (176:42): [True: 2.86k, False: 9.44k]
  |  Branch (176:58): [True: 1.26k, False: 8.18k]
  ------------------
  177|  8.18k|                  if (line != tail_scan && line != end && *line != '\n' && *line != '\r' && *line != '#') {
  ------------------
  |  Branch (177:23): [True: 2.19k, False: 5.98k]
  |  Branch (177:44): [True: 2.19k, False: 0]
  |  Branch (177:59): [True: 1.73k, False: 458]
  |  Branch (177:76): [True: 1.27k, False: 463]
  |  Branch (177:93): [True: 120, False: 1.15k]
  ------------------
  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|    120|                     const char first = *line;
  182|    120|                     const bool explicit_or_structural_start =
  183|    120|                        (first == ':' || first == '?' || first == '!' || first == '&' || first == '*' || first == '[' ||
  ------------------
  |  Branch (183:26): [True: 6, False: 114]
  |  Branch (183:42): [True: 2, False: 112]
  |  Branch (183:58): [True: 3, False: 109]
  |  Branch (183:74): [True: 2, False: 107]
  |  Branch (183:90): [True: 4, False: 103]
  |  Branch (183:106): [True: 3, False: 100]
  ------------------
  184|    100|                         first == '{' || first == '"' || first == '\'' || first == '-');
  ------------------
  |  Branch (184:26): [True: 1, False: 99]
  |  Branch (184:42): [True: 2, False: 97]
  |  Branch (184:58): [True: 2, False: 95]
  |  Branch (184:75): [True: 9, False: 86]
  ------------------
  185|    120|                     if (!explicit_or_structural_start) {
  ------------------
  |  Branch (185:26): [True: 86, False: 34]
  ------------------
  186|     86|                        auto scan = line;
  187|  1.73k|                        while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (187:32): [True: 1.67k, False: 55]
  |  Branch (187:47): [True: 1.66k, False: 6]
  |  Branch (187:64): [True: 1.66k, False: 6]
  ------------------
  188|  1.66k|                           if (*scan == ':') {
  ------------------
  |  Branch (188:32): [True: 314, False: 1.34k]
  ------------------
  189|    314|                              auto after = scan + 1;
  190|    314|                              if (after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r') {
  ------------------
  |  Branch (190:35): [True: 0, False: 314]
  |  Branch (190:51): [True: 7, False: 307]
  |  Branch (190:68): [True: 3, False: 304]
  |  Branch (190:86): [True: 4, False: 300]
  |  Branch (190:104): [True: 5, False: 295]
  ------------------
  191|     19|                                 ctx.error = error_code::syntax_error;
  192|     19|                                 return;
  193|     19|                              }
  194|    314|                           }
  195|  1.64k|                           ++scan;
  196|  1.64k|                        }
  197|     86|                     }
  198|    101|                     return;
  199|    120|                  }
  200|  8.06k|                  if (line == end) {
  ------------------
  |  Branch (200:23): [True: 0, False: 8.06k]
  ------------------
  201|      0|                     return;
  202|      0|                  }
  203|  8.06k|                  if (*line == ':' || *line == '?') {
  ------------------
  |  Branch (203:23): [True: 22, False: 8.03k]
  |  Branch (203:39): [True: 13, False: 8.02k]
  ------------------
  204|     35|                     return; // Explicit key/value continuation.
  205|     35|                  }
  206|  8.02k|                  if (*line == '\n' || *line == '\r') {
  ------------------
  |  Branch (206:23): [True: 3.38k, False: 4.64k]
  |  Branch (206:40): [True: 1.87k, False: 2.76k]
  ------------------
  207|  5.26k|                     tail_scan = line;
  208|  5.26k|                     yaml::skip_newline(tail_scan, end);
  209|  5.26k|                     continue;
  210|  5.26k|                  }
  211|  2.76k|                  if (*line == '#') {
  ------------------
  |  Branch (211:23): [True: 1.87k, False: 889]
  ------------------
  212|  28.2k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (212:29): [True: 28.1k, False: 89]
  |  Branch (212:49): [True: 27.4k, False: 712]
  |  Branch (212:71): [True: 26.3k, False: 1.07k]
  ------------------
  213|  1.87k|                     yaml::skip_newline(tail_scan, end);
  214|  1.87k|                     continue;
  215|  1.87k|                  }
  216|    889|                  if (yaml::at_document_end(line, end)) {
  ------------------
  |  Branch (216:23): [True: 369, False: 520]
  ------------------
  217|    369|                     seen_document_end_marker = true;
  218|  4.51k|                     while (tail_scan != end && *tail_scan != '\n' && *tail_scan != '\r') ++tail_scan;
  ------------------
  |  Branch (218:29): [True: 4.49k, False: 20]
  |  Branch (218:49): [True: 4.39k, False: 102]
  |  Branch (218:71): [True: 4.14k, False: 247]
  ------------------
  219|    369|                     yaml::skip_newline(tail_scan, end);
  220|    369|                     continue;
  221|    369|                  }
  222|    520|                  if (is_document_start(line)) {
  ------------------
  |  Branch (222:23): [True: 99, False: 421]
  ------------------
  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|     99|                     auto header = line + 3;
  228|    742|                     while (header != end && (*header == ' ' || *header == '\t')) ++header;
  ------------------
  |  Branch (228:29): [True: 742, False: 0]
  |  Branch (228:47): [True: 326, False: 416]
  |  Branch (228:65): [True: 317, False: 99]
  ------------------
  229|     99|                     if (header != end && *header == '!') {
  ------------------
  |  Branch (229:26): [True: 99, False: 0]
  |  Branch (229:43): [True: 34, False: 65]
  ------------------
  230|     34|                        auto tag_end = header + 1;
  231|  45.8k|                        while (tag_end != end && *tag_end != ' ' && *tag_end != '\t' && *tag_end != '\n' &&
  ------------------
  |  Branch (231:32): [True: 45.8k, False: 8]
  |  Branch (231:50): [True: 45.8k, False: 12]
  |  Branch (231:69): [True: 45.8k, False: 7]
  |  Branch (231:89): [True: 45.8k, False: 3]
  ------------------
  232|  45.8k|                               *tag_end != '\r' && *tag_end != '#') {
  ------------------
  |  Branch (232:32): [True: 45.8k, False: 2]
  |  Branch (232:52): [True: 45.8k, False: 2]
  ------------------
  233|  45.8k|                           ++tag_end;
  234|  45.8k|                        }
  235|     34|                        std::string_view tag_token(header, static_cast<size_t>(tag_end - header));
  236|     34|                        const auto second_bang = tag_token.find('!', 1);
  237|     34|                        if (second_bang != std::string_view::npos) {
  ------------------
  |  Branch (237:29): [True: 18, False: 16]
  ------------------
  238|     18|                           std::string_view handle = tag_token.substr(0, second_bang + 1);
  239|     18|                           if (handle != "!" && handle != "!!") {
  ------------------
  |  Branch (239:32): [True: 18, False: 0]
  |  Branch (239:49): [True: 17, False: 1]
  ------------------
  240|     17|                              ctx.error = error_code::syntax_error;
  241|     17|                              return;
  242|     17|                           }
  243|     18|                        }
  244|     34|                     }
  245|     82|                     return; // Additional documents are allowed in the stream tail.
  246|     99|                  }
  247|    421|                  if (line != end && *line == '%') {
  ------------------
  |  Branch (247:23): [True: 421, False: 0]
  |  Branch (247:38): [True: 11, False: 410]
  ------------------
  248|       |                     // YAML directives are only valid in document prefixes. A directive
  249|       |                     // encountered mid-document (without a prior ...) is malformed.
  250|     11|                     if (!seen_document_end_marker) {
  ------------------
  |  Branch (250:26): [True: 7, False: 4]
  ------------------
  251|      7|                        ctx.error = error_code::syntax_error;
  252|      7|                        return;
  253|      7|                     }
  254|      4|                     return;
  255|     11|                  }
  256|    410|                  if (seen_document_end_marker) {
  ------------------
  |  Branch (256:23): [True: 53, False: 357]
  ------------------
  257|     53|                     return; // Implicit next document after explicit document end marker.
  258|     53|                  }
  259|    357|                  ctx.error = error_code::syntax_error;
  260|    357|                  return;
  261|    410|               }
  262|  5.19k|            }
  263|  32.5k|         }
  264|  32.5k|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|   487k|      {
  275|   487k|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|   487k|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|   487k|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|   487k|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_:
 5635|   630k|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|   630k|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|   630k|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|   630k|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|   630k|                       "the internally tagged shape, so it is rejected here instead.");
 5642|   630k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 630k]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|   630k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|   630k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 36, False: 630k]
  ------------------
 5650|     36|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|   630k|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 88.7k, False: 541k]
  ------------------
 5655|  88.7k|            yaml::skip_ws_newlines_comments(it, end);
 5656|  88.7k|         }
 5657|   541k|         else {
 5658|   541k|            yaml::skip_inline_ws(it, end);
 5659|   541k|         }
 5660|       |
 5661|   630k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 32, False: 630k]
  ------------------
 5662|     32|            ctx.error = error_code::unexpected_end;
 5663|     32|            return;
 5664|     32|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|   630k|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|   630k|            using V = std::remove_cvref_t<T>;
 5772|   630k|            using counts = yaml_variant_type_count<V>;
 5773|   630k|            const char c = *it;
 5774|   630k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|   630k|               switch (ch) {
 5776|   630k|               case ' ':
 5777|   630k|               case '\t':
 5778|   630k|               case '\n':
 5779|   630k|               case '\r':
 5780|   630k|               case ',':
 5781|   630k|               case ']':
 5782|   630k|               case '}':
 5783|   630k|                  return true;
 5784|   630k|               default:
 5785|   630k|                  return false;
 5786|   630k|               }
 5787|   630k|            };
 5788|       |
 5789|   630k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|   630k|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|   630k|                  return false;
 5792|   630k|               }
 5793|   630k|               if (ctx.current_indent() < 0) {
 5794|   630k|                  return false;
 5795|   630k|               }
 5796|   630k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|   630k|                  return false;
 5798|   630k|               }
 5799|       |
 5800|   630k|               auto look = word_end;
 5801|   630k|               yaml::skip_newline(look, end);
 5802|   630k|               while (look != end) {
 5803|   630k|                  int32_t line_indent = 0;
 5804|   630k|                  while (look != end && *look == ' ') {
 5805|   630k|                     ++line_indent;
 5806|   630k|                     ++look;
 5807|   630k|                  }
 5808|   630k|                  if (look != end && *look == '\t') {
 5809|   630k|                     return false;
 5810|   630k|                  }
 5811|   630k|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|   630k|                     if (look != end) {
 5813|   630k|                        yaml::skip_newline(look, end);
 5814|   630k|                        continue;
 5815|   630k|                     }
 5816|   630k|                     return false;
 5817|   630k|                  }
 5818|   630k|                  if (*look == '#') {
 5819|   630k|                     yaml::skip_comment(look, end);
 5820|   630k|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|   630k|                        yaml::skip_newline(look, end);
 5822|   630k|                        continue;
 5823|   630k|                     }
 5824|   630k|                     return false;
 5825|   630k|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|   630k|                  {
 5831|   630k|                     auto scan = look;
 5832|   630k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|   630k|                        if (*scan == ':') {
 5834|   630k|                           auto after_colon = scan + 1;
 5835|   630k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|   630k|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|   630k|                              return false;
 5838|   630k|                           }
 5839|   630k|                        }
 5840|   630k|                        ++scan;
 5841|   630k|                     }
 5842|   630k|                  }
 5843|       |
 5844|   630k|                  return line_indent > ctx.current_indent();
 5845|   630k|               }
 5846|   630k|               return false;
 5847|   630k|            };
 5848|   630k|            auto is_word_boundary = [&](const auto ptr) {
 5849|   630k|               if (ptr == end) {
 5850|   630k|                  return true;
 5851|   630k|               }
 5852|   630k|               if (*ptr == ':') {
 5853|   630k|                  auto next = ptr + 1;
 5854|   630k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|   630k|               }
 5856|   630k|               return is_plain_scalar_boundary(*ptr);
 5857|   630k|            };
 5858|       |
 5859|   630k|            switch (c) {
 5860|   118k|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 118k, False: 512k]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|   118k|               ++it;
 5863|   118k|               auto aname = yaml::parse_anchor_name(it, end);
 5864|   118k|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 54, False: 118k]
  ------------------
 5865|     54|                  ctx.error = error_code::syntax_error;
 5866|     54|                  return;
 5867|     54|               }
 5868|   118k|               yaml::skip_inline_ws(it, end);
 5869|   118k|               bool anchor_on_same_line = true;
 5870|   118k|               bool value_is_indentless_sequence = false;
 5871|   118k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 3.27k, False: 115k]
  |  Branch (5871:33): [True: 20.0k, False: 94.9k]
  |  Branch (5871:48): [True: 8.92k, False: 86.0k]
  |  Branch (5871:63): [True: 2.52k, False: 83.4k]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|  34.7k|                  bool value_on_next_line = false;
 5875|  34.7k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 31.5k, False: 3.27k]
  ------------------
 5876|  31.5k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|  31.5k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 2.52k, False: 28.9k]
  ------------------
 5879|  1.46M|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 1.46M, False: 111]
  |  Branch (5879:47): [True: 1.46M, False: 992]
  |  Branch (5879:64): [True: 1.46M, False: 1.42k]
  ------------------
 5880|  2.52k|                     }
 5881|       |                     // Skip newline
 5882|  31.5k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 31.3k, False: 111]
  |  Branch (5882:42): [True: 21.0k, False: 10.3k]
  |  Branch (5882:59): [True: 10.3k, False: 0]
  ------------------
 5883|  31.3k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|  45.3k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 42.9k, False: 2.43k]
  |  Branch (5885:48): [True: 1.03k, False: 41.9k]
  |  Branch (5885:65): [True: 12.9k, False: 28.9k]
  ------------------
 5886|  14.0k|                           yaml::skip_newline(peek, end);
 5887|  14.0k|                        }
 5888|       |                        // Measure indent of next content line
 5889|  31.3k|                        int32_t next_indent = 0;
 5890|  45.8k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 43.2k, False: 2.59k]
  |  Branch (5890:47): [True: 14.5k, False: 28.7k]
  ------------------
 5891|  14.5k|                           ++next_indent;
 5892|  14.5k|                           ++peek;
 5893|  14.5k|                        }
 5894|  31.3k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 28.7k, False: 2.59k]
  |  Branch (5894:44): [True: 28.3k, False: 405]
  |  Branch (5894:61): [True: 28.1k, False: 271]
  ------------------
 5895|  28.1k|                           const bool indentless_sequence =
 5896|  28.1k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 23.9k, False: 4.14k]
  |  Branch (5896:69): [True: 17.2k, False: 6.68k]
  ------------------
 5897|  17.2k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 24, False: 17.2k]
  ------------------
 5898|  17.2k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 17.0k, False: 257]
  ------------------
 5899|  17.0k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 14.8k, False: 2.19k]
  ------------------
 5900|  2.19k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 1.06k, False: 1.13k]
  |  Branch (5900:61): [True: 711, False: 352]
  ------------------
 5901|  28.1k|                           value_is_indentless_sequence = indentless_sequence;
 5902|  28.1k|                           const bool same_indent_property_node =
 5903|  28.1k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 18.2k, False: 9.81k]
  ------------------
 5904|  18.2k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 484, False: 17.8k]
  |  Branch (5904:48): [True: 1.74k, False: 16.0k]
  |  Branch (5904:64): [True: 16, False: 16.0k]
  |  Branch (5904:80): [True: 291, False: 15.7k]
  |  Branch (5904:96): [True: 11, False: 15.7k]
  ------------------
 5905|  15.7k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 2, False: 15.7k]
  |  Branch (5905:48): [True: 9, False: 15.7k]
  |  Branch (5905:65): [True: 286, False: 15.4k]
  |  Branch (5905:81): [True: 30, False: 15.4k]
  ------------------
 5906|  28.1k|                           value_on_next_line =
 5907|  28.1k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 7.42k, False: 20.6k]
  |  Branch (5907:71): [True: 15.5k, False: 5.14k]
  |  Branch (5907:94): [True: 2.87k, False: 2.27k]
  ------------------
 5908|  28.1k|                        }
 5909|  31.3k|                     }
 5910|  31.5k|                  }
 5911|  34.7k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 8.93k, False: 25.8k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  8.93k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  8.93k|                     return;
 5915|  8.93k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|  25.8k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 1.55k, False: 24.2k]
  ------------------
 5918|  1.43M|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 1.43M, False: 0]
  |  Branch (5918:42): [True: 1.43M, False: 575]
  |  Branch (5918:57): [True: 1.43M, False: 983]
  ------------------
 5919|  1.55k|                  }
 5920|  25.8k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 25.8k, False: 0]
  ------------------
 5921|  29.9k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 29.9k, False: 0]
  |  Branch (5921:40): [True: 752, False: 29.2k]
  |  Branch (5921:55): [True: 3.39k, False: 25.8k]
  ------------------
 5922|  4.15k|                     yaml::skip_newline(it, end);
 5923|  4.15k|                  }
 5924|  25.8k|                  yaml::skip_inline_ws(it, end);
 5925|  25.8k|                  anchor_on_same_line = false;
 5926|  25.8k|               }
 5927|       |
 5928|   109k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|   109k|                  if (anchor_on_same_line && *it == '-' &&
  ------------------
  |  Branch (5929:23): [True: 83.4k, False: 25.8k]
  |  Branch (5929:46): [True: 507, False: 82.9k]
  ------------------
 5930|    507|                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
  ------------------
  |  Branch (5930:24): [True: 2, False: 505]
  |  Branch (5930:43): [True: 8, False: 497]
  ------------------
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|     10|                     ctx.error = error_code::syntax_error;
 5933|     10|                     return;
 5934|     10|                  }
 5935|   109k|               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|   109k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 109k, False: 14]
  |  Branch (5939:33): [True: 1.66k, False: 107k]
  |  Branch (5939:47): [True: 102, False: 1.55k]
  ------------------
 5940|    102|                  ctx.error = error_code::syntax_error;
 5941|    102|                  return;
 5942|    102|               }
 5943|       |
 5944|   109k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|   109k|                  if (!anchor_on_same_line && it != end && *it == '&') {
  ------------------
  |  Branch (5945:23): [True: 25.8k, False: 83.4k]
  |  Branch (5945:47): [True: 25.8k, False: 4]
  |  Branch (5945:60): [True: 2.45k, False: 23.3k]
  ------------------
 5946|  2.45k|                     auto probe = it + 1;
 5947|  2.45k|                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|  2.45k|                     if (nested_anchor_name.empty()) {
  ------------------
  |  Branch (5948:26): [True: 10, False: 2.44k]
  ------------------
 5949|     10|                        ctx.error = error_code::syntax_error;
 5950|     10|                        return;
 5951|     10|                     }
 5952|  2.44k|                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|  2.44k|                     if (!yaml::line_could_be_block_mapping(probe, end)) {
  ------------------
  |  Branch (5956:26): [True: 58, False: 2.38k]
  ------------------
 5957|     58|                        ctx.error = error_code::syntax_error;
 5958|     58|                        return;
 5959|     58|                     }
 5960|  2.44k|                  }
 5961|   109k|               }
 5962|       |
 5963|   109k|               const char* anchor_start = &*it;
 5964|   109k|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|   109k|               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|   109k|                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (5970:23): [True: 83.3k, False: 25.8k]
  |  Branch (5970:46): [True: 31.9k, False: 51.4k]
  ------------------
 5971|  31.9k|                     auto key_start = it;
 5972|  31.9k|                     if (*key_start == '!') {
  ------------------
  |  Branch (5972:26): [True: 889, False: 31.0k]
  ------------------
 5973|    889|                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|    889|                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
  ------------------
  |  Branch (5974:29): [True: 4, False: 885]
  |  Branch (5974:67): [True: 1, False: 884]
  ------------------
 5975|      5|                           ctx.error = error_code::syntax_error;
 5976|      5|                           return;
 5977|      5|                        }
 5978|    884|                        yaml::skip_inline_ws(key_start, end);
 5979|    884|                        if (key_start == end) {
  ------------------
  |  Branch (5979:29): [True: 0, False: 884]
  ------------------
 5980|      0|                           ctx.error = error_code::unexpected_end;
 5981|      0|                           return;
 5982|      0|                        }
 5983|    884|                        if (*key_start == '\n' || *key_start == '\r') {
  ------------------
  |  Branch (5983:29): [True: 1, False: 883]
  |  Branch (5983:51): [True: 1, False: 882]
  ------------------
 5984|      2|                           ctx.error = error_code::syntax_error;
 5985|      2|                           return;
 5986|      2|                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|    882|                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
  ------------------
  |  Branch (5992:29): [True: 324, False: 558]
  |  Branch (5992:50): [True: 1, False: 323]
  ------------------
 5993|      1|                           ctx.error = error_code::syntax_error;
 5994|      1|                           return;
 5995|      1|                        }
 5996|    882|                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|  31.9k|                     auto key_scan = key_start;
 6000|  31.9k|                     auto key_end = key_start;
 6001|  31.9k|                     if (*key_scan == '"' || *key_scan == '\'') {
  ------------------
  |  Branch (6001:26): [True: 313, False: 31.5k]
  |  Branch (6001:46): [True: 183, False: 31.4k]
  ------------------
 6002|       |                        // Quoted key: skip to closing quote
 6003|    496|                        const char quote = *key_scan;
 6004|    496|                        ++key_scan;
 6005|  3.39k|                        while (key_scan != end && *key_scan != quote) {
  ------------------
  |  Branch (6005:32): [True: 3.38k, False: 2]
  |  Branch (6005:51): [True: 2.89k, False: 494]
  ------------------
 6006|  2.89k|                           if (*key_scan == '\\' && quote == '"') {
  ------------------
  |  Branch (6006:32): [True: 452, False: 2.44k]
  |  Branch (6006:53): [True: 236, False: 216]
  ------------------
 6007|    236|                              ++key_scan;
 6008|    236|                              if (key_scan != end) ++key_scan;
  ------------------
  |  Branch (6008:35): [True: 236, False: 0]
  ------------------
 6009|    236|                           }
 6010|  2.65k|                           else {
 6011|  2.65k|                              ++key_scan;
 6012|  2.65k|                           }
 6013|  2.89k|                        }
 6014|    496|                        if (key_scan == end) {
  ------------------
  |  Branch (6014:29): [True: 2, False: 494]
  ------------------
 6015|      2|                           ctx.error = error_code::syntax_error;
 6016|      2|                           return;
 6017|      2|                        }
 6018|    494|                        ++key_scan; // past closing quote
 6019|    494|                        key_end = key_scan;
 6020|    494|                        yaml::skip_inline_ws(key_scan, end);
 6021|    494|                     }
 6022|  31.4k|                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|  1.29M|                        while (key_scan != end) {
  ------------------
  |  Branch (6024:32): [True: 1.29M, False: 2]
  ------------------
 6025|  1.29M|                           if (*key_scan == ':') {
  ------------------
  |  Branch (6025:32): [True: 63.2k, False: 1.22M]
  ------------------
 6026|  63.2k|                              auto next = key_scan + 1;
 6027|  63.2k|                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
  ------------------
  |  Branch (6027:35): [True: 882, False: 62.3k]
  |  Branch (6027:50): [True: 22.3k, False: 40.0k]
  |  Branch (6027:66): [True: 1.68k, False: 38.3k]
  |  Branch (6027:83): [True: 1.60k, False: 36.7k]
  |  Branch (6027:100): [True: 4.88k, False: 31.8k]
  ------------------
 6028|  31.4k|                                 break;
 6029|  31.4k|                              }
 6030|  63.2k|                           }
 6031|  1.26M|                           ++key_scan;
 6032|  1.26M|                        }
 6033|  31.4k|                        key_end = key_scan;
 6034|  37.4k|                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
  ------------------
  |  Branch (6034:32): [True: 35.5k, False: 1.86k]
  |  Branch (6034:57): [True: 5.60k, False: 29.9k]
  |  Branch (6034:82): [True: 390, False: 29.5k]
  ------------------
 6035|  5.99k|                           --key_end;
 6036|  5.99k|                        }
 6037|  31.4k|                     }
 6038|  31.9k|                     if (key_scan == end || *key_scan != ':') {
  ------------------
  |  Branch (6038:26): [True: 2, False: 31.9k]
  |  Branch (6038:45): [True: 35, False: 31.8k]
  ------------------
 6039|     37|                        ctx.error = error_code::syntax_error;
 6040|     37|                        return;
 6041|     37|                     }
 6042|       |                     // Store anchor with just the key text span
 6043|  31.8k|                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|  31.8k|                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|  31.8k|                     if constexpr (counts::n_object > 0) {
 6047|  31.8k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|  31.8k|                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|  31.8k|                     return;
 6054|  31.9k|                  }
 6055|   109k|               }
 6056|       |
 6057|  77.3k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|   109k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|   109k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|   109k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|   109k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 74.8k, False: 34.4k]
  ------------------
 6062|  74.8k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|  74.8k|               }
 6064|   109k|               return;
 6065|   109k|            }
 6066|  44.3k|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 44.3k, False: 586k]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|  44.3k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|  44.3k|                  if (yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (6069:23): [True: 2.95k, False: 41.4k]
  ------------------
 6070|  2.95k|                     if constexpr (counts::n_object > 0) {
 6071|  2.95k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|  2.95k|                                                                                                        end);
 6073|  2.95k|                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|  2.95k|                  }
 6080|  44.3k|               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|      0|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|  44.3k|               return;
 6085|   109k|            }
 6086|  45.5k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 45.5k, False: 585k]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|  45.5k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|  45.5k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 58, False: 45.5k]
  ------------------
 6090|     58|                  ctx.error = error_code::syntax_error;
 6091|     58|                  return;
 6092|     58|               }
 6093|  45.5k|               yaml::skip_inline_ws(it, end);
 6094|  45.5k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 45.2k, False: 310]
  |  Branch (6094:33): [True: 2.26k, False: 42.9k]
  ------------------
 6095|  2.26k|                  yaml::skip_comment(it, end);
 6096|  2.26k|               }
 6097|  45.5k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 45.1k, False: 350]
  |  Branch (6097:34): [True: 1.67k, False: 43.4k]
  |  Branch (6097:49): [True: 5.03k, False: 38.4k]
  ------------------
 6098|  6.71k|                  auto content = it;
 6099|  6.71k|                  yaml::skip_newline(content, end);
 6100|  6.71k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  6.71k|                  bool consume_following_content = false;
 6103|  6.71k|                  auto content_token = content;
 6104|  6.71k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 6.43k, False: 280]
  ------------------
 6105|  6.43k|                     auto indent_probe = content;
 6106|  6.43k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  6.43k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 4, False: 6.42k]
  ------------------
 6108|      4|                        return;
 6109|  6.42k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  6.42k|                     bool tagged_indentless_sequence = false;
 6114|  6.42k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 2.43k, False: 3.99k]
  |  Branch (6114:56): [True: 2.43k, False: 0]
  |  Branch (6114:79): [True: 2.37k, False: 62]
  ------------------
 6115|  2.37k|                        const auto after_dash = indent_probe + 1;
 6116|  2.37k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 0, False: 2.37k]
  ------------------
 6117|  2.37k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 2.06k, False: 310]
  ------------------
 6118|  2.06k|                           tagged_indentless_sequence =
 6119|  2.06k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 443, False: 1.61k]
  ------------------
 6120|  1.61k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 425, False: 1.19k]
  |  Branch (6120:60): [True: 407, False: 18]
  ------------------
 6121|  2.06k|                        }
 6122|  2.37k|                     }
 6123|       |
 6124|  6.42k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 1.28k, False: 5.14k]
  ------------------
 6125|  5.14k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 2.04k, False: 3.10k]
  |  Branch (6125:93): [True: 850, False: 2.25k]
  ------------------
 6126|  6.42k|                  }
 6127|       |
 6128|  6.70k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 4.17k, False: 2.53k]
  ------------------
 6129|  4.17k|                     it = content_token;
 6130|  4.17k|                  }
 6131|  2.53k|                  else {
 6132|  2.53k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 43, False: 2.49k]
  ------------------
 6133|     43|                        if constexpr (counts::n_str > 0) {
 6134|     43|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|     43|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|     43|                           value = StrType{};
 6137|     43|                           return;
 6138|     43|                        }
 6139|     43|                     }
 6140|  2.53k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 26, False: 2.50k]
  ------------------
 6141|     26|                        if constexpr (counts::n_null > 0) {
 6142|     26|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|     26|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|     26|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 26]
  ------------------
 6145|     26|                           return;
 6146|     26|                        }
 6147|     26|                     }
 6148|  2.53k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 2.14k, False: 388]
  ------------------
 6149|  2.14k|                        if constexpr (counts::n_null > 0) {
 6150|  2.14k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  2.14k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  2.14k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 2.14k]
  ------------------
 6153|  2.14k|                           return;
 6154|  2.14k|                        }
 6155|  2.14k|                     }
 6156|  2.53k|                  }
 6157|  6.70k|               }
 6158|  45.5k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|  45.5k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (6161:23): [True: 42.9k, False: 2.56k]
  |  Branch (6161:36): [True: 13, False: 42.9k]
  ------------------
 6162|     13|                     ctx.error = error_code::syntax_error;
 6163|     13|                     return;
 6164|     13|                  }
 6165|  45.5k|                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|  45.5k|                     const bool starts_block_sequence_entry =
 6168|  45.5k|                        (it != end && *it == '-') &&
  ------------------
  |  Branch (6168:26): [True: 42.9k, False: 2.56k]
  |  Branch (6168:39): [True: 3.25k, False: 39.6k]
  ------------------
 6169|  3.25k|                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6169:26): [True: 85, False: 3.17k]
  |  Branch (6169:45): [True: 2.68k, False: 484]
  ------------------
 6170|  45.5k|                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6170:26): [True: 40.5k, False: 4.98k]
  |  Branch (6170:58): [True: 3.04k, False: 37.4k]
  ------------------
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|  3.04k|                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|  3.04k|                        return;
 6175|  3.04k|                     }
 6176|  45.5k|                  }
 6177|  45.5k|               }
 6178|  45.5k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 350, False: 45.1k]
  ------------------
 6179|    350|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 100, False: 250]
  ------------------
 6180|    100|                     if constexpr (counts::n_str > 0) {
 6181|    100|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    100|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    100|                        value = StrType{};
 6184|    100|                        return;
 6185|    100|                     }
 6186|    100|                  }
 6187|    350|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 246, False: 104]
  ------------------
 6188|    246|                     if constexpr (counts::n_null > 0) {
 6189|    246|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|    246|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|    246|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 246]
  ------------------
 6192|    246|                        return;
 6193|    246|                     }
 6194|    246|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|    350|                  return;
 6197|    350|               }
 6198|  45.1k|               switch (tag) {
 6199|    291|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 291, False: 44.8k]
  ------------------
 6200|    291|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|    291|                  return;
 6202|    899|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 899, False: 44.2k]
  ------------------
 6203|    906|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 7, False: 45.1k]
  ------------------
 6204|    906|                  if constexpr (counts::n_num > 0) {
 6205|    906|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|    906|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  3.13k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 2.23k, False: 42.9k]
  ------------------
 6213|  3.13k|                  if constexpr (counts::n_bool > 0) {
 6214|  3.13k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  3.13k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  3.31k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 181, False: 44.9k]
  ------------------
 6222|  3.31k|                  if constexpr (counts::n_null > 0) {
 6223|  3.31k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  3.31k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  3.31k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 3.31k]
  ------------------
 6226|  3.31k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  3.31k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  4.58k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 1.26k, False: 43.8k]
  ------------------
 6234|  4.58k|                  if constexpr (counts::n_object > 0) {
 6235|  4.58k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  4.58k|                                                                                                     end);
 6237|  4.58k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|  9.07k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 4.49k, False: 40.6k]
  ------------------
 6244|  9.07k|                  if constexpr (counts::n_array > 0) {
 6245|  9.07k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|  9.07k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|  9.07k|                        if (it != end && *it == '-') {
  ------------------
  |  Branch (6247:29): [True: 4.49k, False: 4.58k]
  |  Branch (6247:42): [True: 2.27k, False: 2.21k]
  ------------------
 6248|  2.27k|                           ctx.allow_indentless_sequence = true;
 6249|  2.27k|                        }
 6250|  9.07k|                     }
 6251|  9.07k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|  9.07k|                                                                                                    end);
 6253|  9.07k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|  9.07k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|  39.6k|               default: {
  ------------------
  |  Branch (6260:16): [True: 30.5k, False: 14.6k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|  39.6k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 30.5k, False: 9.07k]
  |  Branch (6263:36): [True: 23.2k, False: 7.26k]
  ------------------
 6264|  23.2k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  23.2k|                     return;
 6266|  23.2k|                  }
 6267|       |
 6268|  16.3k|                  if constexpr (counts::n_array > 0) {
 6269|  16.3k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 7.26k, False: 9.07k]
  |  Branch (6269:39): [True: 77, False: 7.18k]
  ------------------
 6270|     77|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|     77|                                                                                                       end);
 6272|     77|                        return;
 6273|     77|                     }
 6274|  16.3k|                  }
 6275|  16.3k|                  if constexpr (counts::n_object > 0) {
 6276|  16.3k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 7.18k, False: 9.15k]
  |  Branch (6276:39): [True: 296, False: 6.88k]
  ------------------
 6277|    296|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|    296|                                                                                                        end);
 6279|    296|                        return;
 6280|    296|                     }
 6281|  16.3k|                  }
 6282|       |
 6283|  16.3k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|  16.3k|                     if constexpr (counts::n_array > 0) {
 6285|  16.3k|                        const bool starts_block_sequence_entry =
 6286|  16.3k|                           (it != end && *it == '-') &&
  ------------------
  |  Branch (6286:29): [True: 6.88k, False: 9.45k]
  |  Branch (6286:42): [True: 417, False: 6.47k]
  ------------------
 6287|    417|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6287:29): [True: 77, False: 340]
  |  Branch (6287:48): [True: 164, False: 176]
  ------------------
 6288|  16.3k|                        if (starts_block_sequence_entry) {
  ------------------
  |  Branch (6288:29): [True: 241, False: 16.0k]
  ------------------
 6289|    241|                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|    241|                                                                                                          it, end);
 6291|    241|                           return;
 6292|    241|                        }
 6293|  16.3k|                     }
 6294|  16.3k|                     if constexpr (counts::n_object > 0) {
 6295|  16.3k|                        const bool starts_explicit_mapping_indicator =
 6296|  16.3k|                           (it != end && (*it == '?' || *it == ':')) &&
  ------------------
  |  Branch (6296:29): [True: 6.64k, False: 9.69k]
  |  Branch (6296:43): [True: 999, False: 5.64k]
  |  Branch (6296:57): [True: 254, False: 5.39k]
  ------------------
 6297|  1.25k|                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
  ------------------
  |  Branch (6297:29): [True: 318, False: 935]
  |  Branch (6297:48): [True: 641, False: 294]
  ------------------
 6298|  16.3k|                        if (starts_explicit_mapping_indicator) {
  ------------------
  |  Branch (6298:29): [True: 959, False: 15.3k]
  ------------------
 6299|    959|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|    959|                                                                                                           it, end);
 6301|    959|                           return;
 6302|    959|                        }
 6303|  15.3k|                        if (yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6303:29): [True: 0, False: 15.3k]
  ------------------
 6304|      0|                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|      0|                                                                                                           it, end);
 6306|      0|                           return;
 6307|      0|                        }
 6308|  15.3k|                     }
 6309|  16.3k|                  }
 6310|       |
 6311|  16.3k|                  if constexpr (counts::n_str > 0) {
 6312|  16.3k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|  16.3k|                     return;
 6314|  16.3k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|  16.3k|                  return;
 6319|  39.6k|               }
 6320|  45.1k|               }
 6321|      0|               return;
 6322|  45.1k|            }
 6323|  24.2k|            case '{':
  ------------------
  |  Branch (6323:13): [True: 24.2k, False: 606k]
  ------------------
 6324|  24.2k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|  24.2k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6326:23): [True: 5.51k, False: 18.7k]
  |  Branch (6326:51): [True: 676, False: 4.84k]
  ------------------
 6327|    676|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|    676|                                                                                                     end);
 6329|    676|                     return;
 6330|    676|                  }
 6331|  24.2k|               }
 6332|       |               // Flow mapping - object type
 6333|  23.5k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|  24.2k|               return;
 6335|  26.0k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 26.0k, False: 604k]
  ------------------
 6336|  26.0k|               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|  26.0k|                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
  ------------------
  |  Branch (6338:23): [True: 16.8k, False: 9.22k]
  |  Branch (6338:51): [True: 214, False: 16.6k]
  ------------------
 6339|    214|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|    214|                                                                                                     end);
 6341|    214|                     return;
 6342|    214|                  }
 6343|  26.0k|               }
 6344|       |               // Flow sequence - array type
 6345|  25.8k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|  26.0k|               return;
 6347|   118k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 118k, False: 512k]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   118k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 118k, False: 194]
  |  Branch (6349:39): [True: 6, False: 118k]
  ------------------
 6350|      6|                  ctx.error = error_code::syntax_error;
 6351|      6|                  return;
 6352|      6|               }
 6353|   118k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 118k, False: 194]
  |  Branch (6353:40): [True: 38.3k, False: 79.8k]
  |  Branch (6353:56): [True: 71.5k, False: 8.31k]
  |  Branch (6353:73): [True: 5.09k, False: 3.22k]
  ------------------
 6354|   114k|                  if constexpr (counts::n_object > 0) {
 6355|   114k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   114k|                                                                                                     end);
 6357|   114k|                     return;
 6358|   114k|                  }
 6359|   114k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   118k|               return;
 6362|     12|            case '%':
  ------------------
  |  Branch (6362:13): [True: 12, False: 630k]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|     12|               ctx.error = error_code::syntax_error;
 6365|     12|               return;
 6366|    575|            case '"':
  ------------------
  |  Branch (6366:13): [True: 575, False: 630k]
  ------------------
 6367|  1.84k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 1.26k, False: 629k]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  1.84k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  1.84k|               return;
 6372|  6.21k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 6.21k, False: 624k]
  ------------------
 6373|  15.3k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 9.16k, False: 621k]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  15.3k|               if constexpr (counts::n_bool > 0) {
 6376|  15.3k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 14.9k, False: 437]
  |  Branch (6376:44): [True: 11.9k, False: 3.03k]
  |  Branch (6376:60): [True: 11.3k, False: 597]
  |  Branch (6376:76): [True: 10.1k, False: 1.15k]
  ------------------
 6377|  10.1k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 1.71k, False: 3.07k]
  |  Branch (6377:60): [True: 1.20k, False: 514]
  |  Branch (6377:76): [True: 21, False: 1.18k]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  10.1k|                     const auto after_true = it + 4;
 6380|  10.1k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  10.1k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 9.63k, False: 538]
  ------------------
 6383|  9.63k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 71, False: 9.56k]
  ------------------
 6384|     71|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|     71|                           return;
 6386|     71|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  9.56k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 9.47k, False: 85]
  |  Branch (6389:47): [True: 6.83k, False: 2.63k]
  ------------------
 6390|  6.83k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 337, False: 6.50k]
  |  Branch (6390:47): [True: 6.41k, False: 84]
  |  Branch (6390:63): [True: 18, False: 66]
  |  Branch (6390:80): [True: 24, False: 42]
  |  Branch (6390:97): [True: 42, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  6.83k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  6.83k|                           return;
 6394|  6.83k|                        }
 6395|  2.72k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  2.72k|                                                                                                      end);
 6397|  2.72k|                        return;
 6398|  9.56k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  10.1k|                  }
 6401|  15.3k|               }
 6402|  5.74k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  15.3k|               return;
 6404|  5.65k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 5.65k, False: 624k]
  ------------------
 6405|  10.0k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 4.38k, False: 626k]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|  10.0k|               if constexpr (counts::n_bool > 0) {
 6408|  10.0k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 9.71k, False: 326]
  |  Branch (6408:44): [True: 5.91k, False: 3.80k]
  |  Branch (6408:60): [True: 2.82k, False: 3.08k]
  |  Branch (6408:76): [True: 2.64k, False: 174]
  |  Branch (6408:92): [True: 2.32k, False: 328]
  ------------------
 6409|  7.39k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 1.52k, False: 5.86k]
  |  Branch (6409:60): [True: 1.21k, False: 306]
  |  Branch (6409:76): [True: 902, False: 317]
  |  Branch (6409:92): [True: 868, False: 34]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  3.18k|                     const auto after_false = it + 5;
 6412|  3.18k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  3.18k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 2.67k, False: 510]
  ------------------
 6415|  2.67k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 151, False: 2.52k]
  ------------------
 6416|    151|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|    151|                           return;
 6418|    151|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  2.52k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 2.40k, False: 123]
  |  Branch (6421:47): [True: 1.58k, False: 819]
  ------------------
 6422|  1.58k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 28, False: 1.55k]
  |  Branch (6422:47): [True: 278, False: 1.27k]
  |  Branch (6422:63): [True: 854, False: 425]
  |  Branch (6422:80): [True: 78, False: 347]
  |  Branch (6422:97): [True: 347, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  1.58k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  1.58k|                           return;
 6426|  1.58k|                        }
 6427|    942|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|    942|                                                                                                      end);
 6429|    942|                        return;
 6430|  2.52k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  3.18k|                  }
 6433|  10.0k|               }
 6434|  7.35k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|  10.0k|               return;
 6436|  5.12k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 5.12k, False: 625k]
  ------------------
 6437|  6.71k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 1.58k, False: 628k]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  6.71k|               if constexpr (counts::n_null > 0) {
 6440|  6.71k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 5.93k, False: 779]
  |  Branch (6440:44): [True: 3.44k, False: 2.48k]
  |  Branch (6440:60): [True: 2.79k, False: 653]
  |  Branch (6440:76): [True: 2.44k, False: 347]
  ------------------
 6441|  3.48k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 1.77k, False: 1.71k]
  |  Branch (6441:60): [True: 1.27k, False: 500]
  |  Branch (6441:76): [True: 101, False: 1.17k]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  2.54k|                     const auto after_null = it + 4;
 6444|  2.54k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  2.54k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 2.38k, False: 159]
  ------------------
 6447|  2.38k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 139, False: 2.24k]
  ------------------
 6448|    139|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|    139|                           return;
 6450|    139|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  2.24k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 2.09k, False: 151]
  |  Branch (6453:47): [True: 1.37k, False: 721]
  ------------------
 6454|  1.37k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 289, False: 1.08k]
  |  Branch (6454:47): [True: 301, False: 786]
  |  Branch (6454:63): [True: 182, False: 604]
  |  Branch (6454:80): [True: 531, False: 73]
  |  Branch (6454:97): [True: 73, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  1.37k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  1.37k|                           return;
 6458|  1.37k|                        }
 6459|    872|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|    872|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|    872|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 872]
  ------------------
 6462|    872|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|    872|                        return;
 6464|  2.24k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  2.54k|                  }
 6467|  6.71k|               }
 6468|  4.32k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  6.71k|               return;
 6470|    384|            case '~':
  ------------------
  |  Branch (6470:13): [True: 384, False: 630k]
  ------------------
 6471|       |               // Null indicator
 6472|    384|               if constexpr (counts::n_null > 0) {
 6473|    384|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|    384|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|    384|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 384]
  ------------------
 6476|    384|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|    384|                  return;
 6478|    384|               }
 6479|      0|               break; // Fall through to try other types
 6480|  48.4k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 48.4k, False: 582k]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|  48.4k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 127, False: 48.2k]
  |  Branch (6482:41): [True: 42.9k, False: 5.32k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|  43.0k|                  if constexpr (counts::n_array > 0) {
 6485|  43.0k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|  43.0k|                                                                                                    end);
 6487|  43.0k|                     return;
 6488|  43.0k|                  }
 6489|  43.0k|               }
 6490|  48.4k|               if constexpr (counts::n_num > 0) {
 6491|  48.4k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 5.32k, False: 43.0k]
  |  Branch (6491:43): [True: 577, False: 4.75k]
  |  Branch (6491:94): [True: 385, False: 4.36k]
  ------------------
 6492|    962|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|    962|                     return;
 6494|    962|                  }
 6495|  48.4k|               }
 6496|  47.4k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|  48.4k|               return;
 6498|  1.99k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 1.99k, False: 628k]
  ------------------
 6499|  7.01k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 5.01k, False: 625k]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  7.01k|               if constexpr (counts::n_num > 0) {
 6503|  7.01k|                  auto start_it = it;
 6504|  7.01k|                  auto temp_ctx = ctx.make_speculative();
 6505|  7.01k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  7.01k|                                                                                               end);
 6507|  7.01k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  7.01k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  7.01k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 1.28k, False: 5.73k]
  ------------------
 6510|  1.28k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  1.28k|                     return; // Successfully parsed as number
 6512|  1.28k|                  }
 6513|  5.73k|                  it = start_it; // Restore and fall through to string
 6514|  5.73k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  7.01k|               return;
 6517|   163k|            default:
  ------------------
  |  Branch (6517:13): [True: 163k, False: 466k]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|   163k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 125k, False: 38.2k]
  |  Branch (6519:32): [True: 38.9k, False: 86.6k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|  38.9k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 26.2k, False: 12.6k]
  ------------------
 6522|  26.2k|                     return;
 6523|  26.2k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|  12.6k|                  if constexpr (counts::n_num > 0) {
 6526|  12.6k|                     auto start_it = it;
 6527|  12.6k|                     auto temp_ctx = ctx.make_speculative();
 6528|  12.6k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|  12.6k|                                                                                                  end);
 6530|  12.6k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|  12.6k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|  12.6k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 1.72k, False: 10.9k]
  ------------------
 6533|  1.72k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|  1.72k|                        return; // Successfully parsed as number
 6535|  1.72k|                     }
 6536|  10.9k|                     it = start_it; // Restore and fall through to string
 6537|  10.9k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|  12.6k|                  return;
 6541|  38.9k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   124k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   124k|               return;
 6545|   630k|            }
 6546|   630k|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|   630k|         error_code expansion_error{};
 6556|   630k|         std::string_view expansion_message{};
 6557|       |
 6558|   630k|         auto try_parse = [&]<size_t I>() -> bool {
 6559|   630k|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|   630k|            auto start = it;
 6561|       |
 6562|   630k|            V v{};
 6563|   630k|            auto temp_ctx = ctx.make_speculative();
 6564|   630k|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|   630k|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|   630k|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|   630k|            if (!bool(temp_ctx.error)) {
 6569|   630k|               value = std::move(v);
 6570|   630k|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|   630k|               return true;
 6572|   630k|            }
 6573|       |
 6574|   630k|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|   630k|               expansion_error = temp_ctx.error;
 6576|   630k|               expansion_message = temp_ctx.custom_error_message;
 6577|   630k|            }
 6578|   630k|            it = start;
 6579|   630k|            return false;
 6580|   630k|         };
 6581|       |
 6582|   630k|         bool parsed = false;
 6583|   630k|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|   630k|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|   630k|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|   630k|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 630k]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|   630k|      }
_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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   297k|      {
 5206|   297k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   297k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   297k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   297k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   297k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 297k, False: 0]
  ------------------
 5216|   297k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   297k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4515|   297k|      {
 4516|   297k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 297k]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|   297k|         yaml::node_preamble_state preamble{};
 4520|   297k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 798, False: 296k]
  ------------------
 4521|   297k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|    798|            return;
 4523|       |
 4524|   296k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|   296k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|   296k|         std::remove_cvref_t<T> preexisting_entries;
 4538|   296k|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 296k]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|   296k|         struct merge_restore_guard
 4543|   296k|         {
 4544|   296k|            std::remove_cvref_t<T>& target;
 4545|   296k|            std::remove_cvref_t<T>& saved;
 4546|   296k|            ~merge_restore_guard()
 4547|   296k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   296k|               for (auto& entry : saved) {
 4551|   296k|                  target.emplace(entry.first, std::move(entry.second));
 4552|   296k|               }
 4553|   296k|            }
 4554|   296k|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|   296k|         const bool treat_as_block_mapping =
 4557|   296k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [True: 296k, Folded]
  |  Branch (4557:48): [True: 25.2k, False: 271k]
  |  Branch (4557:62): [True: 298, False: 24.9k]
  ------------------
 4558|       |
 4559|   296k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 25.2k, False: 271k]
  |  Branch (4559:28): [True: 24.9k, False: 298]
  ------------------
 4560|       |            // Flow mapping
 4561|  24.9k|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|  24.9k|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|  24.9k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 24.8k, False: 68]
  |  Branch (4565:30): [True: 1.43k, False: 23.4k]
  ------------------
 4566|  1.43k|               ++it;
 4567|  1.43k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  1.43k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 8, False: 1.42k]
  ------------------
 4569|      8|                  return;
 4570|  1.42k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  1.42k|               return;
 4572|  1.43k|            }
 4573|       |
 4574|   185k|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 184k, False: 1.52k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|   184k|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|   184k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 184k, False: 0]
  |  Branch (4578:33): [True: 889, False: 183k]
  ------------------
 4579|    889|                  ++it;
 4580|    889|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|    889|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 18, False: 871]
  ------------------
 4582|     18|                     return;
 4583|    871|                  break;
 4584|    889|               }
 4585|       |
 4586|   183k|               bool explicit_flow_key = false;
 4587|   183k|               auto explicit_probe = it;
 4588|   183k|               yaml::skip_inline_ws(explicit_probe, end);
 4589|   183k|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 183k, False: 0]
  |  Branch (4589:45): [True: 21.1k, False: 162k]
  ------------------
 4590|  21.1k|                  const auto after_q = explicit_probe + 1;
 4591|  21.1k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 1, False: 21.1k]
  |  Branch (4591:41): [True: 3.25k, False: 17.8k]
  ------------------
 4592|  17.8k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 13.8k, False: 3.98k]
  |  Branch (4592:42): [True: 496, False: 3.49k]
  ------------------
 4593|  17.6k|                     explicit_flow_key = true;
 4594|  17.6k|                     it = explicit_probe + 1;
 4595|  17.6k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  17.6k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 2, False: 17.6k]
  ------------------
 4597|      2|                        return;
 4598|  17.6k|                  }
 4599|  21.1k|               }
 4600|       |               // Parse key
 4601|   183k|               key_t key{};
 4602|   183k|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|   183k|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 17.6k, False: 165k]
  |  Branch (4603:44): [True: 17.6k, False: 2]
  |  Branch (4603:58): [True: 271, False: 17.3k]
  |  Branch (4603:72): [True: 13.8k, False: 3.47k]
  |  Branch (4603:86): [True: 503, False: 2.96k]
  ------------------
 4604|  14.6k|                     key.clear();
 4605|  14.6k|                  }
 4606|   168k|                  else {
 4607|   168k|                     auto key_probe = it;
 4608|   168k|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|   168k|                     bool parse_complex_flow_key = false;
 4613|   168k|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 168k, False: 2]
  ------------------
 4614|   168k|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 597, False: 168k]
  |  Branch (4614:50): [True: 2.46k, False: 165k]
  ------------------
 4615|  3.05k|                           parse_complex_flow_key = true;
 4616|  3.05k|                        }
 4617|   165k|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 19.0k, False: 146k]
  ------------------
 4618|  19.0k|                           ++key_probe;
 4619|  19.0k|                           yaml::parse_anchor_name(key_probe, end);
 4620|  19.0k|                           yaml::skip_inline_ws(key_probe, end);
 4621|  19.0k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 18.9k, False: 34]
  |  Branch (4621:53): [True: 313, False: 18.6k]
  |  Branch (4621:74): [True: 231, False: 18.4k]
  ------------------
 4622|    544|                              parse_complex_flow_key = true;
 4623|    544|                           }
 4624|  19.0k|                        }
 4625|   168k|                     }
 4626|       |
 4627|   168k|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 3.60k, False: 165k]
  ------------------
 4628|  3.60k|                        glz::generic key_node{};
 4629|  3.60k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|  3.60k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 603, False: 3.00k]
  ------------------
 4631|    603|                           return;
 4632|  3.00k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 1, False: 2.99k]
  ------------------
 4633|      1|                           return;
 4634|  3.00k|                     }
 4635|   165k|                     else {
 4636|   165k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 497, False: 164k]
  ------------------
 4637|    497|                           return;
 4638|    497|                        }
 4639|   165k|                     }
 4640|   168k|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|   182k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|   183k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 16, False: 183k]
  ------------------
 4656|     16|                  return;
 4657|       |
 4658|   183k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|   183k|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|   183k|                     val = {};
 4661|   183k|                     return true;
 4662|   183k|                  }
 4663|   183k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   183k|                     val = glz::generic{};
 4665|   183k|                     return true;
 4666|   183k|                  }
 4667|   183k|                  else {
 4668|   183k|                     static constexpr std::string_view null_value{"null"};
 4669|   183k|                     auto null_it = null_value.data();
 4670|   183k|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|   183k|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|   183k|                     return !bool(ctx.error);
 4673|   183k|                  }
 4674|   183k|               };
 4675|       |
 4676|   183k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 181k, False: 2.09k]
  |  Branch (4676:34): [True: 140k, False: 40.4k]
  |  Branch (4676:48): [True: 5.37k, False: 35.1k]
  ------------------
 4677|   146k|                  val_t val{};
 4678|   146k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 146k]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|   146k|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|   146k|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 5.37k, False: 140k]
  ------------------
 4684|  5.37k|                     ++it;
 4685|  5.37k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  5.37k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 27, False: 5.34k]
  ------------------
 4687|     27|                        return;
 4688|  5.34k|                     break;
 4689|  5.37k|                  }
 4690|       |
 4691|   140k|                  ++it; // skip comma
 4692|   140k|                  yaml::skip_ws_and_newlines(it, end);
 4693|   140k|                  continue;
 4694|   146k|               }
 4695|       |
 4696|  37.2k|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 2.09k, False: 35.1k]
  |  Branch (4696:33): [True: 135, False: 34.9k]
  ------------------
 4697|  1.12k|                  ctx.error = error_code::syntax_error;
 4698|  1.12k|                  return;
 4699|  1.12k|               }
 4700|  36.0k|               ++it;
 4701|       |
 4702|  36.0k|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  36.0k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 7, False: 36.0k]
  ------------------
 4704|      7|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  36.0k|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 34.9k, False: 1.10k]
  |  Branch (4707:34): [True: 2.24k, False: 32.7k]
  |  Branch (4707:48): [True: 11.4k, False: 21.3k]
  ------------------
 4708|  13.6k|                  val_t val{};
 4709|  13.6k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 13.6k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|  13.6k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|  13.6k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 11.4k, False: 2.24k]
  ------------------
 4715|  11.4k|                     ++it;
 4716|  11.4k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  11.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 6, False: 11.4k]
  ------------------
 4718|      6|                        return;
 4719|  11.4k|                     break;
 4720|  11.4k|                  }
 4721|       |
 4722|  2.24k|                  ++it; // skip comma
 4723|  2.24k|                  yaml::skip_ws_and_newlines(it, end);
 4724|  2.24k|                  continue;
 4725|  13.6k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  22.4k|               val_t val{};
 4729|  22.4k|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  22.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 238, False: 22.1k]
  ------------------
 4731|    238|                  return;
 4732|       |
 4733|  22.1k|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  22.1k|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  22.1k|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 20.6k, False: 1.55k]
  |  Branch (4737:33): [True: 1.10k, False: 19.5k]
  ------------------
 4738|  1.10k|                  ++it;
 4739|  1.10k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|  1.10k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 17, False: 1.08k]
  ------------------
 4741|     17|                     return;
 4742|  1.08k|                  break;
 4743|  1.10k|               }
 4744|  21.0k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 19.5k, False: 1.55k]
  |  Branch (4744:38): [True: 17.8k, False: 1.63k]
  ------------------
 4745|  17.8k|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|  17.8k|                  yaml::skip_ws_and_newlines(it, end);
 4748|  17.8k|               }
 4749|  3.19k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 1.63k, False: 1.55k]
  |  Branch (4749:39): [True: 1.48k, False: 155]
  |  Branch (4749:54): [True: 88, False: 67]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|  1.57k|                  yaml::skip_ws_and_newlines(it, end);
 4753|  1.57k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 1.57k, False: 1]
  |  Branch (4753:36): [True: 152, False: 1.41k]
  ------------------
 4754|    152|                     ++it;
 4755|    152|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|    152|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 2, False: 150]
  ------------------
 4757|      2|                        return;
 4758|    150|                     break;
 4759|    152|                  }
 4760|  1.42k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 1.41k, False: 1]
  |  Branch (4760:36): [True: 1.40k, False: 11]
  ------------------
 4761|  1.40k|                     ++it;
 4762|  1.40k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  1.40k|                     continue;
 4764|  1.40k|                  }
 4765|     12|                  ctx.error = error_code::syntax_error;
 4766|     12|                  return;
 4767|  1.42k|               }
 4768|  1.62k|               else {
 4769|  1.62k|                  ctx.error = error_code::syntax_error;
 4770|  1.62k|                  return;
 4771|  1.62k|               }
 4772|  22.1k|            }
 4773|  23.4k|         }
 4774|   271k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   271k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   271k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   271k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   271k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   271k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   271k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   271k|                           if (ctx.stream_begin) {
 4788|   271k|                              auto is_line_content_start = [&](auto pos) {
 4789|   271k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   271k|                              };
 4791|       |
 4792|   271k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   271k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   271k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   271k|                                 return line != end && *line == ':';
 4796|   271k|                              };
 4797|       |
 4798|   271k|                              if (!is_line_content_start(it) &&
 4799|   271k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   271k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   271k|                                 ctx.error = error_code::syntax_error;
 4802|   271k|                                 return false;
 4803|   271k|                              }
 4804|   271k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   271k|                           }
 4806|   271k|                        }
 4807|       |
 4808|   271k|                        if (*it == '-' &&
 4809|   271k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   271k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   271k|                           ctx.error = error_code::syntax_error;
 4813|   271k|                           return false;
 4814|   271k|                        }
 4815|       |
 4816|   271k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   271k|                           return false;
 4818|   271k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   271k|                        ctx.pop_indent();
 4820|   271k|                     }
 4821|   271k|                     else {
 4822|   271k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   271k|                        if (nested_indent >= 0) {
 4824|   271k|                           yaml::skip_to_content(it, end);
 4825|   271k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   271k|                              ctx.error = error_code::syntax_error;
 4827|   271k|                              return false;
 4828|   271k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   271k|                           const int32_t value_indent =
 4832|   271k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   271k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   271k|                              return false;
 4835|   271k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   271k|                           ctx.pop_indent();
 4837|   271k|                        }
 4838|   271k|                     }
 4839|   271k|                     return !bool(ctx.error);
 4840|   271k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   271k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   271k|                     ctx.error = error_code::syntax_error;
 4847|   271k|                     return false;
 4848|   271k|                  }
 4849|   271k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   271k|                     ++it; // skip '?'
 4851|   271k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   271k|                     const int32_t explicit_value_indicator_indent =
 4854|   271k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   271k|                     key_t key{};
 4857|   271k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   271k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   271k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   271k|                        };
 4861|       |
 4862|   271k|                        auto key_it = it;
 4863|   271k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   271k|                        auto content = key_it;
 4866|   271k|                        yaml::skip_to_content(content, end);
 4867|   271k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   271k|                        if (content != end && *content == '&') {
 4873|   271k|                           auto anchor_probe = content + 1;
 4874|   271k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   271k|                           if (!anchor_name.empty()) {
 4876|   271k|                              auto after_anchor = anchor_probe;
 4877|   271k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   271k|                              auto value_indicator = after_anchor;
 4880|   271k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   271k|                                 key.clear();
 4882|   271k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   271k|                                 it = value_indicator;
 4884|   271k|                                 handled_anchor_only_empty_key = true;
 4885|   271k|                              }
 4886|   271k|                              else {
 4887|   271k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   271k|                                    yaml::skip_comment(value_indicator, end);
 4889|   271k|                                 }
 4890|   271k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   271k|                                    yaml::skip_newline(value_indicator, end);
 4892|   271k|                                    auto value_line = value_indicator;
 4893|   271k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   271k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   271k|                                       return false;
 4896|   271k|                                    if (value_line != end && *value_line == ':' &&
 4897|   271k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   271k|                                       key.clear();
 4899|   271k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   271k|                                       it = value_line;
 4901|   271k|                                       handled_anchor_only_empty_key = true;
 4902|   271k|                                    }
 4903|   271k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   271k|                                       ctx.error = error_code::syntax_error;
 4908|   271k|                                       return false;
 4909|   271k|                                    }
 4910|   271k|                                 }
 4911|   271k|                              }
 4912|   271k|                           }
 4913|   271k|                        }
 4914|       |
 4915|   271k|                        const bool key_content_spans_lines = [&] {
 4916|   271k|                           auto scan = key_it;
 4917|   271k|                           while (scan != content && scan != end) {
 4918|   271k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   271k|                              ++scan;
 4920|   271k|                           }
 4921|   271k|                           return false;
 4922|   271k|                        }();
 4923|       |
 4924|   271k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   271k|                        }
 4927|   271k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   271k|                           key.clear();
 4929|   271k|                           it = content;
 4930|   271k|                        }
 4931|   271k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   271k|                           auto key_node_it = content;
 4937|   271k|                           auto key_node_end = end;
 4938|   271k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   271k|                              auto scan = content;
 4943|   271k|                              while (scan != end) {
 4944|   271k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   271k|                                    ++scan;
 4946|   271k|                                 }
 4947|   271k|                                 if (scan == end) {
 4948|   271k|                                    break;
 4949|   271k|                                 }
 4950|       |
 4951|   271k|                                 yaml::skip_newline(scan, end);
 4952|   271k|                                 auto line_start = scan;
 4953|       |
 4954|   271k|                                 int32_t indicator_indent = 0;
 4955|   271k|                                 while (scan != end && *scan == ' ') {
 4956|   271k|                                    ++indicator_indent;
 4957|   271k|                                    ++scan;
 4958|   271k|                                 }
 4959|       |
 4960|   271k|                                 if (scan != end && *scan == ':') {
 4961|   271k|                                    const auto after_colon = scan + 1;
 4962|   271k|                                    if ((after_colon == end ||
 4963|   271k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   271k|                                        indicator_indent <= line_indent) {
 4965|   271k|                                       key_node_end = line_start;
 4966|   271k|                                       break;
 4967|   271k|                                    }
 4968|   271k|                                 }
 4969|   271k|                              }
 4970|   271k|                           }
 4971|       |
 4972|   271k|                           glz::generic key_node{};
 4973|   271k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   271k|                           ctx.explicit_mapping_key_context = true;
 4975|   271k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   271k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   271k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   271k|                              return false;
 4979|   271k|                           it = key_node_it;
 4980|   271k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   271k|                              return false;
 4982|   271k|                        }
 4983|   271k|                     }
 4984|   271k|                     else {
 4985|   271k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   271k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   271k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   271k|                              return false;
 4989|   271k|                        }
 4990|   271k|                     }
 4991|       |
 4992|   271k|                     yaml::skip_inline_ws(it, end);
 4993|   271k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   271k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   271k|                        auto probe = it;
 4998|   271k|                        bool found_value_indicator = false;
 4999|       |
 5000|   271k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   271k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   271k|                           auto value_line = probe;
 5004|   271k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   271k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   271k|                              return false;
 5007|       |
 5008|   271k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   271k|                              probe = value_line;
 5010|   271k|                              continue; // blank line
 5011|   271k|                           }
 5012|   271k|                           if (*value_line == '#') {
 5013|   271k|                              yaml::skip_comment(value_line, end);
 5014|   271k|                              probe = value_line;
 5015|   271k|                              continue; // comment-only line
 5016|   271k|                           }
 5017|   271k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   271k|                              it = value_line;
 5019|   271k|                              found_value_indicator = true;
 5020|   271k|                           }
 5021|   271k|                           break;
 5022|   271k|                        }
 5023|       |
 5024|   271k|                        if (found_value_indicator) {
 5025|   271k|                           yaml::skip_inline_ws(it, end);
 5026|   271k|                        }
 5027|   271k|                     }
 5028|       |
 5029|   271k|                     val_t val{};
 5030|   271k|                     if (it != end && *it == ':') {
 5031|   271k|                        ++it;
 5032|   271k|                        if (it != end && *it == '\t') {
 5033|   271k|                           ctx.error = error_code::syntax_error;
 5034|   271k|                           return false;
 5035|   271k|                        }
 5036|   271k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   271k|                           auto probe = it;
 5038|   271k|                           yaml::skip_newline(probe, end);
 5039|   271k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   271k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   271k|                              ctx.error = error_code::syntax_error;
 5042|   271k|                              return false;
 5043|   271k|                           }
 5044|   271k|                        }
 5045|   271k|                        yaml::skip_inline_ws(it, end);
 5046|   271k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   271k|                           return false;
 5048|   271k|                     }
 5049|       |
 5050|   271k|                     value.emplace(std::move(key), std::move(val));
 5051|   271k|                     return true;
 5052|   271k|                  }
 5053|       |
 5054|   271k|                  key_t key{};
 5055|   271k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   271k|                     auto key_probe = it;
 5057|   271k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   271k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   271k|                     if (complex_flow_key) {
 5060|   271k|                        glz::generic key_node{};
 5061|   271k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   271k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   271k|                           return false;
 5064|   271k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   271k|                           return false;
 5066|   271k|                     }
 5067|   271k|                     else {
 5068|   271k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   271k|                           return false;
 5070|   271k|                        }
 5071|   271k|                     }
 5072|   271k|                  }
 5073|   271k|                  else {
 5074|   271k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   271k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   271k|                        return false;
 5077|   271k|                  }
 5078|       |
 5079|   271k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   271k|                  if (it == end || *it != ':') {
 5082|   271k|                     ctx.error = error_code::syntax_error;
 5083|   271k|                     return false;
 5084|   271k|                  }
 5085|   271k|                  ++it;
 5086|   271k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   271k|                  val_t val{};
 5089|   271k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   271k|                     return false;
 5091|       |
 5092|   271k|                  value.emplace(std::move(key), std::move(val));
 5093|   271k|                  return true;
 5094|   271k|               });
 5095|   271k|         }
 5096|       |
 5097|   292k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|   292k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   297k|      {
  466|   297k|         skip_inline_ws(it, end);
  467|       |
  468|   297k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 0, False: 297k]
  ------------------
  469|      0|            if constexpr (!AllowEmptyInput) {
  470|      0|               ctx.error = error_code::unexpected_end;
  471|      0|            }
  472|      0|            return true;
  473|      0|         }
  474|       |
  475|   297k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   297k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 297k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|   297k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 297k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   297k|         skip_inline_ws(it, end);
  486|       |
  487|   297k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 4, False: 297k]
  ------------------
  488|      4|            if constexpr (!AllowEmptyInput) {
  489|      4|               ctx.error = error_code::unexpected_end;
  490|      4|            }
  491|      4|            return true;
  492|      4|         }
  493|       |
  494|   297k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 790, False: 296k]
  ------------------
  495|    790|            return true;
  496|    790|         }
  497|       |
  498|   296k|         return false;
  499|   297k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESN_:
 4521|   297k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   297k|      {
  409|   297k|         state.has_anchor = false;
  410|   297k|         state.anchor_name.clear();
  411|   297k|         state.anchor_start = nullptr;
  412|   297k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   297k|         if constexpr (Policy.allow_alias) {
  415|   297k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   297k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 292k, False: 4.82k]
  ------------------
  417|   292k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 781, False: 291k]
  ------------------
  418|   292k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   297k|         }
  424|       |
  425|   297k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 296k, False: 781]
  |  Branch (425:27): [True: 17.5k, False: 279k]
  ------------------
  426|  17.5k|            ++it;
  427|  17.5k|            auto name = parse_anchor_name(it, end);
  428|  17.5k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 7, False: 17.5k]
  ------------------
  429|      7|               ctx.error = error_code::syntax_error;
  430|      7|               return true;
  431|      7|            }
  432|  17.5k|            skip_inline_ws(it, end);
  433|  17.5k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 2, False: 17.5k]
  ------------------
  434|      2|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|      2|                  ctx.error = error_code::unexpected_end;
  436|      2|               }
  437|      2|               return true;
  438|      2|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|  17.5k|            state.has_anchor = true;
  446|  17.5k|            state.anchor_name = std::string(name);
  447|  17.5k|            state.anchor_start = &*it;
  448|  17.5k|         }
  449|       |
  450|   297k|         return false;
  451|   297k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   292k|      {
  301|   292k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 292k]
  |  Branch (301:27): [True: 291k, False: 781]
  ------------------
  302|       |
  303|    781|         ++it; // skip '*'
  304|    781|         auto name = parse_anchor_name(it, end);
  305|    781|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 3, False: 778]
  ------------------
  306|      3|            ctx.error = error_code::syntax_error;
  307|      3|            return true;
  308|      3|         }
  309|       |
  310|    778|         auto anchor_it = ctx.anchors.find(name);
  311|    778|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 52, False: 726]
  ------------------
  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|    726|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|    726|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 350, False: 376]
  ------------------
  322|    350|            return true;
  323|    350|         }
  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|    376|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 10, False: 366]
  ------------------
  329|     10|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     10|            return true;
  331|     10|         }
  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|    366|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    366|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 366]
  ------------------
  339|      0|            return true;
  340|       |
  341|    366|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 366]
  ------------------
  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|    366|         auto replay_it = span.begin;
  348|    366|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    366|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    366|         ctx.indent_stack.clear();
  353|    366|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 306, False: 60]
  ------------------
  354|    306|            ctx.push_indent(span.base_indent - 1);
  355|    306|         }
  356|       |
  357|    366|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    366|         using V = std::remove_cvref_t<T>;
  360|    366|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    366|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    366|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    366|         return true;
  367|    366|      }
_ZN3glz4fromILj450ENS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERS4_TkNS_10is_contextERNS7_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_:
  274|  2.16M|      {
  275|  2.16M|         using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
  276|  2.16M|         from<YAML, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
  277|  2.16M|                                          std::forward<Ctx>(ctx), std::forward<It0>(it), end);
  278|  2.16M|      }
_ZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_:
 5635|  3.28M|      {
 5636|       |         // Inside op() rather than at class scope: read_supported is `requires { from<Format, T>{}; }`,
 5637|       |         // so a class-scope assert turns that feature probe into a hard error instead of `false`.
 5638|  3.28M|         static_assert(content_v<std::remove_cvref_t<T>>.empty(),
 5639|  3.28M|                       "Adjacent variant tagging (glz::meta `content`) is implemented for JSON and "
 5640|  3.28M|                       "BEVE but not yet for YAML. Reading this variant as YAML would silently expect "
 5641|  3.28M|                       "the internally tagged shape, so it is rejected here instead.");
 5642|  3.28M|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5642:14): [True: 0, False: 3.28M]
  ------------------
 5643|      0|            return;
 5644|       |
 5645|       |         // Every nested generic/variant value routes back through this reader, so bounding
 5646|       |         // depth here caps flow-collection and flow-embedded mapping recursion that the
 5647|       |         // indent stack does not cover.
 5648|  3.28M|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
 5649|  3.28M|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (5649:14): [True: 32, False: 3.28M]
  ------------------
 5650|     32|            return;
 5651|       |
 5652|       |         // At root level (indent == -1), skip leading whitespace, newlines, and comments
 5653|       |         // For nested values, only skip inline whitespace to preserve block structure
 5654|  3.28M|         if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5654:14): [True: 2.55M, False: 730k]
  ------------------
 5655|  2.55M|            yaml::skip_ws_newlines_comments(it, end);
 5656|  2.55M|         }
 5657|   730k|         else {
 5658|   730k|            yaml::skip_inline_ws(it, end);
 5659|   730k|         }
 5660|       |
 5661|  3.28M|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (5661:14): [True: 41, False: 3.28M]
  ------------------
 5662|     41|            ctx.error = error_code::unexpected_end;
 5663|     41|            return;
 5664|     41|         }
 5665|       |
 5666|       |         // Tagged variants: a discriminator key (meta::tag) selects the alternative, with the
 5667|       |         // matching meta::ids entry naming each type. This mirrors the JSON behavior so the
 5668|       |         // same variant definitions round-trip across both formats.
 5669|       |         if constexpr (not tag_v<std::remove_cvref_t<T>>.empty()) {
 5670|       |            using V = std::remove_cvref_t<T>;
 5671|       |            const bool value_is_mapping =
 5672|       |               (*it == '{') || (!yaml::check_flow_context(Opts) && yaml::line_could_be_block_mapping(it, end));
 5673|       |            if (value_is_mapping) {
 5674|       |               // The mapping's keys sit at the column of `it`. Recover that column from the buffer:
 5675|       |               // the indent stack carries the parent context's indent (a struct member, a sequence
 5676|       |               // item, etc. each push a different offset), not this mapping's true column (see helper).
 5677|       |               const int32_t mapping_column = tagged_mapping_visual_indent(ctx, it, ctx.current_indent() + 1);
 5678|       |               auto tag_ctx = ctx.make_speculative();
 5679|       |               const size_t index = scan_variant_tag_index<V, Opts>(tag_ctx, it, end, mapping_column);
 5680|       |               ctx.alias_expansion_budget = tag_ctx.alias_expansion_budget; // charged even if no tag matched
 5681|       |               ctx.key_expansion_budget = tag_ctx.key_expansion_budget;
 5682|       |               if (index < ids_v<V>.size()) {
 5683|       |                  static constexpr auto tag_literal = string_literal_from_view<tag_v<V>.size()>(tag_v<V>);
 5684|       |                  emplace_runtime_variant(value, index);
 5685|       |                  // Establish the mapping's true column on the indent stack for the alternative parse.
 5686|       |                  // The chosen object is then parsed - and the discriminator's inline value skipped -
 5687|       |                  // at a consistent indent in every context, so a tag on the first key does not fold
 5688|       |                  // the following sibling entries into its value (no special-casing needed downstream).
 5689|       |                  if (!ctx.push_indent(mapping_column)) [[unlikely]] {
 5690|       |                     ctx.error = error_code::exceeded_max_recursive_depth;
 5691|       |                     return;
 5692|       |                  }
 5693|       |                  std::visit(
 5694|       |                     [&](auto&& alt) {
 5695|       |                        using Alt = std::remove_cvref_t<decltype(alt)>;
 5696|       |                        if constexpr ((glaze_object_t<Alt> || reflectable<Alt>) && not custom_read<Alt>) {
 5697|       |                           // Parse the mapping into the resolved struct; the tag key is skipped.
 5698|       |                           from<YAML, Alt>::template op<Opts, tag_literal>(alt, ctx, it, end);
 5699|       |                        }
 5700|       |                        else if constexpr (custom_read<Alt>) {
 5701|       |                           // Custom alternatives read the mapping body themselves and cannot skip an
 5702|       |                           // interior tag key the way reflected objects do, so the tag must be the
 5703|       |                           // first key (glaze always writes it first). Consume that leading "tag: id"
 5704|       |                           // entry, then hand the remaining mapping to the custom handler.
 5705|       |                           if constexpr (yaml::check_flow_context(Opts)) {
 5706|       |                              ctx.error = error_code::feature_not_supported;
 5707|       |                              ctx.custom_error_message =
 5708|       |                                 "custom variant alternatives are not supported in YAML flow style";
 5709|       |                           }
 5710|       |                           else {
 5711|       |                              ctx.scratch.clear();
 5712|       |                              if (yaml::parse_yaml_key(ctx.scratch, ctx, it, end, false)) {
 5713|       |                                 if (std::string_view{ctx.scratch} != tag_v<V>) {
 5714|       |                                    ctx.error = error_code::feature_not_supported;
 5715|       |                                    ctx.custom_error_message =
 5716|       |                                       "the tag must be the first key for a custom variant alternative";
 5717|       |                                 }
 5718|       |                                 else {
 5719|       |                                    yaml::skip_inline_ws(it, end);
 5720|       |                                    if (it == end || *it != ':') {
 5721|       |                                       ctx.error = error_code::syntax_error;
 5722|       |                                    }
 5723|       |                                    else {
 5724|       |                                       ++it;
 5725|       |                                       yaml::skip_inline_ws(it, end);
 5726|       |                                       yaml::skip_unknown_block_value<Opts>(ctx, it, end, mapping_column);
 5727|       |                                       if (!bool(ctx.error)) {
 5728|       |                                          // If nothing but trailing whitespace/comments remains, the tag
 5729|       |                                          // was the whole mapping: leave the alternative default.
 5730|       |                                          auto probe = it;
 5731|       |                                          yaml::skip_ws_newlines_comments(probe, end);
 5732|       |                                          if (probe == end) {
 5733|       |                                             it = probe;
 5734|       |                                          }
 5735|       |                                          else {
 5736|       |                                             // Publish the mapping's column so the custom handler's block
 5737|       |                                             // mapping (which would otherwise discover its own indent) reads
 5738|       |                                             // the remaining entries at the variant's indent and dedents
 5739|       |                                             // correctly in every context (root, sequence, nested).
 5740|       |                                             ctx.forced_block_mapping_indent = mapping_column;
 5741|       |                                             from<YAML, Alt>::template op<Opts>(alt, ctx, it, end);
 5742|       |                                             ctx.forced_block_mapping_indent = -1;
 5743|       |                                          }
 5744|       |                                       }
 5745|       |                                    }
 5746|       |                                 }
 5747|       |                              }
 5748|       |                           }
 5749|       |                        }
 5750|       |                        else {
 5751|       |                           // Non-object alternative (e.g. std::monostate): the emplaced default is
 5752|       |                           // the value, but the mapping must still be consumed.
 5753|       |                           walk_tagged_mapping<Opts>(
 5754|       |                              ctx, it, end, tag_v<V>, mapping_column,
 5755|       |                              [&](auto&& c, auto&& i, auto&& e, int32_t line_indent, bool in_flow) {
 5756|       |                                 yaml::skip_yaml_value<Opts>(c, i, e, in_flow ? 0 : line_indent, in_flow);
 5757|       |                              });
 5758|       |                        }
 5759|       |                     },
 5760|       |                     value);
 5761|       |                  ctx.pop_indent();
 5762|       |                  return;
 5763|       |               }
 5764|       |               // No resolvable tag key was found. Fall through to structural deduction:
 5765|       |               // if the alternatives are distinguishable by their fields this still succeeds,
 5766|       |               // otherwise the deduction path reports no_matching_variant_type.
 5767|       |            }
 5768|       |         }
 5769|       |
 5770|  3.28M|         if constexpr (yaml_variant_is_auto_deducible<std::remove_cvref_t<T>>()) {
 5771|  3.28M|            using V = std::remove_cvref_t<T>;
 5772|  3.28M|            using counts = yaml_variant_type_count<V>;
 5773|  3.28M|            const char c = *it;
 5774|  3.28M|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  3.28M|               switch (ch) {
 5776|  3.28M|               case ' ':
 5777|  3.28M|               case '\t':
 5778|  3.28M|               case '\n':
 5779|  3.28M|               case '\r':
 5780|  3.28M|               case ',':
 5781|  3.28M|               case ']':
 5782|  3.28M|               case '}':
 5783|  3.28M|                  return true;
 5784|  3.28M|               default:
 5785|  3.28M|                  return false;
 5786|  3.28M|               }
 5787|  3.28M|            };
 5788|       |
 5789|  3.28M|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  3.28M|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  3.28M|                  return false;
 5792|  3.28M|               }
 5793|  3.28M|               if (ctx.current_indent() < 0) {
 5794|  3.28M|                  return false;
 5795|  3.28M|               }
 5796|  3.28M|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
 5797|  3.28M|                  return false;
 5798|  3.28M|               }
 5799|       |
 5800|  3.28M|               auto look = word_end;
 5801|  3.28M|               yaml::skip_newline(look, end);
 5802|  3.28M|               while (look != end) {
 5803|  3.28M|                  int32_t line_indent = 0;
 5804|  3.28M|                  while (look != end && *look == ' ') {
 5805|  3.28M|                     ++line_indent;
 5806|  3.28M|                     ++look;
 5807|  3.28M|                  }
 5808|  3.28M|                  if (look != end && *look == '\t') {
 5809|  3.28M|                     return false;
 5810|  3.28M|                  }
 5811|  3.28M|                  if (look == end || *look == '\n' || *look == '\r') {
 5812|  3.28M|                     if (look != end) {
 5813|  3.28M|                        yaml::skip_newline(look, end);
 5814|  3.28M|                        continue;
 5815|  3.28M|                     }
 5816|  3.28M|                     return false;
 5817|  3.28M|                  }
 5818|  3.28M|                  if (*look == '#') {
 5819|  3.28M|                     yaml::skip_comment(look, end);
 5820|  3.28M|                     if (look != end && (*look == '\n' || *look == '\r')) {
 5821|  3.28M|                        yaml::skip_newline(look, end);
 5822|  3.28M|                        continue;
 5823|  3.28M|                     }
 5824|  3.28M|                     return false;
 5825|  3.28M|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  3.28M|                  {
 5831|  3.28M|                     auto scan = look;
 5832|  3.28M|                     while (scan != end && *scan != '\n' && *scan != '\r') {
 5833|  3.28M|                        if (*scan == ':') {
 5834|  3.28M|                           auto after_colon = scan + 1;
 5835|  3.28M|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
 5836|  3.28M|                               *after_colon == '\n' || *after_colon == '\r') {
 5837|  3.28M|                              return false;
 5838|  3.28M|                           }
 5839|  3.28M|                        }
 5840|  3.28M|                        ++scan;
 5841|  3.28M|                     }
 5842|  3.28M|                  }
 5843|       |
 5844|  3.28M|                  return line_indent > ctx.current_indent();
 5845|  3.28M|               }
 5846|  3.28M|               return false;
 5847|  3.28M|            };
 5848|  3.28M|            auto is_word_boundary = [&](const auto ptr) {
 5849|  3.28M|               if (ptr == end) {
 5850|  3.28M|                  return true;
 5851|  3.28M|               }
 5852|  3.28M|               if (*ptr == ':') {
 5853|  3.28M|                  auto next = ptr + 1;
 5854|  3.28M|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5855|  3.28M|               }
 5856|  3.28M|               return is_plain_scalar_boundary(*ptr);
 5857|  3.28M|            };
 5858|       |
 5859|  3.28M|            switch (c) {
 5860|   611k|            case '&': {
  ------------------
  |  Branch (5860:13): [True: 611k, False: 2.67M]
  ------------------
 5861|       |               // Anchor before value: parse name, then re-dispatch
 5862|   611k|               ++it;
 5863|   611k|               auto aname = yaml::parse_anchor_name(it, end);
 5864|   611k|               if (aname.empty()) {
  ------------------
  |  Branch (5864:20): [True: 72, False: 611k]
  ------------------
 5865|     72|                  ctx.error = error_code::syntax_error;
 5866|     72|                  return;
 5867|     72|               }
 5868|   611k|               yaml::skip_inline_ws(it, end);
 5869|   611k|               bool anchor_on_same_line = true;
 5870|   611k|               bool value_is_indentless_sequence = false;
 5871|   611k|               if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (5871:20): [True: 2.81k, False: 608k]
  |  Branch (5871:33): [True: 22.2k, False: 585k]
  |  Branch (5871:48): [True: 39.6k, False: 546k]
  |  Branch (5871:63): [True: 9.02k, False: 537k]
  ------------------
 5872|       |                  // Anchor followed by end-of-line. Check if the value continues on the
 5873|       |                  // next line (indented past current context) or if this is an empty node.
 5874|  73.7k|                  bool value_on_next_line = false;
 5875|  73.7k|                  if (it != end) {
  ------------------
  |  Branch (5875:23): [True: 70.9k, False: 2.81k]
  ------------------
 5876|  70.9k|                     auto peek = it;
 5877|       |                     // Skip comment if present
 5878|  70.9k|                     if (*peek == '#') {
  ------------------
  |  Branch (5878:26): [True: 9.02k, False: 61.9k]
  ------------------
 5879|   290k|                        while (peek != end && *peek != '\n' && *peek != '\r') ++peek;
  ------------------
  |  Branch (5879:32): [True: 290k, False: 19]
  |  Branch (5879:47): [True: 287k, False: 3.35k]
  |  Branch (5879:64): [True: 281k, False: 5.65k]
  ------------------
 5880|  9.02k|                     }
 5881|       |                     // Skip newline
 5882|  70.9k|                     if (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5882:26): [True: 70.9k, False: 19]
  |  Branch (5882:42): [True: 25.6k, False: 45.2k]
  |  Branch (5882:59): [True: 45.2k, False: 0]
  ------------------
 5883|  70.9k|                        yaml::skip_newline(peek, end);
 5884|       |                        // Skip blank lines
 5885|  94.6k|                        while (peek != end && (*peek == '\n' || *peek == '\r')) {
  ------------------
  |  Branch (5885:32): [True: 93.2k, False: 1.32k]
  |  Branch (5885:48): [True: 14.1k, False: 79.1k]
  |  Branch (5885:65): [True: 9.51k, False: 69.6k]
  ------------------
 5886|  23.6k|                           yaml::skip_newline(peek, end);
 5887|  23.6k|                        }
 5888|       |                        // Measure indent of next content line
 5889|  70.9k|                        int32_t next_indent = 0;
 5890|   132k|                        while (peek != end && *peek == ' ') {
  ------------------
  |  Branch (5890:32): [True: 130k, False: 1.74k]
  |  Branch (5890:47): [True: 61.2k, False: 69.1k]
  ------------------
 5891|  61.2k|                           ++next_indent;
 5892|  61.2k|                           ++peek;
 5893|  61.2k|                        }
 5894|  70.9k|                        if (peek != end && *peek != '\n' && *peek != '\r') {
  ------------------
  |  Branch (5894:29): [True: 69.1k, False: 1.74k]
  |  Branch (5894:44): [True: 66.5k, False: 2.67k]
  |  Branch (5894:61): [True: 65.7k, False: 801]
  ------------------
 5895|  65.7k|                           const bool indentless_sequence =
 5896|  65.7k|                              (!ctx.sequence_item_value_context) && (*peek == '-') &&
  ------------------
  |  Branch (5896:31): [True: 64.1k, False: 1.55k]
  |  Branch (5896:69): [True: 28.9k, False: 35.2k]
  ------------------
 5897|  28.9k|                              ((peek + 1) == end ||
  ------------------
  |  Branch (5897:32): [True: 364, False: 28.5k]
  ------------------
 5898|  28.5k|                               yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(peek + 1))]) &&
  ------------------
  |  Branch (5898:32): [True: 27.8k, False: 733]
  ------------------
 5899|  28.1k|                              (next_indent == ctx.current_indent() ||
  ------------------
  |  Branch (5899:32): [True: 1.45k, False: 26.7k]
  ------------------
 5900|  26.7k|                               (ctx.current_indent() > 0 && (next_indent + 1) == ctx.current_indent()));
  ------------------
  |  Branch (5900:33): [True: 1.82k, False: 24.9k]
  |  Branch (5900:61): [True: 1.61k, False: 214]
  ------------------
 5901|  65.7k|                           value_is_indentless_sequence = indentless_sequence;
 5902|  65.7k|                           const bool same_indent_property_node =
 5903|  65.7k|                              (next_indent == ctx.current_indent()) &&
  ------------------
  |  Branch (5903:31): [True: 6.43k, False: 59.2k]
  ------------------
 5904|  6.43k|                              (*peek == '!' || *peek == '&' || *peek == '*' || *peek == '[' || *peek == '{' ||
  ------------------
  |  Branch (5904:32): [True: 459, False: 5.97k]
  |  Branch (5904:48): [True: 352, False: 5.62k]
  |  Branch (5904:64): [True: 1, False: 5.62k]
  |  Branch (5904:80): [True: 428, False: 5.19k]
  |  Branch (5904:96): [True: 384, False: 4.81k]
  ------------------
 5905|  4.81k|                               *peek == '"' || *peek == '\'' || *peek == '|' || *peek == '>');
  ------------------
  |  Branch (5905:32): [True: 404, False: 4.40k]
  |  Branch (5905:48): [True: 277, False: 4.13k]
  |  Branch (5905:65): [True: 520, False: 3.61k]
  |  Branch (5905:81): [True: 132, False: 3.48k]
  ------------------
 5906|  65.7k|                           value_on_next_line =
 5907|  65.7k|                              (next_indent > ctx.current_indent()) || indentless_sequence || same_indent_property_node;
  ------------------
  |  Branch (5907:31): [True: 55.7k, False: 9.95k]
  |  Branch (5907:71): [True: 3.06k, False: 6.89k]
  |  Branch (5907:94): [True: 2.95k, False: 3.93k]
  ------------------
 5908|  65.7k|                        }
 5909|  70.9k|                     }
 5910|  70.9k|                  }
 5911|  73.7k|                  if (!value_on_next_line) {
  ------------------
  |  Branch (5911:23): [True: 11.9k, False: 61.7k]
  ------------------
 5912|       |                     // Anchor on empty/null node — store empty span, leave value as default
 5913|  11.9k|                     ctx.anchors[std::string(aname)] = {&*it, &*it, ctx.current_indent()};
 5914|  11.9k|                     return;
 5915|  11.9k|                  }
 5916|       |                  // Value is on next line — advance past newline/blank lines to the content
 5917|  61.7k|                  if (*it == '#') {
  ------------------
  |  Branch (5917:23): [True: 8.67k, False: 53.1k]
  ------------------
 5918|   286k|                     while (it != end && *it != '\n' && *it != '\r') ++it;
  ------------------
  |  Branch (5918:29): [True: 286k, False: 0]
  |  Branch (5918:42): [True: 283k, False: 3.07k]
  |  Branch (5918:57): [True: 277k, False: 5.59k]
  ------------------
 5919|  8.67k|                  }
 5920|  61.7k|                  if (it != end) yaml::skip_newline(it, end);
  ------------------
  |  Branch (5920:23): [True: 61.7k, False: 0]
  ------------------
 5921|  79.2k|                  while (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5921:26): [True: 79.2k, False: 0]
  |  Branch (5921:40): [True: 10.1k, False: 69.0k]
  |  Branch (5921:55): [True: 7.29k, False: 61.7k]
  ------------------
 5922|  17.4k|                     yaml::skip_newline(it, end);
 5923|  17.4k|                  }
 5924|  61.7k|                  yaml::skip_inline_ws(it, end);
 5925|  61.7k|                  anchor_on_same_line = false;
 5926|  61.7k|               }
 5927|       |
 5928|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5929|       |                  if (anchor_on_same_line && *it == '-' &&
 5930|       |                      ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))])) {
 5931|       |                     // "&anchor - item" is malformed in block context.
 5932|       |                     ctx.error = error_code::syntax_error;
 5933|       |                     return;
 5934|       |                  }
 5935|       |               }
 5936|       |
 5937|       |               // Anchor on alias (&anchor *alias) is invalid per YAML spec.
 5938|       |               // But alias-as-key (&anchor *alias : value) is valid.
 5939|   599k|               if (it != end && *it == '*' && !yaml::alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (5939:20): [True: 599k, False: 1]
  |  Branch (5939:33): [True: 70, False: 599k]
  |  Branch (5939:47): [True: 39, False: 31]
  ------------------
 5940|     39|                  ctx.error = error_code::syntax_error;
 5941|     39|                  return;
 5942|     39|               }
 5943|       |
 5944|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5945|       |                  if (!anchor_on_same_line && it != end && *it == '&') {
 5946|       |                     auto probe = it + 1;
 5947|       |                     auto nested_anchor_name = yaml::parse_anchor_name(probe, end);
 5948|       |                     if (nested_anchor_name.empty()) {
 5949|       |                        ctx.error = error_code::syntax_error;
 5950|       |                        return;
 5951|       |                     }
 5952|       |                     yaml::skip_inline_ws(probe, end);
 5953|       |                     // Allow nested anchor usage only when it clearly starts a
 5954|       |                     // nested mapping entry ("&k key: value"). Otherwise this is
 5955|       |                     // a second anchor on the same node (4JVG-style), which is invalid.
 5956|       |                     if (!yaml::line_could_be_block_mapping(probe, end)) {
 5957|       |                        ctx.error = error_code::syntax_error;
 5958|       |                        return;
 5959|       |                     }
 5960|       |                  }
 5961|       |               }
 5962|       |
 5963|   599k|               const char* anchor_start = &*it;
 5964|   599k|               const int32_t anchor_indent = ctx.current_indent();
 5965|       |
 5966|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 5967|       |                  // Check if the anchor is on a block-mapping key (&name key: value).
 5968|       |                  // Only when the anchor and key are on the SAME line — if the value was on the
 5969|       |                  // next line, the anchor applies to the entire next-line content.
 5970|       |                  if (anchor_on_same_line && yaml::line_could_be_block_mapping(it, end)) {
 5971|       |                     auto key_start = it;
 5972|       |                     if (*key_start == '!') {
 5973|       |                        const auto key_tag = yaml::parse_yaml_tag(key_start, end, ctx);
 5974|       |                        if (key_tag == yaml::yaml_tag::unknown || !yaml::tag_valid_for_string(key_tag)) {
 5975|       |                           ctx.error = error_code::syntax_error;
 5976|       |                           return;
 5977|       |                        }
 5978|       |                        yaml::skip_inline_ws(key_start, end);
 5979|       |                        if (key_start == end) {
 5980|       |                           ctx.error = error_code::unexpected_end;
 5981|       |                           return;
 5982|       |                        }
 5983|       |                        if (*key_start == '\n' || *key_start == '\r') {
 5984|       |                           ctx.error = error_code::syntax_error;
 5985|       |                           return;
 5986|       |                        }
 5987|       |
 5988|       |                        // Re-apply the anchor-on-alias rule now that the tag is consumed. The
 5989|       |                        // check above ran before the tag, so "&anchor !tag *alias" reached the
 5990|       |                        // key-span registration below while the untagged spelling was rejected;
 5991|       |                        // an alias node carries no other properties either way.
 5992|       |                        if (*key_start == '*' && !yaml::alias_token_is_mapping_key(key_start, end)) {
 5993|       |                           ctx.error = error_code::syntax_error;
 5994|       |                           return;
 5995|       |                        }
 5996|       |                     }
 5997|       |
 5998|       |                     // Find the key span by scanning to the key-value separator
 5999|       |                     auto key_scan = key_start;
 6000|       |                     auto key_end = key_start;
 6001|       |                     if (*key_scan == '"' || *key_scan == '\'') {
 6002|       |                        // Quoted key: skip to closing quote
 6003|       |                        const char quote = *key_scan;
 6004|       |                        ++key_scan;
 6005|       |                        while (key_scan != end && *key_scan != quote) {
 6006|       |                           if (*key_scan == '\\' && quote == '"') {
 6007|       |                              ++key_scan;
 6008|       |                              if (key_scan != end) ++key_scan;
 6009|       |                           }
 6010|       |                           else {
 6011|       |                              ++key_scan;
 6012|       |                           }
 6013|       |                        }
 6014|       |                        if (key_scan == end) {
 6015|       |                           ctx.error = error_code::syntax_error;
 6016|       |                           return;
 6017|       |                        }
 6018|       |                        ++key_scan; // past closing quote
 6019|       |                        key_end = key_scan;
 6020|       |                        yaml::skip_inline_ws(key_scan, end);
 6021|       |                     }
 6022|       |                     else {
 6023|       |                        // Plain key: scan to ':'
 6024|       |                        while (key_scan != end) {
 6025|       |                           if (*key_scan == ':') {
 6026|       |                              auto next = key_scan + 1;
 6027|       |                              if (next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r') {
 6028|       |                                 break;
 6029|       |                              }
 6030|       |                           }
 6031|       |                           ++key_scan;
 6032|       |                        }
 6033|       |                        key_end = key_scan;
 6034|       |                        while (key_end != key_start && (*(key_end - 1) == ' ' || *(key_end - 1) == '\t')) {
 6035|       |                           --key_end;
 6036|       |                        }
 6037|       |                     }
 6038|       |                     if (key_scan == end || *key_scan != ':') {
 6039|       |                        ctx.error = error_code::syntax_error;
 6040|       |                        return;
 6041|       |                     }
 6042|       |                     // Store anchor with just the key text span
 6043|       |                     ctx.anchors[std::string(aname)] = {&*key_start, &*key_end, anchor_indent};
 6044|       |                     it = key_start;
 6045|       |                     // Parse as an object alternative so complex keys (e.g. flow collections) stay in mapping context.
 6046|       |                     if constexpr (counts::n_object > 0) {
 6047|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6048|       |                                                                                                        end);
 6049|       |                     }
 6050|       |                     else {
 6051|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6052|       |                     }
 6053|       |                     return;
 6054|       |                  }
 6055|       |               }
 6056|       |
 6057|   599k|               const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6058|   599k|               ctx.allow_indentless_sequence = value_is_indentless_sequence;
 6059|   599k|               from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6060|   599k|               ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6061|   599k|               if (!bool(ctx.error)) {
  ------------------
  |  Branch (6061:20): [True: 589k, False: 9.27k]
  ------------------
 6062|   589k|                  ctx.anchors[std::string(aname)] = {anchor_start, &*it, anchor_indent};
 6063|   589k|               }
 6064|   599k|               return;
 6065|   599k|            }
 6066|   525k|            case '*': {
  ------------------
  |  Branch (6066:13): [True: 525k, False: 2.76M]
  ------------------
 6067|       |               // In block context, "*alias : value" starts a mapping with an alias key.
 6068|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6069|       |                  if (yaml::alias_token_is_mapping_key(it, end)) {
 6070|       |                     if constexpr (counts::n_object > 0) {
 6071|       |                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6072|       |                                                                                                        end);
 6073|       |                        return;
 6074|       |                     }
 6075|       |                     else {
 6076|       |                        ctx.error = error_code::syntax_error;
 6077|       |                        return;
 6078|       |                     }
 6079|       |                  }
 6080|       |               }
 6081|       |
 6082|       |               // Alias value: look up anchor and replay
 6083|   525k|               yaml::handle_alias<Opts>(value, ctx, it, end);
 6084|   525k|               return;
 6085|   599k|            }
 6086|   158k|            case '!': {
  ------------------
  |  Branch (6086:13): [True: 158k, False: 3.13M]
  ------------------
 6087|       |               // Tag - parse it and dispatch based on tag type
 6088|   158k|               const auto tag = yaml::parse_yaml_tag(it, end, ctx);
 6089|   158k|               if (tag == yaml::yaml_tag::unknown) {
  ------------------
  |  Branch (6089:20): [True: 30, False: 158k]
  ------------------
 6090|     30|                  ctx.error = error_code::syntax_error;
 6091|     30|                  return;
 6092|     30|               }
 6093|   158k|               yaml::skip_inline_ws(it, end);
 6094|   158k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (6094:20): [True: 157k, False: 916]
  |  Branch (6094:33): [True: 8.95k, False: 148k]
  ------------------
 6095|  8.95k|                  yaml::skip_comment(it, end);
 6096|  8.95k|               }
 6097|   158k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (6097:20): [True: 157k, False: 1.31k]
  |  Branch (6097:34): [True: 28.1k, False: 129k]
  |  Branch (6097:49): [True: 19.8k, False: 109k]
  ------------------
 6098|  47.9k|                  auto content = it;
 6099|  47.9k|                  yaml::skip_newline(content, end);
 6100|  47.9k|                  yaml::skip_to_content(content, end);
 6101|       |
 6102|  47.9k|                  bool consume_following_content = false;
 6103|  47.9k|                  auto content_token = content;
 6104|  47.9k|                  if (content != end) {
  ------------------
  |  Branch (6104:23): [True: 46.9k, False: 1.02k]
  ------------------
 6105|  46.9k|                     auto indent_probe = content;
 6106|  46.9k|                     const int32_t content_indent = yaml::measure_indent<false>(indent_probe, end, ctx);
 6107|  46.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (6107:26): [True: 2, False: 46.9k]
  ------------------
 6108|      2|                        return;
 6109|  46.9k|                     content_token = indent_probe;
 6110|       |
 6111|       |                     // A tag at the end of a sequence/map entry has an empty value
 6112|       |                     // unless the next non-empty content is nested under the current node.
 6113|  46.9k|                     bool tagged_indentless_sequence = false;
 6114|  46.9k|                     if (tag == yaml::yaml_tag::seq && indent_probe != end && *indent_probe == '-') {
  ------------------
  |  Branch (6114:26): [True: 7.85k, False: 39.0k]
  |  Branch (6114:56): [True: 7.85k, False: 0]
  |  Branch (6114:79): [True: 6.76k, False: 1.09k]
  ------------------
 6115|  6.76k|                        const auto after_dash = indent_probe + 1;
 6116|  6.76k|                        if (after_dash == end ||
  ------------------
  |  Branch (6116:29): [True: 359, False: 6.40k]
  ------------------
 6117|  6.40k|                            yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (6117:29): [True: 3.85k, False: 2.54k]
  ------------------
 6118|  4.21k|                           tagged_indentless_sequence =
 6119|  4.21k|                              (content_indent == ctx.current_indent()) ||
  ------------------
  |  Branch (6119:31): [True: 925, False: 3.28k]
  ------------------
 6120|  3.28k|                              (ctx.current_indent() > 0 && (content_indent + 1) == ctx.current_indent());
  ------------------
  |  Branch (6120:32): [True: 689, False: 2.59k]
  |  Branch (6120:60): [True: 173, False: 516]
  ------------------
 6121|  4.21k|                        }
 6122|  6.76k|                     }
 6123|       |
 6124|  46.9k|                     consume_following_content = (ctx.current_indent() < 0) ||
  ------------------
  |  Branch (6124:50): [True: 27.1k, False: 19.7k]
  ------------------
 6125|  19.7k|                                                 (content_indent > ctx.current_indent()) || tagged_indentless_sequence;
  ------------------
  |  Branch (6125:50): [True: 4.29k, False: 15.4k]
  |  Branch (6125:93): [True: 1.09k, False: 14.3k]
  ------------------
 6126|  46.9k|                  }
 6127|       |
 6128|  47.9k|                  if (consume_following_content) {
  ------------------
  |  Branch (6128:23): [True: 32.5k, False: 15.4k]
  ------------------
 6129|  32.5k|                     it = content_token;
 6130|  32.5k|                  }
 6131|  15.4k|                  else {
 6132|  15.4k|                     if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6132:26): [True: 424, False: 14.9k]
  ------------------
 6133|    424|                        if constexpr (counts::n_str > 0) {
 6134|    424|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6135|    424|                           using StrType = std::variant_alternative_t<first_idx, V>;
 6136|    424|                           value = StrType{};
 6137|    424|                           return;
 6138|    424|                        }
 6139|    424|                     }
 6140|  15.4k|                     if (tag == yaml::yaml_tag::null_tag) {
  ------------------
  |  Branch (6140:26): [True: 117, False: 15.3k]
  ------------------
 6141|    117|                        if constexpr (counts::n_null > 0) {
 6142|    117|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6143|    117|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6144|    117|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6144:32): [True: 0, False: 117]
  ------------------
 6145|    117|                           return;
 6146|    117|                        }
 6147|    117|                     }
 6148|  15.4k|                     if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6148:26): [True: 14.2k, False: 1.21k]
  ------------------
 6149|  14.2k|                        if constexpr (counts::n_null > 0) {
 6150|  14.2k|                           constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6151|  14.2k|                           using NullType = std::variant_alternative_t<first_idx, V>;
 6152|  14.2k|                           if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6152:32): [True: 0, False: 14.2k]
  ------------------
 6153|  14.2k|                           return;
 6154|  14.2k|                        }
 6155|  14.2k|                     }
 6156|  15.4k|                  }
 6157|  47.9k|               }
 6158|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6159|       |                  // In block context, a comma immediately after a tag token is malformed
 6160|       |                  // (e.g., "!!str, value"). Flow context has legitimate ", ] }" usage.
 6161|       |                  if (it != end && *it == ',') {
 6162|       |                     ctx.error = error_code::syntax_error;
 6163|       |                     return;
 6164|       |                  }
 6165|       |                  if constexpr (counts::n_object > 0) {
 6166|       |                     // Tagged keys like "!!str key: value" must parse as mappings.
 6167|       |                     const bool starts_block_sequence_entry =
 6168|       |                        (it != end && *it == '-') &&
 6169|       |                        ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6170|       |                     if (!starts_block_sequence_entry && yaml::line_could_be_block_mapping(it, end)) {
 6171|       |                        // Re-dispatch from the post-tag token so '&key key: val' is
 6172|       |                        // handled by the anchor-aware key path, not as a map-level anchor.
 6173|       |                        from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6174|       |                        return;
 6175|       |                     }
 6176|       |                  }
 6177|       |               }
 6178|   158k|               if (it == end) {
  ------------------
  |  Branch (6178:20): [True: 1.31k, False: 157k]
  ------------------
 6179|  1.31k|                  if (tag == yaml::yaml_tag::str) {
  ------------------
  |  Branch (6179:23): [True: 259, False: 1.05k]
  ------------------
 6180|    259|                     if constexpr (counts::n_str > 0) {
 6181|    259|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_str>;
 6182|    259|                        using StrType = std::variant_alternative_t<first_idx, V>;
 6183|    259|                        value = StrType{};
 6184|    259|                        return;
 6185|    259|                     }
 6186|    259|                  }
 6187|  1.31k|                  if (tag == yaml::yaml_tag::none) {
  ------------------
  |  Branch (6187:23): [True: 1.05k, False: 260]
  ------------------
 6188|  1.05k|                     if constexpr (counts::n_null > 0) {
 6189|  1.05k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6190|  1.05k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6191|  1.05k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6191:29): [True: 0, False: 1.05k]
  ------------------
 6192|  1.05k|                        return;
 6193|  1.05k|                     }
 6194|  1.05k|                  }
 6195|      0|                  ctx.error = error_code::unexpected_end;
 6196|  1.31k|                  return;
 6197|  1.31k|               }
 6198|   157k|               switch (tag) {
 6199|  1.76k|               case yaml::yaml_tag::str:
  ------------------
  |  Branch (6199:16): [True: 1.76k, False: 155k]
  ------------------
 6200|  1.76k|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6201|  1.76k|                  return;
 6202|  4.33k|               case yaml::yaml_tag::int_tag:
  ------------------
  |  Branch (6202:16): [True: 4.33k, False: 153k]
  ------------------
 6203|  4.40k|               case yaml::yaml_tag::float_tag:
  ------------------
  |  Branch (6203:16): [True: 69, False: 157k]
  ------------------
 6204|  4.40k|                  if constexpr (counts::n_num > 0) {
 6205|  4.40k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6206|  4.40k|                     return;
 6207|       |                  }
 6208|       |                  else { // else used to fix MSVC unreachable code warning
 6209|       |                     ctx.error = error_code::syntax_error;
 6210|       |                     return;
 6211|       |                  }
 6212|  17.9k|               case yaml::yaml_tag::bool_tag:
  ------------------
  |  Branch (6212:16): [True: 13.5k, False: 143k]
  ------------------
 6213|  17.9k|                  if constexpr (counts::n_bool > 0) {
 6214|  17.9k|                     process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it, end);
 6215|  17.9k|                     return;
 6216|       |                  }
 6217|       |                  else { // else used to fix MSVC unreachable code warning
 6218|       |                     ctx.error = error_code::syntax_error;
 6219|       |                     return;
 6220|       |                  }
 6221|  18.8k|               case yaml::yaml_tag::null_tag:
  ------------------
  |  Branch (6221:16): [True: 902, False: 156k]
  ------------------
 6222|  18.8k|                  if constexpr (counts::n_null > 0) {
 6223|  18.8k|                     constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6224|  18.8k|                     using NullType = std::variant_alternative_t<first_idx, V>;
 6225|  18.8k|                     if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6225:26): [True: 0, False: 18.8k]
  ------------------
 6226|  18.8k|                     from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6227|  18.8k|                     return;
 6228|       |                  }
 6229|       |                  else { // else used to fix MSVC unreachable code warning
 6230|       |                     ctx.error = error_code::syntax_error;
 6231|       |                     return;
 6232|       |                  }
 6233|  31.4k|               case yaml::yaml_tag::map:
  ------------------
  |  Branch (6233:16): [True: 12.5k, False: 144k]
  ------------------
 6234|  31.4k|                  if constexpr (counts::n_object > 0) {
 6235|  31.4k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6236|  31.4k|                                                                                                     end);
 6237|  31.4k|                     return;
 6238|       |                  }
 6239|       |                  else { // else used to fix MSVC unreachable code warning
 6240|       |                     ctx.error = error_code::syntax_error;
 6241|       |                     return;
 6242|       |                  }
 6243|  63.9k|               case yaml::yaml_tag::seq:
  ------------------
  |  Branch (6243:16): [True: 32.5k, False: 124k]
  ------------------
 6244|  63.9k|                  if constexpr (counts::n_array > 0) {
 6245|  63.9k|                     const bool prev_allow_indentless_sequence = ctx.allow_indentless_sequence;
 6246|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 6247|       |                        if (it != end && *it == '-') {
 6248|       |                           ctx.allow_indentless_sequence = true;
 6249|       |                        }
 6250|       |                     }
 6251|  63.9k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6252|  63.9k|                                                                                                    end);
 6253|  63.9k|                     ctx.allow_indentless_sequence = prev_allow_indentless_sequence;
 6254|  63.9k|                     return;
 6255|       |                  }
 6256|       |                  else { // else used to fix MSVC unreachable code warning
 6257|       |                     ctx.error = error_code::syntax_error;
 6258|       |                     return;
 6259|       |                  }
 6260|   140k|               default: {
  ------------------
  |  Branch (6260:16): [True: 77.0k, False: 80.4k]
  ------------------
 6261|       |                  // Explicit unknown/non-core tags disable implicit scalar resolution.
 6262|       |                  // Preserve collection kinds, otherwise treat as string content.
 6263|   140k|                  if (it != end && *it == '*') {
  ------------------
  |  Branch (6263:23): [True: 77.0k, False: 63.9k]
  |  Branch (6263:36): [True: 11.4k, False: 65.5k]
  ------------------
 6264|  11.4k|                     yaml::handle_alias<Opts>(value, ctx, it, end);
 6265|  11.4k|                     return;
 6266|  11.4k|                  }
 6267|       |
 6268|   129k|                  if constexpr (counts::n_array > 0) {
 6269|   129k|                     if (it != end && *it == '[') {
  ------------------
  |  Branch (6269:26): [True: 65.5k, False: 63.9k]
  |  Branch (6269:39): [True: 2.85k, False: 62.7k]
  ------------------
 6270|  2.85k|                        process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6271|  2.85k|                                                                                                       end);
 6272|  2.85k|                        return;
 6273|  2.85k|                     }
 6274|   129k|                  }
 6275|   129k|                  if constexpr (counts::n_object > 0) {
 6276|   129k|                     if (it != end && *it == '{') {
  ------------------
  |  Branch (6276:26): [True: 62.7k, False: 66.8k]
  |  Branch (6276:39): [True: 11.5k, False: 51.1k]
  ------------------
 6277|  11.5k|                        process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6278|  11.5k|                                                                                                        end);
 6279|  11.5k|                        return;
 6280|  11.5k|                     }
 6281|   129k|                  }
 6282|       |
 6283|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 6284|       |                     if constexpr (counts::n_array > 0) {
 6285|       |                        const bool starts_block_sequence_entry =
 6286|       |                           (it != end && *it == '-') &&
 6287|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6288|       |                        if (starts_block_sequence_entry) {
 6289|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx,
 6290|       |                                                                                                          it, end);
 6291|       |                           return;
 6292|       |                        }
 6293|       |                     }
 6294|       |                     if constexpr (counts::n_object > 0) {
 6295|       |                        const bool starts_explicit_mapping_indicator =
 6296|       |                           (it != end && (*it == '?' || *it == ':')) &&
 6297|       |                           ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]);
 6298|       |                        if (starts_explicit_mapping_indicator) {
 6299|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6300|       |                                                                                                           it, end);
 6301|       |                           return;
 6302|       |                        }
 6303|       |                        if (yaml::line_could_be_block_mapping(it, end)) {
 6304|       |                           process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx,
 6305|       |                                                                                                           it, end);
 6306|       |                           return;
 6307|       |                        }
 6308|       |                     }
 6309|       |                  }
 6310|       |
 6311|   129k|                  if constexpr (counts::n_str > 0) {
 6312|   129k|                     process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6313|   129k|                     return;
 6314|   129k|                  }
 6315|       |
 6316|       |                  // Fall back if no string alternative exists.
 6317|      0|                  from<YAML, V>::template op<Opts>(value, ctx, it, end);
 6318|   129k|                  return;
 6319|   140k|               }
 6320|   157k|               }
 6321|      0|               return;
 6322|   157k|            }
 6323|   653k|            case '{':
  ------------------
  |  Branch (6323:13): [True: 653k, False: 2.63M]
  ------------------
 6324|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6325|       |                  // In block context, "{...}: value" can be a complex mapping key.
 6326|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6327|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6328|       |                                                                                                     end);
 6329|       |                     return;
 6330|       |                  }
 6331|       |               }
 6332|       |               // Flow mapping - object type
 6333|   653k|               process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it, end);
 6334|   653k|               return;
 6335|  50.7k|            case '[':
  ------------------
  |  Branch (6335:13): [True: 50.7k, False: 3.23M]
  ------------------
 6336|       |               if constexpr (!yaml::check_flow_context(Opts)) {
 6337|       |                  // In block context, "[...]: value" can be a complex mapping key.
 6338|       |                  if (ctx.current_indent() < 0 && yaml::line_could_be_block_mapping(it, end)) {
 6339|       |                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6340|       |                                                                                                     end);
 6341|       |                     return;
 6342|       |                  }
 6343|       |               }
 6344|       |               // Flow sequence - array type
 6345|  50.7k|               process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it, end);
 6346|  50.7k|               return;
 6347|   145k|            case '?':
  ------------------
  |  Branch (6347:13): [True: 145k, False: 3.14M]
  ------------------
 6348|       |               // Explicit mapping key indicator ("? key")
 6349|   145k|               if ((end - it >= 2) && it[1] == '\t') {
  ------------------
  |  Branch (6349:20): [True: 143k, False: 1.50k]
  |  Branch (6349:39): [True: 2, False: 143k]
  ------------------
 6350|      2|                  ctx.error = error_code::syntax_error;
 6351|      2|                  return;
 6352|      2|               }
 6353|   145k|               if ((end - it >= 2) && (it[1] == ' ' || it[1] == '\n' || it[1] == '\r')) {
  ------------------
  |  Branch (6353:20): [True: 143k, False: 1.50k]
  |  Branch (6353:40): [True: 42.5k, False: 101k]
  |  Branch (6353:56): [True: 57.2k, False: 43.9k]
  |  Branch (6353:73): [True: 23.1k, False: 20.8k]
  ------------------
 6354|   122k|                  if constexpr (counts::n_object > 0) {
 6355|   122k|                     process_yaml_variant_alternatives<V, is_yaml_variant_object>::template op<Opts>(value, ctx, it,
 6356|   122k|                                                                                                     end);
 6357|   122k|                     return;
 6358|   122k|                  }
 6359|   122k|               }
 6360|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6361|   145k|               return;
 6362|    127|            case '%':
  ------------------
  |  Branch (6362:13): [True: 127, False: 3.28M]
  ------------------
 6363|       |               // Reserved directive indicator is not a plain scalar start.
 6364|    127|               ctx.error = error_code::syntax_error;
 6365|    127|               return;
 6366|  3.31k|            case '"':
  ------------------
  |  Branch (6366:13): [True: 3.31k, False: 3.28M]
  ------------------
 6367|  6.97k|            case '\'':
  ------------------
  |  Branch (6367:13): [True: 3.66k, False: 3.28M]
  ------------------
 6368|       |               // Could be a quoted string OR a quoted key in a block mapping
 6369|       |               // Try block mapping first (e.g., "key": value), then fall back to string
 6370|  6.97k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6371|  6.97k|               return;
 6372|  30.3k|            case 't':
  ------------------
  |  Branch (6372:13): [True: 30.3k, False: 3.25M]
  ------------------
 6373|  34.1k|            case 'T':
  ------------------
  |  Branch (6373:13): [True: 3.75k, False: 3.28M]
  ------------------
 6374|       |               // Could be "true", "True", "TRUE", or a key/string starting with t/T
 6375|  34.1k|               if constexpr (counts::n_bool > 0) {
 6376|  34.1k|                  if ((end - it >= 4) && ((it[1] == 'r' && it[2] == 'u' && it[3] == 'e') ||
  ------------------
  |  Branch (6376:23): [True: 33.7k, False: 358]
  |  Branch (6376:44): [True: 24.9k, False: 8.79k]
  |  Branch (6376:60): [True: 21.0k, False: 3.94k]
  |  Branch (6376:76): [True: 14.9k, False: 6.05k]
  ------------------
 6377|  18.7k|                                          (it[1] == 'R' && it[2] == 'U' && it[3] == 'E'))) {
  ------------------
  |  Branch (6377:44): [True: 4.57k, False: 14.2k]
  |  Branch (6377:60): [True: 901, False: 3.66k]
  |  Branch (6377:76): [True: 163, False: 738]
  ------------------
 6378|       |                     // Check what follows the word "true"
 6379|  15.1k|                     const auto after_true = it + 4;
 6380|  15.1k|                     const bool at_word_boundary = is_word_boundary(after_true);
 6381|       |
 6382|  15.1k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6382:26): [True: 4.21k, False: 10.9k]
  ------------------
 6383|  4.21k|                        if (has_indented_block_continuation(after_true)) {
  ------------------
  |  Branch (6383:29): [True: 0, False: 4.21k]
  ------------------
 6384|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6385|      0|                           return;
 6386|      0|                        }
 6387|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6388|       |                        // "true: value" should parse as {true: value}, not as the boolean true
 6389|  4.21k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6389:29): [True: 3.54k, False: 670]
  |  Branch (6389:47): [True: 1.76k, False: 1.78k]
  ------------------
 6390|  1.76k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6390:30): [True: 413, False: 1.35k]
  |  Branch (6390:47): [True: 189, False: 1.16k]
  |  Branch (6390:63): [True: 446, False: 715]
  |  Branch (6390:80): [True: 224, False: 491]
  |  Branch (6390:97): [True: 491, False: 0]
  ------------------
 6391|       |                           // This is "true:" followed by space/tab/newline/end - treat as key
 6392|  1.76k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6393|  1.76k|                           return;
 6394|  1.76k|                        }
 6395|  2.45k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6396|  2.45k|                                                                                                      end);
 6397|  2.45k|                        return;
 6398|  4.21k|                     }
 6399|       |                     // "true" is followed by more characters (e.g., "True\b") - treat as string
 6400|  15.1k|                  }
 6401|  34.1k|               }
 6402|  29.9k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6403|  34.1k|               return;
 6404|  57.0k|            case 'f':
  ------------------
  |  Branch (6404:13): [True: 57.0k, False: 3.23M]
  ------------------
 6405|  71.6k|            case 'F':
  ------------------
  |  Branch (6405:13): [True: 14.5k, False: 3.27M]
  ------------------
 6406|       |               // Could be "false", "False", "FALSE", or a key/string starting with f/F
 6407|  71.6k|               if constexpr (counts::n_bool > 0) {
 6408|  71.6k|                  if ((end - it >= 5) && ((it[1] == 'a' && it[2] == 'l' && it[3] == 's' && it[4] == 'e') ||
  ------------------
  |  Branch (6408:23): [True: 70.2k, False: 1.35k]
  |  Branch (6408:44): [True: 34.9k, False: 35.2k]
  |  Branch (6408:60): [True: 26.7k, False: 8.18k]
  |  Branch (6408:76): [True: 25.5k, False: 1.23k]
  |  Branch (6408:92): [True: 19.8k, False: 5.71k]
  ------------------
 6409|  50.4k|                                          (it[1] == 'A' && it[2] == 'L' && it[3] == 'S' && it[4] == 'E'))) {
  ------------------
  |  Branch (6409:44): [True: 9.06k, False: 41.3k]
  |  Branch (6409:60): [True: 6.90k, False: 2.15k]
  |  Branch (6409:76): [True: 6.19k, False: 717]
  |  Branch (6409:92): [True: 4.45k, False: 1.74k]
  ------------------
 6410|       |                     // Check what follows the word "false"
 6411|  24.2k|                     const auto after_false = it + 5;
 6412|  24.2k|                     const bool at_word_boundary = is_word_boundary(after_false);
 6413|       |
 6414|  24.2k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6414:26): [True: 21.9k, False: 2.35k]
  ------------------
 6415|  21.9k|                        if (has_indented_block_continuation(after_false)) {
  ------------------
  |  Branch (6415:29): [True: 0, False: 21.9k]
  ------------------
 6416|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6417|      0|                           return;
 6418|      0|                        }
 6419|       |                        // Check if this is a key (followed by ": ") rather than a boolean value
 6420|       |                        // "false: value" should parse as {false: value}, not as the boolean false
 6421|  21.9k|                        if ((end - it > 5) && it[5] == ':' &&
  ------------------
  |  Branch (6421:29): [True: 19.2k, False: 2.67k]
  |  Branch (6421:47): [True: 14.6k, False: 4.66k]
  ------------------
 6422|  14.6k|                            (end - it == 6 || it[6] == ' ' || it[6] == '\t' || it[6] == '\n' || it[6] == '\r')) {
  ------------------
  |  Branch (6422:30): [True: 206, False: 14.4k]
  |  Branch (6422:47): [True: 494, False: 13.9k]
  |  Branch (6422:63): [True: 349, False: 13.5k]
  |  Branch (6422:80): [True: 1.95k, False: 11.6k]
  |  Branch (6422:97): [True: 11.6k, False: 0]
  ------------------
 6423|       |                           // This is "false:" followed by space/tab/newline/end - treat as key
 6424|  14.6k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6425|  14.6k|                           return;
 6426|  14.6k|                        }
 6427|  7.33k|                        process_yaml_variant_alternatives<V, is_yaml_variant_bool>::template op<Opts>(value, ctx, it,
 6428|  7.33k|                                                                                                      end);
 6429|  7.33k|                        return;
 6430|  21.9k|                     }
 6431|       |                     // "false" is followed by more characters (e.g., "False\b") - treat as string
 6432|  24.2k|                  }
 6433|  71.6k|               }
 6434|  49.6k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6435|  71.6k|               return;
 6436|  38.0k|            case 'n':
  ------------------
  |  Branch (6436:13): [True: 38.0k, False: 3.25M]
  ------------------
 6437|  47.3k|            case 'N':
  ------------------
  |  Branch (6437:13): [True: 9.27k, False: 3.28M]
  ------------------
 6438|       |               // Could be "null", "Null", "NULL", or a key/string starting with n/N
 6439|  47.3k|               if constexpr (counts::n_null > 0) {
 6440|  47.3k|                  if ((end - it >= 4) && ((it[1] == 'u' && it[2] == 'l' && it[3] == 'l') ||
  ------------------
  |  Branch (6440:23): [True: 45.6k, False: 1.67k]
  |  Branch (6440:44): [True: 22.7k, False: 22.9k]
  |  Branch (6440:60): [True: 21.3k, False: 1.34k]
  |  Branch (6440:76): [True: 17.8k, False: 3.53k]
  ------------------
 6441|  27.8k|                                          (it[1] == 'U' && it[2] == 'L' && it[3] == 'L'))) {
  ------------------
  |  Branch (6441:44): [True: 1.21k, False: 26.6k]
  |  Branch (6441:60): [True: 974, False: 244]
  |  Branch (6441:76): [True: 657, False: 317]
  ------------------
 6442|       |                     // Check what follows the word "null"
 6443|  18.4k|                     const auto after_null = it + 4;
 6444|  18.4k|                     const bool at_word_boundary = is_word_boundary(after_null);
 6445|       |
 6446|  18.4k|                     if (at_word_boundary) {
  ------------------
  |  Branch (6446:26): [True: 15.9k, False: 2.54k]
  ------------------
 6447|  15.9k|                        if (has_indented_block_continuation(after_null)) {
  ------------------
  |  Branch (6447:29): [True: 0, False: 15.9k]
  ------------------
 6448|      0|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6449|      0|                           return;
 6450|      0|                        }
 6451|       |                        // Check if this is a key (followed by ": ") rather than a null value
 6452|       |                        // "null: value" should parse as {null: value}, not as the null type
 6453|  15.9k|                        if ((end - it > 4) && it[4] == ':' &&
  ------------------
  |  Branch (6453:29): [True: 15.7k, False: 207]
  |  Branch (6453:47): [True: 13.4k, False: 2.25k]
  ------------------
 6454|  13.4k|                            (end - it == 5 || it[5] == ' ' || it[5] == '\t' || it[5] == '\n' || it[5] == '\r')) {
  ------------------
  |  Branch (6454:30): [True: 20, False: 13.4k]
  |  Branch (6454:47): [True: 349, False: 13.1k]
  |  Branch (6454:63): [True: 12.6k, False: 487]
  |  Branch (6454:80): [True: 182, False: 305]
  |  Branch (6454:97): [True: 305, False: 0]
  ------------------
 6455|       |                           // This is "null:" followed by space/tab/newline/end - treat as key
 6456|  13.4k|                           parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6457|  13.4k|                           return;
 6458|  13.4k|                        }
 6459|  2.46k|                        constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6460|  2.46k|                        using NullType = std::variant_alternative_t<first_idx, V>;
 6461|  2.46k|                        if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6461:29): [True: 0, False: 2.46k]
  ------------------
 6462|  2.46k|                        from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6463|  2.46k|                        return;
 6464|  15.9k|                     }
 6465|       |                     // "null" is followed by more characters (e.g., "Null\b") - treat as string
 6466|  18.4k|                  }
 6467|  47.3k|               }
 6468|  31.3k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6469|  47.3k|               return;
 6470|  2.10k|            case '~':
  ------------------
  |  Branch (6470:13): [True: 2.10k, False: 3.28M]
  ------------------
 6471|       |               // Null indicator
 6472|  2.10k|               if constexpr (counts::n_null > 0) {
 6473|  2.10k|                  constexpr auto first_idx = yaml_variant_first_index_v<V, is_yaml_variant_null>;
 6474|  2.10k|                  using NullType = std::variant_alternative_t<first_idx, V>;
 6475|  2.10k|                  if (!std::holds_alternative<NullType>(value)) value = NullType{};
  ------------------
  |  Branch (6475:23): [True: 0, False: 2.10k]
  ------------------
 6476|  2.10k|                  from<YAML, NullType>::template op<Opts>(std::get<NullType>(value), ctx, it, end);
 6477|  2.10k|                  return;
 6478|  2.10k|               }
 6479|      0|               break; // Fall through to try other types
 6480|   371k|            case '-':
  ------------------
  |  Branch (6480:13): [True: 371k, False: 2.91M]
  ------------------
 6481|       |               // Could be negative number or block sequence indicator
 6482|   371k|               if (((it + 1) == end) || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(it[1])]) {
  ------------------
  |  Branch (6482:20): [True: 1.85k, False: 369k]
  |  Branch (6482:41): [True: 299k, False: 69.5k]
  ------------------
 6483|       |                  // Block sequence indicator "- "
 6484|   301k|                  if constexpr (counts::n_array > 0) {
 6485|   301k|                     process_yaml_variant_alternatives<V, is_yaml_variant_array>::template op<Opts>(value, ctx, it,
 6486|   301k|                                                                                                    end);
 6487|   301k|                     return;
 6488|   301k|                  }
 6489|   301k|               }
 6490|   371k|               if constexpr (counts::n_num > 0) {
 6491|   371k|                  if ((end - it >= 2) && (std::isdigit(static_cast<unsigned char>(it[1])) || it[1] == '.')) {
  ------------------
  |  Branch (6491:23): [True: 69.5k, False: 301k]
  |  Branch (6491:43): [True: 3.66k, False: 65.8k]
  |  Branch (6491:94): [True: 27.1k, False: 38.6k]
  ------------------
 6492|  30.8k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, ctx, it, end);
 6493|  30.8k|                     return;
 6494|  30.8k|                  }
 6495|   371k|               }
 6496|   340k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6497|   371k|               return;
 6498|  31.0k|            case '+':
  ------------------
  |  Branch (6498:13): [True: 31.0k, False: 3.25M]
  ------------------
 6499|  46.4k|            case '.':
  ------------------
  |  Branch (6499:13): [True: 15.3k, False: 3.27M]
  ------------------
 6500|       |               // Could be a number (.5, +5, .inf, etc.) or a string (.c, .cpp, +name, etc.)
 6501|       |               // Try parsing as number speculatively, fall back to string on failure
 6502|  46.4k|               if constexpr (counts::n_num > 0) {
 6503|  46.4k|                  auto start_it = it;
 6504|  46.4k|                  auto temp_ctx = ctx.make_speculative();
 6505|  46.4k|                  process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6506|  46.4k|                                                                                               end);
 6507|  46.4k|                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6508|  46.4k|                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6509|  46.4k|                  if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6509:23): [True: 3.92k, False: 42.5k]
  ------------------
 6510|  3.92k|                     ctx.anchors = std::move(temp_ctx.anchors);
 6511|  3.92k|                     return; // Successfully parsed as number
 6512|  3.92k|                  }
 6513|  42.5k|                  it = start_it; // Restore and fall through to string
 6514|  42.5k|               }
 6515|      0|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6516|  46.4k|               return;
 6517|   564k|            default:
  ------------------
  |  Branch (6517:13): [True: 564k, False: 2.72M]
  ------------------
 6518|       |               // Check for digit (0-9) - numeric or block mapping key starting with digit
 6519|   564k|               if (c >= '0' && c <= '9') {
  ------------------
  |  Branch (6519:20): [True: 300k, False: 264k]
  |  Branch (6519:32): [True: 113k, False: 186k]
  ------------------
 6520|       |                  // Try block mapping first (e.g., "123key: value")
 6521|   113k|                  if (try_parse_block_mapping_into_variant<V, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (6521:23): [True: 6.81k, False: 106k]
  ------------------
 6522|  6.81k|                     return;
 6523|  6.81k|                  }
 6524|       |                  // Try numeric value speculatively - values like "12:30" look numeric but aren't
 6525|   106k|                  if constexpr (counts::n_num > 0) {
 6526|   106k|                     auto start_it = it;
 6527|   106k|                     auto temp_ctx = ctx.make_speculative();
 6528|   106k|                     process_yaml_variant_alternatives<V, is_yaml_variant_num>::template op<Opts>(value, temp_ctx, it,
 6529|   106k|                                                                                                  end);
 6530|   106k|                     ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6531|   106k|                     ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6532|   106k|                     if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (6532:26): [True: 52.0k, False: 54.7k]
  ------------------
 6533|  52.0k|                        ctx.anchors = std::move(temp_ctx.anchors);
 6534|  52.0k|                        return; // Successfully parsed as number
 6535|  52.0k|                     }
 6536|  54.7k|                     it = start_it; // Restore and fall through to string
 6537|  54.7k|                  }
 6538|       |                  // Fall through to string
 6539|      0|                  process_yaml_variant_alternatives<V, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 6540|   106k|                  return;
 6541|   113k|               }
 6542|       |               // Plain scalar - try block mapping, then string
 6543|   450k|               parse_block_mapping_or_string<V, Opts>(value, ctx, it, end);
 6544|   450k|               return;
 6545|  3.28M|            }
 6546|  3.28M|         }
 6547|       |
 6548|       |         // For non-auto-deducible variants or fallback, try each type until one succeeds
 6549|      0|         constexpr auto N = std::variant_size_v<std::remove_cvref_t<T>>;
 6550|       |
 6551|       |         // This fold discards each alternative's error and reports only that nothing fit, which
 6552|       |         // misdiagnoses a document that exhausted an expansion budget as merely the wrong shape.
 6553|       |         // Kept aside and used only if no alternative parsed, so a later one that does parse
 6554|       |         // (possible under a latched budget if it materializes no key text) is unaffected.
 6555|  3.28M|         error_code expansion_error{};
 6556|  3.28M|         std::string_view expansion_message{};
 6557|       |
 6558|  3.28M|         auto try_parse = [&]<size_t I>() -> bool {
 6559|  3.28M|            using V = std::variant_alternative_t<I, std::remove_cvref_t<T>>;
 6560|  3.28M|            auto start = it;
 6561|       |
 6562|  3.28M|            V v{};
 6563|  3.28M|            auto temp_ctx = ctx.make_speculative();
 6564|  3.28M|            from<YAML, V>::template op<Opts>(v, temp_ctx, it, end);
 6565|  3.28M|            ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 6566|  3.28M|            ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 6567|       |
 6568|  3.28M|            if (!bool(temp_ctx.error)) {
 6569|  3.28M|               value = std::move(v);
 6570|  3.28M|               ctx.anchors = std::move(temp_ctx.anchors);
 6571|  3.28M|               return true;
 6572|  3.28M|            }
 6573|       |
 6574|  3.28M|            if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 6575|  3.28M|               expansion_error = temp_ctx.error;
 6576|  3.28M|               expansion_message = temp_ctx.custom_error_message;
 6577|  3.28M|            }
 6578|  3.28M|            it = start;
 6579|  3.28M|            return false;
 6580|  3.28M|         };
 6581|       |
 6582|  3.28M|         bool parsed = false;
 6583|  3.28M|         [&]<size_t... Is>(std::index_sequence<Is...>) {
 6584|  3.28M|            ((parsed = parsed || try_parse.template operator()<Is>()), ...);
 6585|  3.28M|         }(std::make_index_sequence<N>{});
 6586|       |
 6587|  3.28M|         if (!parsed) {
  ------------------
  |  Branch (6587:14): [True: 0, False: 3.28M]
  ------------------
 6588|      0|            if (expansion_error != error_code::none) {
  ------------------
  |  Branch (6588:17): [True: 0, False: 0]
  ------------------
 6589|      0|               ctx.error = expansion_error;
 6590|      0|               ctx.custom_error_message = expansion_message;
 6591|      0|            }
 6592|      0|            else {
 6593|      0|               ctx.error = error_code::no_matching_variant_type;
 6594|      0|            }
 6595|      0|         }
 6596|  3.28M|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__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|   537k|      {
  301|   537k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 537k]
  |  Branch (301:27): [True: 0, False: 537k]
  ------------------
  302|       |
  303|   537k|         ++it; // skip '*'
  304|   537k|         auto name = parse_anchor_name(it, end);
  305|   537k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 83, False: 537k]
  ------------------
  306|     83|            ctx.error = error_code::syntax_error;
  307|     83|            return true;
  308|     83|         }
  309|       |
  310|   537k|         auto anchor_it = ctx.anchors.find(name);
  311|   537k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 1.85k, False: 535k]
  ------------------
  312|  1.85k|            ctx.error = error_code::syntax_error; // undefined alias
  313|  1.85k|            return true;
  314|  1.85k|         }
  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|   535k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|   535k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 5.67k, False: 529k]
  ------------------
  322|  5.67k|            return true;
  323|  5.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|   529k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 12, False: 529k]
  ------------------
  329|     12|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     12|            return true;
  331|     12|         }
  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|   529k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|   529k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 529k]
  ------------------
  339|      1|            return true;
  340|       |
  341|   529k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 6, False: 529k]
  ------------------
  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|   529k|         auto replay_it = span.begin;
  348|   529k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|   529k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|   529k|         ctx.indent_stack.clear();
  353|   529k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 14.5k, False: 515k]
  ------------------
  354|  14.5k|            ctx.push_indent(span.base_indent - 1);
  355|  14.5k|         }
  356|       |
  357|   529k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|   529k|         using V = std::remove_cvref_t<T>;
  360|   529k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|   529k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|   529k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|   529k|         return true;
  367|   529k|      }
_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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   625k|      {
 5206|   625k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   625k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   625k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   625k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   625k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 625k, False: 0]
  ------------------
 5216|   625k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   625k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1892|   648k|      {
 1893|   648k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 2.48k, False: 645k]
  ------------------
 1894|  2.48k|            return;
 1895|       |
 1896|   645k|         yaml::node_preamble_state preamble{};
 1897|   645k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 24.2k, False: 621k]
  ------------------
 1898|   645k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  24.2k|            return;
 1900|       |
 1901|   621k|         std::string str;
 1902|   621k|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|   621k|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 621k, False: 0]
  ------------------
 1905|  2.46k|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 2.46k, False: 619k]
  ------------------
 1906|  2.46k|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|  2.46k|            break;
 1908|  3.84k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 3.84k, False: 617k]
  ------------------
 1909|  3.84k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  3.84k|            break;
 1911|    696|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 696, False: 620k]
  ------------------
 1912|  3.57k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 2.88k, False: 618k]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  3.57k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  3.57k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 534, False: 3.04k]
  ------------------
 1918|  3.57k|            break;
 1919|   611k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 611k, False: 9.89k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|       |               if (ctx.current_indent() >= 0) {
 1924|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|       |               }
 1926|       |               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|       |                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|       |               }
 1930|       |            }
 1931|   611k|            else {
 1932|   611k|               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|   611k|            }
 1934|   611k|            break;
 1935|   621k|         }
 1936|       |
 1937|   621k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 621k, False: 239]
  ------------------
 1938|   621k|            value = std::move(str);
 1939|   621k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|   621k|         }
 1941|   621k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   645k|      {
  466|   645k|         skip_inline_ws(it, end);
  467|       |
  468|   645k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1, False: 645k]
  ------------------
  469|      1|            if constexpr (!AllowEmptyInput) {
  470|      1|               ctx.error = error_code::unexpected_end;
  471|      1|            }
  472|      1|            return true;
  473|      1|         }
  474|       |
  475|   645k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   645k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 9, False: 645k]
  ------------------
  477|      9|            ctx.error = error_code::syntax_error;
  478|      9|            return true;
  479|      9|         }
  480|   645k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 645k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   645k|         skip_inline_ws(it, end);
  486|       |
  487|   645k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 7, False: 645k]
  ------------------
  488|      7|            if constexpr (!AllowEmptyInput) {
  489|      7|               ctx.error = error_code::unexpected_end;
  490|      7|            }
  491|      7|            return true;
  492|      7|         }
  493|       |
  494|   645k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 24.2k, False: 621k]
  ------------------
  495|  24.2k|            return true;
  496|  24.2k|         }
  497|       |
  498|   621k|         return false;
  499|   645k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1898|   645k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   645k|      {
  409|   645k|         state.has_anchor = false;
  410|   645k|         state.anchor_name.clear();
  411|   645k|         state.anchor_start = nullptr;
  412|   645k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   645k|         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|   645k|            else {
  421|   645k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 24.1k, False: 621k]
  ------------------
  422|   645k|            }
  423|   645k|         }
  424|       |
  425|   645k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 621k, False: 24.1k]
  |  Branch (425:27): [True: 10.0k, False: 611k]
  ------------------
  426|  10.0k|            ++it;
  427|  10.0k|            auto name = parse_anchor_name(it, end);
  428|  10.0k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 10.0k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  10.0k|            skip_inline_ws(it, end);
  433|  10.0k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 9, False: 10.0k]
  ------------------
  434|      9|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|      9|                  ctx.error = error_code::unexpected_end;
  436|      9|               }
  437|      9|               return true;
  438|      9|            }
  439|  10.0k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  10.0k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 9, False: 9.99k]
  ------------------
  441|      9|                  ctx.error = error_code::syntax_error;
  442|      9|                  return true;
  443|      9|               }
  444|  10.0k|            }
  445|  9.99k|            state.has_anchor = true;
  446|  10.0k|            state.anchor_name = std::string(name);
  447|  10.0k|            state.anchor_start = &*it;
  448|  10.0k|         }
  449|       |
  450|   645k|         return false;
  451|   645k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|   645k|      {
  301|   645k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 645k]
  |  Branch (301:27): [True: 621k, False: 24.1k]
  ------------------
  302|       |
  303|  24.1k|         ++it; // skip '*'
  304|  24.1k|         auto name = parse_anchor_name(it, end);
  305|  24.1k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 4, False: 24.1k]
  ------------------
  306|      4|            ctx.error = error_code::syntax_error;
  307|      4|            return true;
  308|      4|         }
  309|       |
  310|  24.1k|         auto anchor_it = ctx.anchors.find(name);
  311|  24.1k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 28, False: 24.1k]
  ------------------
  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|  24.1k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  24.1k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 1.24k, False: 22.9k]
  ------------------
  322|  1.24k|            return true;
  323|  1.24k|         }
  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|  22.9k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 2, False: 22.9k]
  ------------------
  329|      2|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      2|            return true;
  331|      2|         }
  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|  22.9k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  22.9k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 22.9k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  22.9k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 22.9k]
  ------------------
  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|  22.9k|         auto replay_it = span.begin;
  348|  22.9k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  22.9k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  22.9k|         ctx.indent_stack.clear();
  353|  22.9k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.38k, False: 21.5k]
  ------------------
  354|  1.38k|            ctx.push_indent(span.base_indent - 1);
  355|  1.38k|         }
  356|       |
  357|  22.9k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  22.9k|         using V = std::remove_cvref_t<T>;
  360|  22.9k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  22.9k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  22.9k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  22.9k|         return true;
  367|  22.9k|      }
_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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   188k|      {
 5206|   188k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   188k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   188k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   188k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   188k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 188k, False: 0]
  ------------------
 5216|   188k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   188k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2047|   189k|      {
 2048|   189k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 189k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|   189k|         yaml::node_preamble_state preamble{};
 2052|   189k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 2.90k, False: 187k]
  ------------------
 2053|   189k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   189k|                   return yaml::tag_valid_for_float(tag);
 2055|   189k|                }
 2056|   189k|                else {
 2057|   189k|                   return yaml::tag_valid_for_int(tag);
 2058|   189k|                }
 2059|   189k|             }))
 2060|  2.90k|            return;
 2061|       |
 2062|   187k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|   187k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|   187k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|   187k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 15.7k, False: 171k]
  ------------------
 2070|  15.7k|               ++it;
 2071|  15.7k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 14.9k, False: 847]
  |  Branch (2071:38): [True: 1.15k, False: 13.7k]
  |  Branch (2071:74): [True: 404, False: 13.3k]
  ------------------
 2072|  13.3k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 212, False: 13.1k]
  ------------------
 2073|  1.76k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|  1.76k|                  it += 3;
 2075|  1.76k|                  finalize();
 2076|  1.76k|                  return;
 2077|  1.76k|               }
 2078|  13.9k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 13.1k, False: 847]
  |  Branch (2078:38): [True: 338, False: 12.8k]
  |  Branch (2078:74): [True: 625, False: 12.1k]
  ------------------
 2079|  12.1k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 560, False: 11.6k]
  ------------------
 2080|  1.52k|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|  1.52k|                  it += 3;
 2082|  1.52k|                  finalize();
 2083|  1.52k|                  return;
 2084|  1.52k|               }
 2085|  12.4k|               it = start;
 2086|  12.4k|            }
 2087|       |
 2088|   183k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 31.9k, False: 151k]
  |  Branch (2088:31): [True: 31.1k, False: 120k]
  ------------------
 2089|  63.0k|               const char sign = *it;
 2090|  63.0k|               ++it;
 2091|  63.0k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 62.6k, False: 385]
  |  Branch (2091:33): [True: 33.2k, False: 29.4k]
  ------------------
 2092|  33.2k|                  ++it;
 2093|  33.2k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 32.2k, False: 1.00k]
  |  Branch (2093:41): [True: 26.7k, False: 5.47k]
  |  Branch (2093:77): [True: 1.41k, False: 4.05k]
  ------------------
 2094|  28.4k|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 343, False: 3.71k]
  ------------------
 2095|  28.4k|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 27.9k, False: 514]
  ------------------
 2096|  27.9k|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|  27.9k|                     }
 2098|    514|                     else {
 2099|    514|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|    514|                     }
 2101|  28.4k|                     it += 3;
 2102|  28.4k|                     finalize();
 2103|  28.4k|                     return;
 2104|  28.4k|                  }
 2105|  33.2k|               }
 2106|  34.5k|               it = start;
 2107|  34.5k|            }
 2108|   183k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|   155k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  15.5M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 15.5M, False: 38.7k]
  ------------------
 2115|  15.5M|            const char c = *it;
 2116|  15.5M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 44.4k, False: 15.4M]
  |  Branch (2116:29): [True: 35.4k, False: 15.4M]
  |  Branch (2116:42): [True: 4.88k, False: 15.4M]
  |  Branch (2116:55): [True: 28.6k, False: 15.3M]
  |  Branch (2116:68): [True: 12.5k, False: 15.3M]
  |  Branch (2116:80): [True: 1.75k, False: 15.3M]
  |  Branch (2116:92): [True: 4.01k, False: 15.3M]
  |  Branch (2116:104): [True: 12.4k, False: 15.3M]
  ------------------
 2117|   144k|               break;
 2118|   144k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  15.3M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 24.8k, False: 15.3M]
  ------------------
 2121|  24.8k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 245, False: 24.5k]
  |  Branch (2121:39): [True: 1.04k, False: 23.5k]
  |  Branch (2121:59): [True: 397, False: 23.1k]
  |  Branch (2121:80): [True: 1.60k, False: 21.5k]
  |  Branch (2121:101): [True: 850, False: 20.6k]
  ------------------
 2122|  4.14k|                  break;
 2123|  4.14k|               }
 2124|  24.8k|            }
 2125|  15.3M|            ++it;
 2126|  15.3M|         }
 2127|       |
 2128|   187k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|   187k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 564, False: 186k]
  ------------------
 2131|    564|            ctx.error = error_code::parse_number_failure;
 2132|    564|            return;
 2133|    564|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|   186k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|   186k|            bool negative = false;
 2186|   186k|            std::string_view digits = num_str;
 2187|       |
 2188|   186k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 154k, False: 31.7k]
  |  Branch (2188:37): [True: 30.5k, False: 124k]
  |  Branch (2188:62): [True: 3.99k, False: 120k]
  ------------------
 2189|  34.5k|               negative = (digits.front() == '-');
 2190|  34.5k|               digits.remove_prefix(1);
 2191|  34.5k|            }
 2192|       |
 2193|   186k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 107k, False: 79.3k]
  |  Branch (2193:38): [True: 40.7k, False: 66.4k]
  ------------------
 2194|  40.7k|               int base = 10;
 2195|  40.7k|               size_t offset = 0;
 2196|       |
 2197|  40.7k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 2.53k, False: 38.2k]
  |  Branch (2197:40): [True: 178, False: 38.0k]
  ------------------
 2198|  2.71k|                  base = 16;
 2199|  2.71k|                  offset = 2;
 2200|  2.71k|               }
 2201|  38.0k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 854, False: 37.1k]
  |  Branch (2201:45): [True: 892, False: 36.2k]
  ------------------
 2202|  1.74k|                  base = 8;
 2203|  1.74k|                  offset = 2;
 2204|  1.74k|               }
 2205|  36.2k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 1.65k, False: 34.6k]
  |  Branch (2205:45): [True: 429, False: 34.1k]
  ------------------
 2206|  2.08k|                  base = 2;
 2207|  2.08k|                  offset = 2;
 2208|  2.08k|               }
 2209|       |
 2210|  40.7k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 6.54k, False: 34.1k]
  ------------------
 2211|  6.54k|                  auto raw_digits = digits.substr(offset);
 2212|  6.54k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  6.54k|                  std::string clean_storage;
 2215|  6.54k|                  std::string_view clean_view;
 2216|  6.54k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 1.57k, False: 4.96k]
  ------------------
 2217|  1.57k|                     clean_storage.reserve(raw_digits.size());
 2218|  1.86M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 1.86M, False: 1.57k]
  ------------------
 2219|  1.86M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 1.86M, False: 3.05k]
  ------------------
 2220|  1.86M|                           clean_storage.push_back(c);
 2221|  1.86M|                        }
 2222|  1.86M|                     }
 2223|  1.57k|                     clean_view = clean_storage;
 2224|  1.57k|                  }
 2225|  4.96k|                  else {
 2226|  4.96k|                     clean_view = raw_digits;
 2227|  4.96k|                  }
 2228|       |
 2229|  6.54k|                  uint64_t parsed_int{};
 2230|  6.54k|                  auto [ptr, ec] =
 2231|  6.54k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  6.54k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 2.43k, False: 4.10k]
  |  Branch (2232:44): [True: 1.77k, False: 2.33k]
  ------------------
 2233|  4.20k|                     ctx.error = error_code::parse_number_failure;
 2234|  4.20k|                     finalize();
 2235|  4.20k|                     return;
 2236|  4.20k|                  }
 2237|       |
 2238|  2.33k|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|  2.33k|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 1.65k, False: 685]
  ------------------
 2240|  2.33k|                  finalize();
 2241|  2.33k|                  return;
 2242|  6.54k|               }
 2243|  40.7k|            }
 2244|   186k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|   179k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|   186k|         std::string clean_storage;
 2250|   186k|         std::string_view clean_view;
 2251|       |
 2252|   186k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 2.03k, False: 184k]
  ------------------
 2253|  2.03k|            clean_storage.reserve(num_str.size());
 2254|  9.49M|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 9.49M, False: 2.03k]
  ------------------
 2255|  9.49M|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 9.48M, False: 10.2k]
  ------------------
 2256|  9.48M|                  clean_storage.push_back(c);
 2257|  9.48M|               }
 2258|  9.49M|            }
 2259|  2.03k|            clean_view = clean_storage;
 2260|  2.03k|         }
 2261|   184k|         else {
 2262|   184k|            clean_view = num_str;
 2263|   184k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|   186k|         auto parse_view = clean_view;
 2268|   186k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 148k, False: 38.3k]
  |  Branch (2268:37): [True: 30.5k, False: 117k]
  ------------------
 2269|  30.5k|            parse_view.remove_prefix(1);
 2270|  30.5k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 8.38k, False: 22.2k]
  ------------------
 2271|  8.38k|               ctx.error = error_code::parse_number_failure;
 2272|  8.38k|               return;
 2273|  8.38k|            }
 2274|  30.5k|         }
 2275|       |
 2276|   178k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|   178k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|   178k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 70.5k, False: 107k]
  |  Branch (2279:45): [True: 50.7k, False: 56.7k]
  ------------------
 2280|  83.0k|               ctx.error = error_code::parse_number_failure;
 2281|  83.0k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|   178k|         finalize();
 2292|   178k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1EEELb0ERdNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EdE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj33EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   189k|      {
  466|   189k|         skip_inline_ws(it, end);
  467|       |
  468|   189k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 227, False: 189k]
  ------------------
  469|    227|            if constexpr (!AllowEmptyInput) {
  470|    227|               ctx.error = error_code::unexpected_end;
  471|    227|            }
  472|    227|            return true;
  473|    227|         }
  474|       |
  475|   189k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   189k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 99, False: 189k]
  ------------------
  477|     99|            ctx.error = error_code::syntax_error;
  478|     99|            return true;
  479|     99|         }
  480|   189k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 99, False: 189k]
  ------------------
  481|     99|            ctx.error = error_code::syntax_error;
  482|     99|            return true;
  483|     99|         }
  484|       |
  485|   189k|         skip_inline_ws(it, end);
  486|       |
  487|   189k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 93, False: 189k]
  ------------------
  488|     93|            if constexpr (!AllowEmptyInput) {
  489|     93|               ctx.error = error_code::unexpected_end;
  490|     93|            }
  491|     93|            return true;
  492|     93|         }
  493|       |
  494|   189k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 2.39k, False: 187k]
  ------------------
  495|  2.39k|            return true;
  496|  2.39k|         }
  497|       |
  498|   187k|         return false;
  499|   189k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2052|   189k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|   189k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|   189k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|   189k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   189k|      {
  409|   189k|         state.has_anchor = false;
  410|   189k|         state.anchor_name.clear();
  411|   189k|         state.anchor_start = nullptr;
  412|   189k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   189k|         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|   189k|            else {
  421|   189k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 2.25k, False: 187k]
  ------------------
  422|   189k|            }
  423|   189k|         }
  424|       |
  425|   189k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 187k, False: 2.25k]
  |  Branch (425:27): [True: 3.43k, False: 183k]
  ------------------
  426|  3.43k|            ++it;
  427|  3.43k|            auto name = parse_anchor_name(it, end);
  428|  3.43k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 66, False: 3.37k]
  ------------------
  429|     66|               ctx.error = error_code::syntax_error;
  430|     66|               return true;
  431|     66|            }
  432|  3.37k|            skip_inline_ws(it, end);
  433|  3.37k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 73, False: 3.29k]
  ------------------
  434|     73|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     73|                  ctx.error = error_code::unexpected_end;
  436|     73|               }
  437|     73|               return true;
  438|     73|            }
  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.29k|            state.has_anchor = true;
  446|  3.29k|            state.anchor_name = std::string(name);
  447|  3.29k|            state.anchor_start = &*it;
  448|  3.29k|         }
  449|       |
  450|   189k|         return false;
  451|   189k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|   189k|      {
  301|   189k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 189k]
  |  Branch (301:27): [True: 187k, False: 2.25k]
  ------------------
  302|       |
  303|  2.25k|         ++it; // skip '*'
  304|  2.25k|         auto name = parse_anchor_name(it, end);
  305|  2.25k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 118, False: 2.13k]
  ------------------
  306|    118|            ctx.error = error_code::syntax_error;
  307|    118|            return true;
  308|    118|         }
  309|       |
  310|  2.13k|         auto anchor_it = ctx.anchors.find(name);
  311|  2.13k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 387, False: 1.74k]
  ------------------
  312|    387|            ctx.error = error_code::syntax_error; // undefined alias
  313|    387|            return true;
  314|    387|         }
  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.74k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.74k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 352, False: 1.39k]
  ------------------
  322|    352|            return true;
  323|    352|         }
  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.39k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 1, False: 1.39k]
  ------------------
  329|      1|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      1|            return true;
  331|      1|         }
  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.39k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.39k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 1.39k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  1.39k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.39k]
  ------------------
  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.39k|         auto replay_it = span.begin;
  348|  1.39k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.39k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.39k|         ctx.indent_stack.clear();
  353|  1.39k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 199, False: 1.19k]
  ------------------
  354|    199|            ctx.push_indent(span.base_indent - 1);
  355|    199|         }
  356|       |
  357|  1.39k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.39k|         using V = std::remove_cvref_t<T>;
  360|  1.39k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.39k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.39k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.39k|         return true;
  367|  1.39k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|   178k|         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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  23.3k|      {
 5206|  23.3k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  23.3k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  23.3k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  23.3k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  23.3k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 23.3k, False: 0]
  ------------------
 5216|  23.3k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  23.3k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2012|  30.1k|      {
 2013|  30.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 30.1k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  30.1k|         yaml::node_preamble_state preamble{};
 2017|  30.1k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 7.74k, False: 22.3k]
  ------------------
 2018|  30.1k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|  7.74k|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  22.3k|         std::string str;
 2023|  22.3k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  22.3k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 1.54k, False: 20.8k]
  |  Branch (2025:31): [True: 760, False: 20.0k]
  |  Branch (2025:48): [True: 139, False: 19.9k]
  |  Branch (2025:65): [True: 266, False: 19.6k]
  |  Branch (2025:81): [True: 908, False: 18.7k]
  |  Branch (2025:97): [True: 343, False: 18.3k]
  ------------------
 2026|  18.3k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 583, False: 17.8k]
  |  Branch (2026:29): [True: 79, False: 17.7k]
  |  Branch (2026:44): [True: 438, False: 17.2k]
  ------------------
 2027|  5.06k|            value = true;
 2028|  5.06k|         }
 2029|  17.2k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 9.99k, False: 7.29k]
  |  Branch (2029:37): [True: 306, False: 6.99k]
  |  Branch (2029:55): [True: 3.19k, False: 3.79k]
  |  Branch (2029:73): [True: 334, False: 3.46k]
  |  Branch (2029:88): [True: 465, False: 2.99k]
  |  Branch (2029:103): [True: 2.07k, False: 919]
  ------------------
 2030|  17.1k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 348, False: 571]
  |  Branch (2030:35): [True: 205, False: 366]
  |  Branch (2030:51): [True: 226, False: 140]
  ------------------
 2031|  17.1k|            value = false;
 2032|  17.1k|         }
 2033|    140|         else {
 2034|    140|            ctx.error = error_code::expected_true_or_false;
 2035|    140|         }
 2036|       |
 2037|  22.3k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  22.3k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj33EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  30.1k|      {
  466|  30.1k|         skip_inline_ws(it, end);
  467|       |
  468|  30.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1, False: 30.1k]
  ------------------
  469|      1|            if constexpr (!AllowEmptyInput) {
  470|      1|               ctx.error = error_code::unexpected_end;
  471|      1|            }
  472|      1|            return true;
  473|      1|         }
  474|       |
  475|  30.1k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  30.1k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 3, False: 30.0k]
  ------------------
  477|      3|            ctx.error = error_code::syntax_error;
  478|      3|            return true;
  479|      3|         }
  480|  30.0k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 1, False: 30.0k]
  ------------------
  481|      1|            ctx.error = error_code::syntax_error;
  482|      1|            return true;
  483|      1|         }
  484|       |
  485|  30.0k|         skip_inline_ws(it, end);
  486|       |
  487|  30.0k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 30.0k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|  30.0k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 7.73k, False: 22.3k]
  ------------------
  495|  7.73k|            return true;
  496|  7.73k|         }
  497|       |
  498|  22.3k|         return false;
  499|  30.0k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2018|  30.0k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1EEERbNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  30.0k|      {
  409|  30.0k|         state.has_anchor = false;
  410|  30.0k|         state.anchor_name.clear();
  411|  30.0k|         state.anchor_start = nullptr;
  412|  30.0k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  30.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|  30.0k|            else {
  421|  30.0k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 7.72k, False: 22.3k]
  ------------------
  422|  30.0k|            }
  423|  30.0k|         }
  424|       |
  425|  30.0k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 22.3k, False: 7.72k]
  |  Branch (425:27): [True: 6.28k, False: 16.0k]
  ------------------
  426|  6.28k|            ++it;
  427|  6.28k|            auto name = parse_anchor_name(it, end);
  428|  6.28k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 2, False: 6.28k]
  ------------------
  429|      2|               ctx.error = error_code::syntax_error;
  430|      2|               return true;
  431|      2|            }
  432|  6.28k|            skip_inline_ws(it, end);
  433|  6.28k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 7, False: 6.27k]
  ------------------
  434|      7|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|      7|                  ctx.error = error_code::unexpected_end;
  436|      7|               }
  437|      7|               return true;
  438|      7|            }
  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.27k|            state.has_anchor = true;
  446|  6.27k|            state.anchor_name = std::string(name);
  447|  6.27k|            state.anchor_start = &*it;
  448|  6.27k|         }
  449|       |
  450|  30.0k|         return false;
  451|  30.0k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  30.0k|      {
  301|  30.0k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 30.0k]
  |  Branch (301:27): [True: 22.3k, False: 7.72k]
  ------------------
  302|       |
  303|  7.72k|         ++it; // skip '*'
  304|  7.72k|         auto name = parse_anchor_name(it, end);
  305|  7.72k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 5, False: 7.72k]
  ------------------
  306|      5|            ctx.error = error_code::syntax_error;
  307|      5|            return true;
  308|      5|         }
  309|       |
  310|  7.72k|         auto anchor_it = ctx.anchors.find(name);
  311|  7.72k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 28, False: 7.69k]
  ------------------
  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|  7.69k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  7.69k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 941, False: 6.75k]
  ------------------
  322|    941|            return true;
  323|    941|         }
  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.75k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 4, False: 6.74k]
  ------------------
  329|      4|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      4|            return true;
  331|      4|         }
  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.74k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  6.74k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 6.74k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  6.74k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 6.74k]
  ------------------
  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.74k|         auto replay_it = span.begin;
  348|  6.74k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  6.74k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  6.74k|         ctx.indent_stack.clear();
  353|  6.74k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 493, False: 6.25k]
  ------------------
  354|    493|            ctx.push_indent(span.base_indent - 1);
  355|    493|         }
  356|       |
  357|  6.74k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  6.74k|         using V = std::remove_cvref_t<T>;
  360|  6.74k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  6.74k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  6.74k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  6.74k|         return true;
  367|  6.74k|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2398|  5.47k|      {
 2399|  5.47k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 5.47k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  5.47k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  5.47k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 1, False: 5.47k]
  ------------------
 2405|      1|            ctx.error = error_code::unexpected_end;
 2406|      1|            return;
 2407|      1|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  5.47k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 2.10k, False: 3.36k]
  ------------------
 2411|  2.10k|            ++it;
 2412|  2.10k|            return;
 2413|  2.10k|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  3.36k|         auto start = it;
 2417|  53.7k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 53.5k, False: 215]
  |  Branch (2417:30): [True: 50.3k, False: 3.15k]
  ------------------
 2418|  50.3k|            ++it;
 2419|  50.3k|         }
 2420|       |
 2421|  3.36k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  3.36k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 37, False: 3.32k]
  ------------------
 2423|     37|            ctx.error = error_code::syntax_error;
 2424|     37|         }
 2425|  3.36k|      }
_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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   994k|      {
 5206|   994k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   994k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   994k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   994k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   994k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 994k, False: 0]
  ------------------
 5216|   994k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   994k|      }
_ZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_:
 4515|   999k|      {
 4516|   999k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4516:14): [True: 0, False: 999k]
  ------------------
 4517|      0|            return;
 4518|       |
 4519|   999k|         yaml::node_preamble_state preamble{};
 4520|   999k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, true, false, false}>(
  ------------------
  |  Branch (4520:14): [True: 5.70k, False: 993k]
  ------------------
 4521|   999k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
 4522|  5.70k|            return;
 4523|       |
 4524|   993k|         using key_t = typename std::remove_cvref_t<T>::key_type;
 4525|   993k|         using val_t = typename std::remove_cvref_t<T>::mapped_type;
 4526|       |
 4527|       |         // Reading a YAML mapping MERGES into the target: an entry overwrites the
 4528|       |         // value of a key that existed before the read and adds new keys, while
 4529|       |         // pre-existing keys the document does not mention are preserved (like a
 4530|       |         // struct/object read, and like json/read.hpp's per-key value[key]).
 4531|       |         // Within a single document a repeated key keeps its FIRST value -- YAML
 4532|       |         // mappings disallow duplicate keys and the conformance suite expects
 4533|       |         // first-wins, which falls out of emplace into an empty map. Any
 4534|       |         // pre-existing entry the document leaves untouched is restored on scope
 4535|       |         // exit (including error paths). When the target starts empty (the common
 4536|       |         // case) this is a no-op with negligible cost.
 4537|   993k|         std::remove_cvref_t<T> preexisting_entries;
 4538|   993k|         if (!value.empty()) {
  ------------------
  |  Branch (4538:14): [True: 0, False: 993k]
  ------------------
 4539|      0|            preexisting_entries = std::move(value);
 4540|      0|            value.clear();
 4541|      0|         }
 4542|   993k|         struct merge_restore_guard
 4543|   993k|         {
 4544|   993k|            std::remove_cvref_t<T>& target;
 4545|   993k|            std::remove_cvref_t<T>& saved;
 4546|   993k|            ~merge_restore_guard()
 4547|   993k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   993k|               for (auto& entry : saved) {
 4551|   993k|                  target.emplace(entry.first, std::move(entry.second));
 4552|   993k|               }
 4553|   993k|            }
 4554|   993k|         } merge_restore{value, preexisting_entries};
 4555|       |
 4556|   993k|         const bool treat_as_block_mapping =
 4557|   993k|            !yaml::check_flow_context(Opts) && *it == '{' && yaml::inline_value_has_plain_mapping_indicator(it, end);
  ------------------
  |  Branch (4557:13): [Folded, False: 993k]
  |  Branch (4557:48): [True: 0, False: 0]
  |  Branch (4557:62): [True: 0, False: 0]
  ------------------
 4558|       |
 4559|   993k|         if (*it == '{' && !treat_as_block_mapping) {
  ------------------
  |  Branch (4559:14): [True: 669k, False: 323k]
  |  Branch (4559:28): [True: 0, Folded]
  ------------------
 4560|       |            // Flow mapping
 4561|   669k|            ++it;
 4562|       |            // Skip whitespace and newlines after opening brace
 4563|   669k|            yaml::skip_ws_and_newlines(it, end);
 4564|       |
 4565|   669k|            if (it != end && *it == '}') {
  ------------------
  |  Branch (4565:17): [True: 668k, False: 1.22k]
  |  Branch (4565:30): [True: 13.1k, False: 655k]
  ------------------
 4566|  13.1k|               ++it;
 4567|  13.1k|               yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4568|  13.1k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4568:20): [True: 9, False: 13.1k]
  ------------------
 4569|      9|                  return;
 4570|  13.1k|               yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4571|  13.1k|               return;
 4572|  13.1k|            }
 4573|       |
 4574|  3.51M|            while (it != end) {
  ------------------
  |  Branch (4574:20): [True: 3.51M, False: 2.33k]
  ------------------
 4575|       |               // Skip whitespace and newlines at start of each iteration
 4576|  3.51M|               yaml::skip_ws_and_newlines(it, end);
 4577|       |
 4578|  3.51M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4578:20): [True: 3.51M, False: 0]
  |  Branch (4578:33): [True: 28.9k, False: 3.48M]
  ------------------
 4579|  28.9k|                  ++it;
 4580|  28.9k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4581|  28.9k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4581:23): [True: 35, False: 28.9k]
  ------------------
 4582|     35|                     return;
 4583|  28.9k|                  break;
 4584|  28.9k|               }
 4585|       |
 4586|  3.48M|               bool explicit_flow_key = false;
 4587|  3.48M|               auto explicit_probe = it;
 4588|  3.48M|               yaml::skip_inline_ws(explicit_probe, end);
 4589|  3.48M|               if (explicit_probe != end && *explicit_probe == '?') {
  ------------------
  |  Branch (4589:20): [True: 3.48M, False: 0]
  |  Branch (4589:45): [True: 60.7k, False: 3.42M]
  ------------------
 4590|  60.7k|                  const auto after_q = explicit_probe + 1;
 4591|  60.7k|                  if (after_q == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_q)] ||
  ------------------
  |  Branch (4591:23): [True: 1, False: 60.7k]
  |  Branch (4591:41): [True: 27.4k, False: 33.3k]
  ------------------
 4592|  33.3k|                      *after_q == ',' || *after_q == '}') {
  ------------------
  |  Branch (4592:23): [True: 5.36k, False: 27.9k]
  |  Branch (4592:42): [True: 324, False: 27.6k]
  ------------------
 4593|  33.1k|                     explicit_flow_key = true;
 4594|  33.1k|                     it = explicit_probe + 1;
 4595|  33.1k|                     yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4596|  33.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4596:26): [True: 4, False: 33.1k]
  ------------------
 4597|      4|                        return;
 4598|  33.1k|                  }
 4599|  60.7k|               }
 4600|       |               // Parse key
 4601|  3.48M|               key_t key{};
 4602|  3.48M|               if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4603|  3.48M|                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
  ------------------
  |  Branch (4603:23): [True: 33.1k, False: 3.44M]
  |  Branch (4603:44): [True: 33.1k, False: 2]
  |  Branch (4603:58): [True: 1.23k, False: 31.8k]
  |  Branch (4603:72): [True: 6.65k, False: 25.2k]
  |  Branch (4603:86): [True: 627, False: 24.5k]
  ------------------
 4604|  8.51k|                     key.clear();
 4605|  8.51k|                  }
 4606|  3.47M|                  else {
 4607|  3.47M|                     auto key_probe = it;
 4608|  3.47M|                     yaml::skip_inline_ws(key_probe, end);
 4609|       |
 4610|       |                     // Use full node parsing only for structurally complex flow keys.
 4611|       |                     // Plain/quoted/alias keys stay on parse_yaml_key() for compatibility.
 4612|  3.47M|                     bool parse_complex_flow_key = false;
 4613|  3.47M|                     if (key_probe != end) {
  ------------------
  |  Branch (4613:26): [True: 3.47M, False: 2]
  ------------------
 4614|  3.47M|                        if (*key_probe == '[' || *key_probe == '{') {
  ------------------
  |  Branch (4614:29): [True: 8.26k, False: 3.46M]
  |  Branch (4614:50): [True: 18.8k, False: 3.44M]
  ------------------
 4615|  27.1k|                           parse_complex_flow_key = true;
 4616|  27.1k|                        }
 4617|  3.44M|                        else if (*key_probe == '&') {
  ------------------
  |  Branch (4617:34): [True: 650k, False: 2.79M]
  ------------------
 4618|   650k|                           ++key_probe;
 4619|   650k|                           yaml::parse_anchor_name(key_probe, end);
 4620|   650k|                           yaml::skip_inline_ws(key_probe, end);
 4621|   650k|                           if (key_probe != end && (*key_probe == '[' || *key_probe == '{')) {
  ------------------
  |  Branch (4621:32): [True: 650k, False: 46]
  |  Branch (4621:53): [True: 4.49k, False: 646k]
  |  Branch (4621:74): [True: 131k, False: 514k]
  ------------------
 4622|   136k|                              parse_complex_flow_key = true;
 4623|   136k|                           }
 4624|   650k|                        }
 4625|  3.47M|                     }
 4626|       |
 4627|  3.47M|                     if (parse_complex_flow_key) {
  ------------------
  |  Branch (4627:26): [True: 163k, False: 3.31M]
  ------------------
 4628|   163k|                        glz::generic key_node{};
 4629|   163k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 4630|   163k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4630:29): [True: 8.83k, False: 154k]
  ------------------
 4631|  8.83k|                           return;
 4632|   154k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (4632:29): [True: 29, False: 154k]
  ------------------
 4633|     29|                           return;
 4634|   154k|                     }
 4635|  3.31M|                     else {
 4636|  3.31M|                        if (!yaml::parse_yaml_key(key, ctx, it, end, true)) {
  ------------------
  |  Branch (4636:29): [True: 4.89k, False: 3.30M]
  ------------------
 4637|  4.89k|                           return;
 4638|  4.89k|                        }
 4639|  3.31M|                     }
 4640|  3.47M|                  }
 4641|       |               }
 4642|       |               else {
 4643|       |                  if (explicit_flow_key && it != end && (*it == ':' || *it == ',' || *it == '}')) {
 4644|       |                     ctx.error = error_code::syntax_error;
 4645|       |                     return;
 4646|       |                  }
 4647|       |                  from<YAML, key_t>::template op<yaml::flow_context_on<Opts>()>(key, ctx, it, end);
 4648|       |                  if (bool(ctx.error)) [[unlikely]]
 4649|       |                     return;
 4650|       |               }
 4651|       |
 4652|       |               // Separation between flow key and ':' may include comments/newlines.
 4653|       |               // In flow context, newlines are allowed between key and ':'.
 4654|  3.46M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4655|  3.48M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4655:20): [True: 20, False: 3.48M]
  ------------------
 4656|     20|                  return;
 4657|       |
 4658|  3.48M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|  3.48M|                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|  3.48M|                     val = {};
 4661|  3.48M|                     return true;
 4662|  3.48M|                  }
 4663|  3.48M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  3.48M|                     val = glz::generic{};
 4665|  3.48M|                     return true;
 4666|  3.48M|                  }
 4667|  3.48M|                  else {
 4668|  3.48M|                     static constexpr std::string_view null_value{"null"};
 4669|  3.48M|                     auto null_it = null_value.data();
 4670|  3.48M|                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|  3.48M|                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|  3.48M|                     return !bool(ctx.error);
 4673|  3.48M|                  }
 4674|  3.48M|               };
 4675|       |
 4676|  3.48M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4676:20): [True: 3.46M, False: 14.9k]
  |  Branch (4676:34): [True: 2.01M, False: 1.45M]
  |  Branch (4676:48): [True: 88.9k, False: 1.36M]
  ------------------
 4677|  2.10M|                  val_t val{};
 4678|  2.10M|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4678:23): [True: 0, False: 2.10M]
  ------------------
 4679|      0|                     return;
 4680|       |
 4681|  2.10M|                  value.emplace(std::move(key), std::move(val));
 4682|       |
 4683|  2.10M|                  if (*it == '}') {
  ------------------
  |  Branch (4683:23): [True: 88.9k, False: 2.01M]
  ------------------
 4684|  88.9k|                     ++it;
 4685|  88.9k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4686|  88.9k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4686:26): [True: 98, False: 88.8k]
  ------------------
 4687|     98|                        return;
 4688|  88.8k|                     break;
 4689|  88.9k|                  }
 4690|       |
 4691|  2.01M|                  ++it; // skip comma
 4692|  2.01M|                  yaml::skip_ws_and_newlines(it, end);
 4693|  2.01M|                  continue;
 4694|  2.10M|               }
 4695|       |
 4696|  1.37M|               if (it == end || *it != ':') {
  ------------------
  |  Branch (4696:20): [True: 14.9k, False: 1.36M]
  |  Branch (4696:33): [True: 840, False: 1.36M]
  ------------------
 4697|  2.03k|                  ctx.error = error_code::syntax_error;
 4698|  2.03k|                  return;
 4699|  2.03k|               }
 4700|  1.37M|               ++it;
 4701|       |
 4702|  1.37M|               yaml::skip_flow_ws_and_newlines(ctx, it, end);
 4703|  1.37M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4703:20): [True: 13, False: 1.37M]
  ------------------
 4704|     13|                  return;
 4705|       |
 4706|       |               // Omitted value after an explicit ':' maps to an implicit null.
 4707|  1.37M|               if (it != end && (*it == ',' || *it == '}')) {
  ------------------
  |  Branch (4707:20): [True: 1.36M, False: 13.7k]
  |  Branch (4707:34): [True: 175k, False: 1.18M]
  |  Branch (4707:48): [True: 10.1k, False: 1.17M]
  ------------------
 4708|   185k|                  val_t val{};
 4709|   185k|                  if (!parse_implicit_null(val)) [[unlikely]]
  ------------------
  |  Branch (4709:23): [True: 0, False: 185k]
  ------------------
 4710|      0|                     return;
 4711|       |
 4712|   185k|                  value.emplace(std::move(key), std::move(val));
 4713|       |
 4714|   185k|                  if (*it == '}') {
  ------------------
  |  Branch (4714:23): [True: 10.1k, False: 175k]
  ------------------
 4715|  10.1k|                     ++it;
 4716|  10.1k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4717|  10.1k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4717:26): [True: 14, False: 10.0k]
  ------------------
 4718|     14|                        return;
 4719|  10.0k|                     break;
 4720|  10.1k|                  }
 4721|       |
 4722|   175k|                  ++it; // skip comma
 4723|   175k|                  yaml::skip_ws_and_newlines(it, end);
 4724|   175k|                  continue;
 4725|   185k|               }
 4726|       |
 4727|       |               // Parse value
 4728|  1.19M|               val_t val{};
 4729|  1.19M|               from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(val, ctx, it, end);
 4730|  1.19M|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4730:20): [True: 3.35k, False: 1.18M]
  ------------------
 4731|  3.35k|                  return;
 4732|       |
 4733|  1.18M|               value.emplace(std::move(key), std::move(val));
 4734|       |
 4735|  1.18M|               yaml::skip_inline_ws(it, end);
 4736|       |
 4737|  1.18M|               if (it != end && *it == '}') {
  ------------------
  |  Branch (4737:20): [True: 1.17M, False: 14.0k]
  |  Branch (4737:33): [True: 485k, False: 687k]
  ------------------
 4738|   485k|                  ++it;
 4739|   485k|                  yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4740|   485k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4740:23): [True: 141, False: 484k]
  ------------------
 4741|    141|                     return;
 4742|   484k|                  break;
 4743|   485k|               }
 4744|   701k|               else if (it != end && *it == ',') {
  ------------------
  |  Branch (4744:25): [True: 687k, False: 14.0k]
  |  Branch (4744:38): [True: 624k, False: 62.8k]
  ------------------
 4745|   624k|                  ++it;
 4746|       |                  // Skip whitespace and newlines after comma
 4747|   624k|                  yaml::skip_ws_and_newlines(it, end);
 4748|   624k|               }
 4749|  76.9k|               else if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4749:25): [True: 62.8k, False: 14.0k]
  |  Branch (4749:39): [True: 26.5k, False: 36.3k]
  |  Branch (4749:54): [True: 36.0k, False: 321]
  ------------------
 4750|       |                  // Newlines may precede either the closing brace or the
 4751|       |                  // separator comma for the next entry.
 4752|  62.5k|                  yaml::skip_ws_and_newlines(it, end);
 4753|  62.5k|                  if (it != end && *it == '}') {
  ------------------
  |  Branch (4753:23): [True: 62.5k, False: 3]
  |  Branch (4753:36): [True: 21.3k, False: 41.2k]
  ------------------
 4754|  21.3k|                     ++it;
 4755|  21.3k|                     yaml::validate_flow_node_adjacent_tail(ctx, it, end);
 4756|  21.3k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4756:26): [True: 19, False: 21.3k]
  ------------------
 4757|     19|                        return;
 4758|  21.3k|                     break;
 4759|  21.3k|                  }
 4760|  41.2k|                  if (it != end && *it == ',') {
  ------------------
  |  Branch (4760:23): [True: 41.2k, False: 3]
  |  Branch (4760:36): [True: 41.1k, False: 91]
  ------------------
 4761|  41.1k|                     ++it;
 4762|  41.1k|                     yaml::skip_ws_and_newlines(it, end);
 4763|  41.1k|                     continue;
 4764|  41.1k|                  }
 4765|     94|                  ctx.error = error_code::syntax_error;
 4766|     94|                  return;
 4767|  41.2k|               }
 4768|  14.3k|               else {
 4769|  14.3k|                  ctx.error = error_code::syntax_error;
 4770|  14.3k|                  return;
 4771|  14.3k|               }
 4772|  1.18M|            }
 4773|   656k|         }
 4774|   323k|         else {
 4775|       |            // Block mapping - use shared loop with map-specific callback
 4776|   323k|            yaml::parse_block_mapping_loop<Opts>(
 4777|   323k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   323k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   323k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   323k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   323k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   323k|                           if (ctx.stream_begin) {
 4788|   323k|                              auto is_line_content_start = [&](auto pos) {
 4789|   323k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   323k|                              };
 4791|       |
 4792|   323k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   323k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   323k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   323k|                                 return line != end && *line == ':';
 4796|   323k|                              };
 4797|       |
 4798|   323k|                              if (!is_line_content_start(it) &&
 4799|   323k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   323k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   323k|                                 ctx.error = error_code::syntax_error;
 4802|   323k|                                 return false;
 4803|   323k|                              }
 4804|   323k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   323k|                           }
 4806|   323k|                        }
 4807|       |
 4808|   323k|                        if (*it == '-' &&
 4809|   323k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   323k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   323k|                           ctx.error = error_code::syntax_error;
 4813|   323k|                           return false;
 4814|   323k|                        }
 4815|       |
 4816|   323k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   323k|                           return false;
 4818|   323k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   323k|                        ctx.pop_indent();
 4820|   323k|                     }
 4821|   323k|                     else {
 4822|   323k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   323k|                        if (nested_indent >= 0) {
 4824|   323k|                           yaml::skip_to_content(it, end);
 4825|   323k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   323k|                              ctx.error = error_code::syntax_error;
 4827|   323k|                              return false;
 4828|   323k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   323k|                           const int32_t value_indent =
 4832|   323k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   323k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   323k|                              return false;
 4835|   323k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   323k|                           ctx.pop_indent();
 4837|   323k|                        }
 4838|   323k|                     }
 4839|   323k|                     return !bool(ctx.error);
 4840|   323k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   323k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
 4846|   323k|                     ctx.error = error_code::syntax_error;
 4847|   323k|                     return false;
 4848|   323k|                  }
 4849|   323k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
 4850|   323k|                     ++it; // skip '?'
 4851|   323k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   323k|                     const int32_t explicit_value_indicator_indent =
 4854|   323k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
 4855|       |
 4856|   323k|                     key_t key{};
 4857|   323k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   323k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   323k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   323k|                        };
 4861|       |
 4862|   323k|                        auto key_it = it;
 4863|   323k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   323k|                        auto content = key_it;
 4866|   323k|                        yaml::skip_to_content(content, end);
 4867|   323k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   323k|                        if (content != end && *content == '&') {
 4873|   323k|                           auto anchor_probe = content + 1;
 4874|   323k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|   323k|                           if (!anchor_name.empty()) {
 4876|   323k|                              auto after_anchor = anchor_probe;
 4877|   323k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|   323k|                              auto value_indicator = after_anchor;
 4880|   323k|                              if (value_indicator != end && *value_indicator == ':') {
 4881|   323k|                                 key.clear();
 4882|   323k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|   323k|                                 it = value_indicator;
 4884|   323k|                                 handled_anchor_only_empty_key = true;
 4885|   323k|                              }
 4886|   323k|                              else {
 4887|   323k|                                 if (value_indicator != end && *value_indicator == '#') {
 4888|   323k|                                    yaml::skip_comment(value_indicator, end);
 4889|   323k|                                 }
 4890|   323k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
 4891|   323k|                                    yaml::skip_newline(value_indicator, end);
 4892|   323k|                                    auto value_line = value_indicator;
 4893|   323k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|   323k|                                    if (bool(ctx.error)) [[unlikely]]
 4895|   323k|                                       return false;
 4896|   323k|                                    if (value_line != end && *value_line == ':' &&
 4897|   323k|                                        value_indent == explicit_value_indicator_indent) {
 4898|   323k|                                       key.clear();
 4899|   323k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|   323k|                                       it = value_line;
 4901|   323k|                                       handled_anchor_only_empty_key = true;
 4902|   323k|                                    }
 4903|   323k|                                    else if (value_line != end && *value_line == ':') {
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|   323k|                                       ctx.error = error_code::syntax_error;
 4908|   323k|                                       return false;
 4909|   323k|                                    }
 4910|   323k|                                 }
 4911|   323k|                              }
 4912|   323k|                           }
 4913|   323k|                        }
 4914|       |
 4915|   323k|                        const bool key_content_spans_lines = [&] {
 4916|   323k|                           auto scan = key_it;
 4917|   323k|                           while (scan != content && scan != end) {
 4918|   323k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   323k|                              ++scan;
 4920|   323k|                           }
 4921|   323k|                           return false;
 4922|   323k|                        }();
 4923|       |
 4924|   323k|                        if (handled_anchor_only_empty_key) {
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|   323k|                        }
 4927|   323k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
 4928|   323k|                           key.clear();
 4929|   323k|                           it = content;
 4930|   323k|                        }
 4931|   323k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   323k|                           auto key_node_it = content;
 4937|   323k|                           auto key_node_end = end;
 4938|   323k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   323k|                              auto scan = content;
 4943|   323k|                              while (scan != end) {
 4944|   323k|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
 4945|   323k|                                    ++scan;
 4946|   323k|                                 }
 4947|   323k|                                 if (scan == end) {
 4948|   323k|                                    break;
 4949|   323k|                                 }
 4950|       |
 4951|   323k|                                 yaml::skip_newline(scan, end);
 4952|   323k|                                 auto line_start = scan;
 4953|       |
 4954|   323k|                                 int32_t indicator_indent = 0;
 4955|   323k|                                 while (scan != end && *scan == ' ') {
 4956|   323k|                                    ++indicator_indent;
 4957|   323k|                                    ++scan;
 4958|   323k|                                 }
 4959|       |
 4960|   323k|                                 if (scan != end && *scan == ':') {
 4961|   323k|                                    const auto after_colon = scan + 1;
 4962|   323k|                                    if ((after_colon == end ||
 4963|   323k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
 4964|   323k|                                        indicator_indent <= line_indent) {
 4965|   323k|                                       key_node_end = line_start;
 4966|   323k|                                       break;
 4967|   323k|                                    }
 4968|   323k|                                 }
 4969|   323k|                              }
 4970|   323k|                           }
 4971|       |
 4972|   323k|                           glz::generic key_node{};
 4973|   323k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   323k|                           ctx.explicit_mapping_key_context = true;
 4975|   323k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   323k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   323k|                           if (bool(ctx.error)) [[unlikely]]
 4978|   323k|                              return false;
 4979|   323k|                           it = key_node_it;
 4980|   323k|                           if (!to_string_key(key_node)) [[unlikely]]
 4981|   323k|                              return false;
 4982|   323k|                        }
 4983|   323k|                     }
 4984|   323k|                     else {
 4985|   323k|                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|   323k|                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|   323k|                           if (bool(ctx.error)) [[unlikely]]
 4988|   323k|                              return false;
 4989|   323k|                        }
 4990|   323k|                     }
 4991|       |
 4992|   323k|                     yaml::skip_inline_ws(it, end);
 4993|   323k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   323k|                     if (it != end && (*it == '\n' || *it == '\r')) {
 4997|   323k|                        auto probe = it;
 4998|   323k|                        bool found_value_indicator = false;
 4999|       |
 5000|   323k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
 5001|   323k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|   323k|                           auto value_line = probe;
 5004|   323k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|   323k|                           if (bool(ctx.error)) [[unlikely]]
 5006|   323k|                              return false;
 5007|       |
 5008|   323k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
 5009|   323k|                              probe = value_line;
 5010|   323k|                              continue; // blank line
 5011|   323k|                           }
 5012|   323k|                           if (*value_line == '#') {
 5013|   323k|                              yaml::skip_comment(value_line, end);
 5014|   323k|                              probe = value_line;
 5015|   323k|                              continue; // comment-only line
 5016|   323k|                           }
 5017|   323k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
 5018|   323k|                              it = value_line;
 5019|   323k|                              found_value_indicator = true;
 5020|   323k|                           }
 5021|   323k|                           break;
 5022|   323k|                        }
 5023|       |
 5024|   323k|                        if (found_value_indicator) {
 5025|   323k|                           yaml::skip_inline_ws(it, end);
 5026|   323k|                        }
 5027|   323k|                     }
 5028|       |
 5029|   323k|                     val_t val{};
 5030|   323k|                     if (it != end && *it == ':') {
 5031|   323k|                        ++it;
 5032|   323k|                        if (it != end && *it == '\t') {
 5033|   323k|                           ctx.error = error_code::syntax_error;
 5034|   323k|                           return false;
 5035|   323k|                        }
 5036|   323k|                        if (it != end && (*it == '\n' || *it == '\r')) {
 5037|   323k|                           auto probe = it;
 5038|   323k|                           yaml::skip_newline(probe, end);
 5039|   323k|                           while (probe != end && *probe == ' ') ++probe;
 5040|   323k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
 5041|   323k|                              ctx.error = error_code::syntax_error;
 5042|   323k|                              return false;
 5043|   323k|                           }
 5044|   323k|                        }
 5045|   323k|                        yaml::skip_inline_ws(it, end);
 5046|   323k|                        if (!parse_map_value(val)) [[unlikely]]
 5047|   323k|                           return false;
 5048|   323k|                     }
 5049|       |
 5050|   323k|                     value.emplace(std::move(key), std::move(val));
 5051|   323k|                     return true;
 5052|   323k|                  }
 5053|       |
 5054|   323k|                  key_t key{};
 5055|   323k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   323k|                     auto key_probe = it;
 5057|   323k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   323k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
 5059|   323k|                     if (complex_flow_key) {
 5060|   323k|                        glz::generic key_node{};
 5061|   323k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|   323k|                        if (bool(ctx.error)) [[unlikely]]
 5063|   323k|                           return false;
 5064|   323k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
 5065|   323k|                           return false;
 5066|   323k|                     }
 5067|   323k|                     else {
 5068|   323k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
 5069|   323k|                           return false;
 5070|   323k|                        }
 5071|   323k|                     }
 5072|   323k|                  }
 5073|   323k|                  else {
 5074|   323k|                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|   323k|                     if (bool(ctx.error)) [[unlikely]]
 5076|   323k|                        return false;
 5077|   323k|                  }
 5078|       |
 5079|   323k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   323k|                  if (it == end || *it != ':') {
 5082|   323k|                     ctx.error = error_code::syntax_error;
 5083|   323k|                     return false;
 5084|   323k|                  }
 5085|   323k|                  ++it;
 5086|   323k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   323k|                  val_t val{};
 5089|   323k|                  if (!parse_map_value(val)) [[unlikely]]
 5090|   323k|                     return false;
 5091|       |
 5092|   323k|                  value.emplace(std::move(key), std::move(val));
 5093|   323k|                  return true;
 5094|   323k|               });
 5095|   323k|         }
 5096|       |
 5097|   960k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 5098|   960k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1ELb1EEELb0ERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_ZNS_4fromILj450ES8_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSC_S9_TkNS_10is_contextERSA_SC_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSL_RSO_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   999k|      {
  466|   999k|         skip_inline_ws(it, end);
  467|       |
  468|   999k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1, False: 999k]
  ------------------
  469|      1|            if constexpr (!AllowEmptyInput) {
  470|      1|               ctx.error = error_code::unexpected_end;
  471|      1|            }
  472|      1|            return true;
  473|      1|         }
  474|       |
  475|   999k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   999k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 2, False: 999k]
  ------------------
  477|      2|            ctx.error = error_code::syntax_error;
  478|      2|            return true;
  479|      2|         }
  480|   999k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 999k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   999k|         skip_inline_ws(it, end);
  486|       |
  487|   999k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 3, False: 999k]
  ------------------
  488|      3|            if constexpr (!AllowEmptyInput) {
  489|      3|               ctx.error = error_code::unexpected_end;
  490|      3|            }
  491|      3|            return true;
  492|      3|         }
  493|       |
  494|   999k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 5.69k, False: 993k]
  ------------------
  495|  5.69k|            return true;
  496|  5.69k|         }
  497|       |
  498|   993k|         return false;
  499|   999k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlNS8_8yaml_tagEE_clESN_:
 4521|   999k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_map(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1ELb1EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES4_EEEENS0_12yaml_contextEPKcSC_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   999k|      {
  409|   999k|         state.has_anchor = false;
  410|   999k|         state.anchor_name.clear();
  411|   999k|         state.anchor_start = nullptr;
  412|   999k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   999k|         if constexpr (Policy.allow_alias) {
  415|   999k|            if constexpr (Policy.alias_can_be_mapping_key) {
  416|   999k|               if (!alias_token_is_mapping_key(it, end)) {
  ------------------
  |  Branch (416:20): [True: 999k, False: 221]
  ------------------
  417|   999k|                  if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (417:23): [True: 5.68k, False: 993k]
  ------------------
  418|   999k|               }
  419|       |            }
  420|       |            else {
  421|       |               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  422|       |            }
  423|   999k|         }
  424|       |
  425|   999k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 993k, False: 5.68k]
  |  Branch (425:27): [True: 6.81k, False: 986k]
  ------------------
  426|  6.81k|            ++it;
  427|  6.81k|            auto name = parse_anchor_name(it, end);
  428|  6.81k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 5, False: 6.81k]
  ------------------
  429|      5|               ctx.error = error_code::syntax_error;
  430|      5|               return true;
  431|      5|            }
  432|  6.81k|            skip_inline_ws(it, end);
  433|  6.81k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 7, False: 6.80k]
  ------------------
  434|      7|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|      7|                  ctx.error = error_code::unexpected_end;
  436|      7|               }
  437|      7|               return true;
  438|      7|            }
  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.80k|            state.has_anchor = true;
  446|  6.80k|            state.anchor_name = std::string(name);
  447|  6.80k|            state.anchor_start = &*it;
  448|  6.80k|         }
  449|       |
  450|   999k|         return false;
  451|   999k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES3_EEEENS0_12yaml_contextEPKcSB_EEbOT0_RT1_RT2_T3_:
  300|   999k|      {
  301|   999k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 999k]
  |  Branch (301:27): [True: 993k, False: 5.68k]
  ------------------
  302|       |
  303|  5.68k|         ++it; // skip '*'
  304|  5.68k|         auto name = parse_anchor_name(it, end);
  305|  5.68k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 12, False: 5.67k]
  ------------------
  306|     12|            ctx.error = error_code::syntax_error;
  307|     12|            return true;
  308|     12|         }
  309|       |
  310|  5.67k|         auto anchor_it = ctx.anchors.find(name);
  311|  5.67k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 50, False: 5.62k]
  ------------------
  312|     50|            ctx.error = error_code::syntax_error; // undefined alias
  313|     50|            return true;
  314|     50|         }
  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.62k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  5.62k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 490, False: 5.13k]
  ------------------
  322|    490|            return true;
  323|    490|         }
  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.13k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 3, False: 5.13k]
  ------------------
  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.13k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  5.13k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 5.13k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  5.13k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 5.13k]
  ------------------
  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.13k|         auto replay_it = span.begin;
  348|  5.13k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  5.13k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  5.13k|         ctx.indent_stack.clear();
  353|  5.13k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 254, False: 4.87k]
  ------------------
  354|    254|            ctx.push_indent(span.base_indent - 1);
  355|    254|         }
  356|       |
  357|  5.13k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  5.13k|         using V = std::remove_cvref_t<T>;
  360|  5.13k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  5.13k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  5.13k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  5.13k|         return true;
  367|  5.13k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|  2.28M|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|  2.28M|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|  2.28M|                     val = glz::generic{};
 4665|  2.28M|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|  2.28M|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj33EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3633|   323k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   323k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 323k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   323k|         const int32_t parent_indent = ctx.current_indent();
 3644|   323k|         const bool discover_indent = (mapping_indent < 0);
 3645|   323k|         bool first_key = !discover_indent;
 3646|   323k|         bool discovered_first_key_mid_line = false;
 3647|   323k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|   720k|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 437k, False: 283k]
  ------------------
 3650|   437k|            auto line_start = it;
 3651|   437k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 437k]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|   501k|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 494k, False: 6.83k]
  ------------------
 3655|   494k|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 15.5k, False: 478k]
  ------------------
 3656|  15.5k|                  skip_comment(it, end);
 3657|  15.5k|                  skip_newline(it, end);
 3658|  15.5k|                  first_key = false;
 3659|  15.5k|                  line_indent = 0;
 3660|  15.5k|               }
 3661|   478k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 13.7k, False: 465k]
  |  Branch (3661:40): [True: 18.5k, False: 446k]
  ------------------
 3662|  32.2k|                  skip_newline(it, end);
 3663|  32.2k|                  first_key = false;
 3664|  32.2k|                  line_indent = 0;
 3665|  32.2k|               }
 3666|   446k|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 60.1k, False: 386k]
  ------------------
 3667|  60.1k|                  line_start = it;
 3668|  60.1k|                  line_indent = 0;
 3669|   154k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 153k, False: 1.13k]
  |  Branch (3669:39): [True: 94.2k, False: 59.0k]
  ------------------
 3670|  94.2k|                     ++line_indent;
 3671|  94.2k|                     ++it;
 3672|  94.2k|                  }
 3673|       |
 3674|  60.1k|                  bool saw_tab = false;
 3675|  71.4k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 70.0k, False: 1.39k]
  |  Branch (3675:40): [True: 5.80k, False: 64.2k]
  |  Branch (3675:54): [True: 5.47k, False: 58.7k]
  ------------------
 3676|  11.2k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 9.86k, False: 1.41k]
  |  Branch (3676:43): [True: 1.41k, False: 0]
  ------------------
 3677|  11.2k|                     ++it;
 3678|  11.2k|                  }
 3679|       |
 3680|  60.1k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 1.39k, False: 58.7k]
  |  Branch (3680:36): [True: 3.81k, False: 54.9k]
  |  Branch (3680:51): [True: 2.97k, False: 51.9k]
  |  Branch (3680:66): [True: 2.09k, False: 49.8k]
  ------------------
 3681|  10.2k|                     first_key = false;
 3682|  10.2k|                     line_indent = 0;
 3683|  10.2k|                     continue; // Blank or comment line
 3684|  10.2k|                  }
 3685|       |
 3686|  49.8k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 27, False: 49.8k]
  ------------------
 3687|     27|                     ctx.error = error_code::syntax_error;
 3688|     27|                     return;
 3689|     27|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|  49.8k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 48.3k, False: 1.49k]
  |  Branch (3692:46): [True: 127, False: 48.2k]
  ------------------
 3693|    127|                     it = line_start;
 3694|    127|                     return;
 3695|    127|                  }
 3696|       |
 3697|  49.7k|                  first_key = false;
 3698|  49.7k|                  break; // Found content
 3699|  49.8k|               }
 3700|   386k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 5.46k, False: 380k]
  ------------------
 3701|  5.46k|                  line_start = it;
 3702|  18.5k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 17.5k, False: 1.08k]
  |  Branch (3702:40): [True: 3.36k, False: 14.1k]
  |  Branch (3702:54): [True: 9.75k, False: 4.38k]
  ------------------
 3703|  5.46k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 1.08k, False: 4.38k]
  |  Branch (3703:36): [True: 1.88k, False: 2.50k]
  |  Branch (3703:51): [True: 404, False: 2.09k]
  |  Branch (3703:66): [True: 2.07k, False: 27]
  ------------------
 3704|  5.43k|                     first_key = false;
 3705|  5.43k|                     line_indent = 0;
 3706|  5.43k|                     continue; // Blank or comment-only line with tab indentation
 3707|  5.43k|                  }
 3708|     27|                  ctx.error = error_code::syntax_error;
 3709|     27|                  return;
 3710|  5.46k|               }
 3711|   380k|               else {
 3712|   380k|                  line_start = it;
 3713|   380k|                  break; // Content at column 0
 3714|   380k|               }
 3715|   494k|            }
 3716|       |
 3717|   437k|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 6.83k, False: 430k]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|   430k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 1.24k, False: 429k]
  |  Branch (3721:45): [True: 1.61k, False: 427k]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|   427k|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 427k, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|   427k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 427k, False: 0]
  |  Branch (3728:39): [True: 104k, False: 323k]
  |  Branch (3728:62): [True: 35.7k, False: 68.3k]
  |  Branch (3728:84): [True: 23.0k, False: 12.7k]
  ------------------
 3729|  23.0k|                  it = line_start;
 3730|  23.0k|                  return;
 3731|  23.0k|               }
 3732|   404k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 81.0k, False: 323k]
  |  Branch (3732:43): [True: 64, False: 80.9k]
  ------------------
 3733|     64|                  it = line_start;
 3734|     64|                  return;
 3735|     64|               }
 3736|   404k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   404k|            bool established_mapping_indent_this_line = false;
 3740|   404k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 323k, False: 80.9k]
  ------------------
 3741|   323k|               mapping_indent = line_indent;
 3742|   323k|               established_mapping_indent_this_line = true;
 3743|   323k|               discovered_first_key_visual_indent = line_indent;
 3744|   323k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   323k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 323k, False: 0]
  |  Branch (3745:43): [True: 323k, False: 0]
  ------------------
 3746|   323k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   323k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 193, False: 323k]
  ------------------
 3748|    193|                        ctx.error = error_code::syntax_error;
 3749|    193|                        return;
 3750|    193|                     }
 3751|       |
 3752|   323k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   323k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 321k, False: 1.49k]
  |  Branch (3753:49): [True: 236k, False: 85.0k]
  ------------------
 3754|   236k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   236k|                     }
 3756|   323k|                  }
 3757|   323k|               }
 3758|   323k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   404k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 404k, False: 193]
  |  Branch (3762:36): [True: 404k, False: 0]
  |  Branch (3762:59): [True: 80.9k, False: 323k]
  ------------------
 3763|  80.9k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 17.9k, False: 63.0k]
  ------------------
 3764|  17.9k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 17.7k, False: 261]
  |  Branch (3764:43): [True: 10.3k, False: 7.31k]
  ------------------
 3765|  10.3k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 9, False: 10.3k]
  ------------------
 3766|      9|                     ctx.error = error_code::syntax_error;
 3767|      9|                     return;
 3768|      9|                  }
 3769|  10.3k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 652, False: 9.72k]
  ------------------
 3770|    652|                     it = line_start;
 3771|    652|                     return;
 3772|    652|                  }
 3773|  10.3k|               }
 3774|  7.57k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 521, False: 7.05k]
  ------------------
 3775|    521|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 30, False: 491]
  |  Branch (3775:47): [True: 1, False: 490]
  ------------------
 3776|    490|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 490, False: 0]
  |  Branch (3776:49): [True: 490, False: 0]
  |  Branch (3776:72): [True: 2, False: 488]
  ------------------
 3777|     33|                  ctx.error = error_code::syntax_error;
 3778|     33|                  return;
 3779|     33|               }
 3780|  17.9k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   403k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 403k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   403k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 403k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   403k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 193, False: 403k]
  |  Branch (3798:32): [True: 0, False: 403k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   403k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 91.1k, False: 312k]
  |  Branch (3807:53): [True: 9.29k, False: 81.8k]
  |  Branch (3807:94): [True: 1.69k, False: 7.59k]
  ------------------
 3808|  1.69k|               const auto after_colon = it + 1;
 3809|  1.69k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 1.34k, False: 348]
  ------------------
 3810|  1.69k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 73, False: 1.62k]
  |  Branch (3810:43): [True: 1.24k, False: 378]
  ------------------
 3811|  1.31k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 95, False: 1.22k]
  ------------------
 3812|     95|                  it = line_start;
 3813|     95|                  return;
 3814|     95|               }
 3815|  1.69k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   403k|            int32_t effective_line_indent = line_indent;
 3819|   403k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 403k, False: 193]
  |  Branch (3819:36): [True: 323k, False: 80.1k]
  ------------------
 3820|   323k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 236k, False: 86.5k]
  ------------------
 3821|   236k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 193k, False: 43.1k]
  |  Branch (3821:52): [True: 114k, False: 79.2k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   122k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   122k|            }
 3834|       |
 3835|   403k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 6.65k, False: 397k]
  ------------------
 3836|  6.65k|               return;
 3837|  6.65k|            }
 3838|   397k|            first_key = false;
 3839|       |
 3840|   397k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 397k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|   397k|            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|   397k|               auto flow_end = it;
 3847|   397k|               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|   397k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3848:20): [True: 58, False: 397k]
  ------------------
 3849|     58|                  return;
 3850|   397k|               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
  ------------------
  |  Branch (3850:20): [True: 321k, False: 75.1k]
  |  Branch (3850:40): [True: 175k, False: 146k]
  |  Branch (3850:60): [True: 7.97k, False: 138k]
  |  Branch (3850:80): [True: 31.3k, False: 107k]
  ------------------
 3851|   214k|                  it = flow_end;
 3852|   214k|                  return;
 3853|   214k|               }
 3854|   397k|            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   397k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 127k, False: 269k]
  ------------------
 3860|   127k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 46.8k, False: 80.9k]
  |  Branch (3860:34): [True: 665, False: 80.3k]
  ------------------
 3861|  47.5k|                  auto peek = it;
 3862|  47.5k|                  skip_inline_ws(peek, end);
 3863|  47.5k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 42.6k, False: 4.84k]
  |  Branch (3863:38): [True: 41.0k, False: 1.65k]
  |  Branch (3863:55): [True: 40.6k, False: 419]
  |  Branch (3863:72): [True: 39.8k, False: 748]
  ------------------
 3864|  39.8k|                     continue; // At leading indent of new line
 3865|  39.8k|                  }
 3866|  47.5k|               }
 3867|  88.0k|               skip_inline_ws(it, end);
 3868|  88.0k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 83.1k, False: 4.84k]
  |  Branch (3868:33): [True: 3.69k, False: 79.4k]
  ------------------
 3869|  3.69k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  3.69k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 3.69k, False: 0]
  ------------------
 3871|  3.69k|                        const char prev = *(it - 1);
 3872|  3.69k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 2.13k, False: 1.56k]
  |  Branch (3872:44): [True: 1.34k, False: 790]
  |  Branch (3872:60): [True: 397, False: 944]
  |  Branch (3872:76): [True: 9, False: 388]
  ------------------
 3873|      9|                           ctx.error = error_code::syntax_error;
 3874|      9|                           return;
 3875|      9|                        }
 3876|  3.69k|                     }
 3877|  3.69k|                  }
 3878|  3.69k|               }
 3879|  3.68k|               skip_comment(it, end);
 3880|  88.0k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 83.1k, False: 4.88k]
  |  Branch (3880:34): [True: 24.8k, False: 58.2k]
  |  Branch (3880:49): [True: 28.1k, False: 30.0k]
  ------------------
 3881|  53.0k|                  skip_newline(it, end);
 3882|  53.0k|               }
 3883|  34.9k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 30.0k, False: 4.88k]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|  30.0k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|  30.0k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 379, False: 29.6k]
  ------------------
 3890|    379|                        ctx.error = error_code::syntax_error;
 3891|    379|                        return;
 3892|    379|                     }
 3893|  30.0k|                  }
 3894|  30.0k|               }
 3895|  88.0k|            }
 3896|   397k|         }
 3897|   323k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_i:
 4777|   403k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   403k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   403k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   403k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   403k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   403k|                           if (ctx.stream_begin) {
 4788|   403k|                              auto is_line_content_start = [&](auto pos) {
 4789|   403k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   403k|                              };
 4791|       |
 4792|   403k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   403k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   403k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   403k|                                 return line != end && *line == ':';
 4796|   403k|                              };
 4797|       |
 4798|   403k|                              if (!is_line_content_start(it) &&
 4799|   403k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   403k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   403k|                                 ctx.error = error_code::syntax_error;
 4802|   403k|                                 return false;
 4803|   403k|                              }
 4804|   403k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   403k|                           }
 4806|   403k|                        }
 4807|       |
 4808|   403k|                        if (*it == '-' &&
 4809|   403k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   403k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   403k|                           ctx.error = error_code::syntax_error;
 4813|   403k|                           return false;
 4814|   403k|                        }
 4815|       |
 4816|   403k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   403k|                           return false;
 4818|   403k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   403k|                        ctx.pop_indent();
 4820|   403k|                     }
 4821|   403k|                     else {
 4822|   403k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   403k|                        if (nested_indent >= 0) {
 4824|   403k|                           yaml::skip_to_content(it, end);
 4825|   403k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   403k|                              ctx.error = error_code::syntax_error;
 4827|   403k|                              return false;
 4828|   403k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   403k|                           const int32_t value_indent =
 4832|   403k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   403k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   403k|                              return false;
 4835|   403k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   403k|                           ctx.pop_indent();
 4837|   403k|                        }
 4838|   403k|                     }
 4839|   403k|                     return !bool(ctx.error);
 4840|   403k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   403k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 162k, False: 241k]
  |  Branch (4845:37): [True: 162k, False: 95]
  |  Branch (4845:58): [True: 2, False: 162k]
  ------------------
 4846|      2|                     ctx.error = error_code::syntax_error;
 4847|      2|                     return false;
 4848|      2|                  }
 4849|   403k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 162k, False: 241k]
  |  Branch (4849:38): [True: 95, False: 162k]
  |  Branch (4849:57): [True: 65.2k, False: 97.2k]
  |  Branch (4849:77): [True: 60.8k, False: 36.4k]
  |  Branch (4849:98): [True: 28.8k, False: 7.52k]
  ------------------
 4850|   155k|                     ++it; // skip '?'
 4851|   155k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   155k|                     const int32_t explicit_value_indicator_indent =
 4854|   155k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 89.4k, False: 65.5k]
  ------------------
 4855|       |
 4856|   155k|                     key_t key{};
 4857|   155k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   155k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   155k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   155k|                        };
 4861|       |
 4862|   155k|                        auto key_it = it;
 4863|   155k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   155k|                        auto content = key_it;
 4866|   155k|                        yaml::skip_to_content(content, end);
 4867|   155k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   155k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 148k, False: 6.53k]
  |  Branch (4872:47): [True: 49.6k, False: 98.8k]
  ------------------
 4873|  49.6k|                           auto anchor_probe = content + 1;
 4874|  49.6k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|  49.6k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 49.6k, False: 10]
  ------------------
 4876|  49.6k|                              auto after_anchor = anchor_probe;
 4877|  49.6k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|  49.6k|                              auto value_indicator = after_anchor;
 4880|  49.6k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 48.3k, False: 1.33k]
  |  Branch (4880:61): [True: 2.01k, False: 46.3k]
  ------------------
 4881|  2.01k|                                 key.clear();
 4882|  2.01k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  2.01k|                                 it = value_indicator;
 4884|  2.01k|                                 handled_anchor_only_empty_key = true;
 4885|  2.01k|                              }
 4886|  47.6k|                              else {
 4887|  47.6k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 46.3k, False: 1.33k]
  |  Branch (4887:64): [True: 851, False: 45.4k]
  ------------------
 4888|    851|                                    yaml::skip_comment(value_indicator, end);
 4889|    851|                                 }
 4890|  47.6k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 46.3k, False: 1.34k]
  |  Branch (4890:65): [True: 13.8k, False: 32.5k]
  |  Branch (4890:93): [True: 9.69k, False: 22.8k]
  ------------------
 4891|  23.4k|                                    yaml::skip_newline(value_indicator, end);
 4892|  23.4k|                                    auto value_line = value_indicator;
 4893|  23.4k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  23.4k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 1, False: 23.4k]
  ------------------
 4895|      1|                                       return false;
 4896|  23.4k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 22.6k, False: 872]
  |  Branch (4896:62): [True: 4.22k, False: 18.3k]
  ------------------
 4897|  4.22k|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 4.22k, False: 3]
  ------------------
 4898|  4.22k|                                       key.clear();
 4899|  4.22k|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|  4.22k|                                       it = value_line;
 4901|  4.22k|                                       handled_anchor_only_empty_key = true;
 4902|  4.22k|                                    }
 4903|  19.2k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 18.4k, False: 872]
  |  Branch (4903:67): [True: 3, False: 18.3k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|      3|                                       ctx.error = error_code::syntax_error;
 4908|      3|                                       return false;
 4909|      3|                                    }
 4910|  23.4k|                                 }
 4911|  47.6k|                              }
 4912|  49.6k|                           }
 4913|  49.6k|                        }
 4914|       |
 4915|   155k|                        const bool key_content_spans_lines = [&] {
 4916|   155k|                           auto scan = key_it;
 4917|   155k|                           while (scan != content && scan != end) {
 4918|   155k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   155k|                              ++scan;
 4920|   155k|                           }
 4921|   155k|                           return false;
 4922|   155k|                        }();
 4923|       |
 4924|   155k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 6.23k, False: 148k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  6.23k|                        }
 4927|   148k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 6.53k, False: 142k]
  |  Branch (4927:53): [True: 3.25k, False: 139k]
  |  Branch (4927:72): [True: 1.55k, False: 1.69k]
  ------------------
 4928|  8.09k|                           key.clear();
 4929|  8.09k|                           it = content;
 4930|  8.09k|                        }
 4931|   140k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   140k|                           auto key_node_it = content;
 4937|   140k|                           auto key_node_end = end;
 4938|   140k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   140k|                              auto scan = content;
 4943|  3.37M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 3.35M, False: 26.0k]
  ------------------
 4944|  83.5M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 83.5M, False: 81.5k]
  |  Branch (4944:56): [True: 82.0M, False: 1.46M]
  |  Branch (4944:73): [True: 80.2M, False: 1.80M]
  ------------------
 4945|  80.2M|                                    ++scan;
 4946|  80.2M|                                 }
 4947|  3.35M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 81.5k, False: 3.26M]
  ------------------
 4948|  81.5k|                                    break;
 4949|  81.5k|                                 }
 4950|       |
 4951|  3.26M|                                 yaml::skip_newline(scan, end);
 4952|  3.26M|                                 auto line_start = scan;
 4953|       |
 4954|  3.26M|                                 int32_t indicator_indent = 0;
 4955|  3.96M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 3.93M, False: 26.0k]
  |  Branch (4955:56): [True: 691k, False: 3.24M]
  ------------------
 4956|   691k|                                    ++indicator_indent;
 4957|   691k|                                    ++scan;
 4958|   691k|                                 }
 4959|       |
 4960|  3.26M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 3.24M, False: 26.0k]
  |  Branch (4960:53): [True: 80.8k, False: 3.16M]
  ------------------
 4961|  80.8k|                                    const auto after_colon = scan + 1;
 4962|  80.8k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 151, False: 80.6k]
  ------------------
 4963|  80.6k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 51.1k, False: 29.5k]
  ------------------
 4964|  51.2k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 33.1k, False: 18.1k]
  ------------------
 4965|  33.1k|                                       key_node_end = line_start;
 4966|  33.1k|                                       break;
 4967|  33.1k|                                    }
 4968|  80.8k|                                 }
 4969|  3.26M|                              }
 4970|   140k|                           }
 4971|       |
 4972|   140k|                           glz::generic key_node{};
 4973|   140k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   140k|                           ctx.explicit_mapping_key_context = true;
 4975|   140k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   140k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   140k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 1.14k, False: 139k]
  ------------------
 4978|  1.14k|                              return false;
 4979|   139k|                           it = key_node_it;
 4980|   139k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 6, False: 139k]
  ------------------
 4981|      6|                              return false;
 4982|   139k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   153k|                     yaml::skip_inline_ws(it, end);
 4993|   155k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   155k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 128k, False: 26.5k]
  |  Branch (4996:40): [True: 9.88k, False: 118k]
  |  Branch (4996:55): [True: 21.9k, False: 96.7k]
  ------------------
 4997|  31.8k|                        auto probe = it;
 4998|  31.8k|                        bool found_value_indicator = false;
 4999|       |
 5000|  63.6k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 54.6k, False: 9.07k]
  |  Branch (5000:49): [True: 19.0k, False: 35.5k]
  |  Branch (5000:67): [True: 35.5k, False: 0]
  ------------------
 5001|  54.6k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|  54.6k|                           auto value_line = probe;
 5004|  54.6k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|  54.6k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 2, False: 54.6k]
  ------------------
 5006|      2|                              return false;
 5007|       |
 5008|  54.6k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 7.73k, False: 46.8k]
  |  Branch (5008:53): [True: 5.98k, False: 40.8k]
  |  Branch (5008:76): [True: 10.3k, False: 30.5k]
  ------------------
 5009|  24.1k|                              probe = value_line;
 5010|  24.1k|                              continue; // blank line
 5011|  24.1k|                           }
 5012|  30.5k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 7.78k, False: 22.7k]
  ------------------
 5013|  7.78k|                              yaml::skip_comment(value_line, end);
 5014|  7.78k|                              probe = value_line;
 5015|  7.78k|                              continue; // comment-only line
 5016|  7.78k|                           }
 5017|  22.7k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 6.49k, False: 16.2k]
  |  Branch (5017:54): [True: 3.58k, False: 2.90k]
  ------------------
 5018|  3.58k|                              it = value_line;
 5019|  3.58k|                              found_value_indicator = true;
 5020|  3.58k|                           }
 5021|  22.7k|                           break;
 5022|  30.5k|                        }
 5023|       |
 5024|  31.8k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 3.58k, False: 28.2k]
  ------------------
 5025|  3.58k|                           yaml::skip_inline_ws(it, end);
 5026|  3.58k|                        }
 5027|  31.8k|                     }
 5028|       |
 5029|   155k|                     val_t val{};
 5030|   155k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 128k, False: 26.5k]
  |  Branch (5030:39): [True: 43.3k, False: 85.2k]
  ------------------
 5031|  43.3k|                        ++it;
 5032|  43.3k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 43.0k, False: 218]
  |  Branch (5032:42): [True: 13, False: 43.0k]
  ------------------
 5033|     13|                           ctx.error = error_code::syntax_error;
 5034|     13|                           return false;
 5035|     13|                        }
 5036|  43.2k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 43.0k, False: 218]
  |  Branch (5036:43): [True: 2.65k, False: 40.4k]
  |  Branch (5036:58): [True: 6.67k, False: 33.7k]
  ------------------
 5037|  9.33k|                           auto probe = it;
 5038|  9.33k|                           yaml::skip_newline(probe, end);
 5039|  27.7k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 27.1k, False: 590]
  |  Branch (5039:51): [True: 18.3k, False: 8.74k]
  ------------------
 5040|  9.33k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 8.74k, False: 590]
  |  Branch (5040:48): [True: 474, False: 8.26k]
  |  Branch (5040:65): [True: 473, False: 1]
  |  Branch (5040:89): [True: 1, False: 472]
  ------------------
 5041|      1|                              ctx.error = error_code::syntax_error;
 5042|      1|                              return false;
 5043|      1|                           }
 5044|  9.33k|                        }
 5045|  43.2k|                        yaml::skip_inline_ws(it, end);
 5046|  43.2k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 248, False: 43.0k]
  ------------------
 5047|    248|                           return false;
 5048|  43.2k|                     }
 5049|       |
 5050|   154k|                     value.emplace(std::move(key), std::move(val));
 5051|   154k|                     return true;
 5052|   155k|                  }
 5053|       |
 5054|   248k|                  key_t key{};
 5055|   248k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   248k|                     auto key_probe = it;
 5057|   248k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   248k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 248k, False: 0]
  |  Branch (5058:74): [True: 524, False: 248k]
  |  Branch (5058:95): [True: 561, False: 247k]
  ------------------
 5059|   248k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 1.08k, False: 247k]
  ------------------
 5060|  1.08k|                        glz::generic key_node{};
 5061|  1.08k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  1.08k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 518, False: 567]
  ------------------
 5063|    518|                           return false;
 5064|    567|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 0, False: 567]
  ------------------
 5065|      0|                           return false;
 5066|    567|                     }
 5067|   247k|                     else {
 5068|   247k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 138, False: 247k]
  ------------------
 5069|    138|                           return false;
 5070|    138|                        }
 5071|   247k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   247k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   248k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 1.00k, False: 247k]
  |  Branch (5081:36): [True: 197, False: 247k]
  ------------------
 5082|    542|                     ctx.error = error_code::syntax_error;
 5083|    542|                     return false;
 5084|    542|                  }
 5085|   248k|                  ++it;
 5086|   248k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   248k|                  val_t val{};
 5089|   248k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 4.04k, False: 243k]
  ------------------
 5090|  4.04k|                     return false;
 5091|       |
 5092|   243k|                  value.emplace(std::move(key), std::move(val));
 5093|   243k|                  return true;
 5094|   248k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlvE_clEv:
 4915|   155k|                        const bool key_content_spans_lines = [&] {
 4916|   155k|                           auto scan = key_it;
 4917|   171k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 109k, False: 61.5k]
  |  Branch (4917:54): [True: 109k, False: 0]
  ------------------
 4918|   109k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 61.5k, False: 48.1k]
  |  Branch (4918:52): [True: 32.0k, False: 16.1k]
  ------------------
 4919|  16.1k|                              ++scan;
 4920|  16.1k|                           }
 4921|  61.5k|                           return false;
 4922|   155k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4858|   139k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   139k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   139k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4778|   290k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   290k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 284k, False: 6.58k]
  |  Branch (4779:39): [True: 198k, False: 85.5k]
  ------------------
 4780|   198k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   198k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   198k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 198k, False: 0]
  ------------------
 4788|   198k|                              auto is_line_content_start = [&](auto pos) {
 4789|   198k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   198k|                              };
 4791|       |
 4792|   198k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   198k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   198k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   198k|                                 return line != end && *line == ':';
 4796|   198k|                              };
 4797|       |
 4798|   198k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 198k, False: 0]
  ------------------
 4799|   198k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 30.1k, False: 168k]
  ------------------
 4800|  30.1k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 94, False: 30.0k]
  ------------------
 4801|     94|                                 ctx.error = error_code::syntax_error;
 4802|     94|                                 return false;
 4803|     94|                              }
 4804|   198k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   198k|                           }
 4806|   198k|                        }
 4807|       |
 4808|   198k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 2.39k, False: 196k]
  ------------------
 4809|  2.39k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 404, False: 1.99k]
  |  Branch (4809:49): [True: 1.00k, False: 989]
  ------------------
 4810|  1.40k|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 6, False: 1.39k]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|      6|                           ctx.error = error_code::syntax_error;
 4813|      6|                           return false;
 4814|      6|                        }
 4815|       |
 4816|   198k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 198k]
  ------------------
 4817|      0|                           return false;
 4818|   198k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   198k|                        ctx.pop_indent();
 4820|   198k|                     }
 4821|  92.0k|                     else {
 4822|  92.0k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|  92.0k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 40.0k, False: 52.0k]
  ------------------
 4824|  40.0k|                           yaml::skip_to_content(it, end);
 4825|  40.0k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 40.0k, False: 0]
  |  Branch (4825:45): [True: 0, False: 40.0k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  40.0k|                           const int32_t value_indent =
 4832|  40.0k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 40.0k]
  ------------------
 4833|  40.0k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 40.0k]
  ------------------
 4834|      0|                              return false;
 4835|  40.0k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  40.0k|                           ctx.pop_indent();
 4837|  40.0k|                        }
 4838|  92.0k|                     }
 4839|   290k|                     return !bool(ctx.error);
 4840|   290k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_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_:
 4788|   198k|                              auto is_line_content_start = [&](auto pos) {
 4789|   198k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   198k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_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_:
 4792|   228k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   228k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   366k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 366k, False: 0]
  |  Branch (4794:57): [True: 137k, False: 229k]
  |  Branch (4794:73): [True: 429, False: 228k]
  ------------------
 4795|   228k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 228k, False: 0]
  |  Branch (4795:56): [True: 119k, False: 108k]
  ------------------
 4796|   228k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|   993k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   993k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 993k]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|   993k|            }
_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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|   387k|      {
 5206|   387k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|   387k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|   387k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|   387k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|   387k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 387k, False: 0]
  ------------------
 5216|   387k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|   387k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4098|   408k|      {
 4099|   408k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 408k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|   408k|         auto peek = it;
 4104|   408k|         yaml::node_preamble_state preamble{};
 4105|   408k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 21.7k, False: 386k]
  ------------------
 4106|   408k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  21.7k|            it = peek;
 4108|  21.7k|            return;
 4109|  21.7k|         }
 4110|       |
 4111|   386k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 54.5k, False: 332k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|  54.5k|            it = peek;
 4114|  54.5k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|  54.5k|         }
 4116|   332k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 332k, False: 80]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|   332k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 2.61k, False: 329k]
  |  Branch (4119:57): [True: 1.96k, False: 327k]
  ------------------
 4120|  4.58k|               it = peek;
 4121|  4.58k|            }
 4122|   332k|            int32_t seq_indent = ctx.current_indent();
 4123|   332k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 331k, False: 441]
  |  Branch (4123:31): [True: 66.5k, False: 265k]
  ------------------
 4124|  66.5k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 3.68k, False: 62.8k]
  |  Branch (4124:62): [True: 2.26k, False: 1.41k]
  ------------------
 4125|  66.5k|                                                          : (ctx.current_indent() + 1);
 4126|  66.5k|            }
 4127|   332k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|   332k|         }
 4129|     80|         else {
 4130|     80|            ctx.error = error_code::syntax_error;
 4131|     80|         }
 4132|       |
 4133|   386k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|   386k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1EEELb0ERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_ZNS_4fromILj450ESC_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSG_SD_TkNS_10is_contextERSE_SG_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSP_RSS_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|   408k|      {
  466|   408k|         skip_inline_ws(it, end);
  467|       |
  468|   408k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 2, False: 408k]
  ------------------
  469|      2|            if constexpr (!AllowEmptyInput) {
  470|      2|               ctx.error = error_code::unexpected_end;
  471|      2|            }
  472|      2|            return true;
  473|      2|         }
  474|       |
  475|   408k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|   408k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 1, False: 408k]
  ------------------
  477|      1|            ctx.error = error_code::syntax_error;
  478|      1|            return true;
  479|      1|         }
  480|   408k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 408k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|   408k|         skip_inline_ws(it, end);
  486|       |
  487|   408k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 408k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|   408k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 21.7k, False: 386k]
  ------------------
  495|  21.7k|            return true;
  496|  21.7k|         }
  497|       |
  498|   386k|         return false;
  499|   408k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_ENKUlNSC_8yaml_tagEE_clESR_:
 4106|   408k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEEXtlNS0_20node_property_policyELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|   408k|      {
  409|   408k|         state.has_anchor = false;
  410|   408k|         state.anchor_name.clear();
  411|   408k|         state.anchor_start = nullptr;
  412|   408k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|   408k|         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|   408k|            else {
  421|   408k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 21.6k, False: 386k]
  ------------------
  422|   408k|            }
  423|   408k|         }
  424|       |
  425|   408k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 386k, False: 21.6k]
  |  Branch (425:27): [True: 2.40k, False: 384k]
  ------------------
  426|  2.40k|            ++it;
  427|  2.40k|            auto name = parse_anchor_name(it, end);
  428|  2.40k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 4, False: 2.39k]
  ------------------
  429|      4|               ctx.error = error_code::syntax_error;
  430|      4|               return true;
  431|      4|            }
  432|  2.39k|            skip_inline_ws(it, end);
  433|  2.39k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 13, False: 2.38k]
  ------------------
  434|     13|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     13|                  ctx.error = error_code::unexpected_end;
  436|     13|               }
  437|     13|               return true;
  438|     13|            }
  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.38k|            state.has_anchor = true;
  446|  2.38k|            state.anchor_name = std::string(name);
  447|  2.38k|            state.anchor_start = &*it;
  448|  2.38k|         }
  449|       |
  450|   408k|         return false;
  451|   408k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|   408k|      {
  301|   408k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 408k]
  |  Branch (301:27): [True: 386k, False: 21.6k]
  ------------------
  302|       |
  303|  21.6k|         ++it; // skip '*'
  304|  21.6k|         auto name = parse_anchor_name(it, end);
  305|  21.6k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 2, False: 21.6k]
  ------------------
  306|      2|            ctx.error = error_code::syntax_error;
  307|      2|            return true;
  308|      2|         }
  309|       |
  310|  21.6k|         auto anchor_it = ctx.anchors.find(name);
  311|  21.6k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 27, False: 21.6k]
  ------------------
  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|  21.6k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  21.6k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 800, False: 20.8k]
  ------------------
  322|    800|            return true;
  323|    800|         }
  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|  20.8k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 3, False: 20.8k]
  ------------------
  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|  20.8k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  20.8k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 20.8k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  20.8k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 20.8k]
  ------------------
  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|  20.8k|         auto replay_it = span.begin;
  348|  20.8k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  20.8k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  20.8k|         ctx.indent_stack.clear();
  353|  20.8k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.82k, False: 19.0k]
  ------------------
  354|  1.82k|            ctx.push_indent(span.base_indent - 1);
  355|  1.82k|         }
  356|       |
  357|  20.8k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  20.8k|         using V = std::remove_cvref_t<T>;
  360|  20.8k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  20.8k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  20.8k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  20.8k|         return true;
  367|  20.8k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|  54.5k|      {
 2597|  54.5k|         using V = std::remove_cvref_t<T>;
 2598|  54.5k|         using value_type = typename V::value_type;
 2599|       |
 2600|  54.5k|         struct sequence_container_adapter
 2601|  54.5k|         {
 2602|  54.5k|            size_t index = 0;
 2603|       |
 2604|  54.5k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|  54.5k|            {
 2606|  54.5k|               if constexpr (!resizable<V>) {
 2607|  54.5k|                  return index >= container.size();
 2608|  54.5k|               }
 2609|  54.5k|               else {
 2610|  54.5k|                  (void)container;
 2611|  54.5k|                  return false;
 2612|  54.5k|               }
 2613|  54.5k|            }
 2614|       |
 2615|  54.5k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|  54.5k|            inline void append(V& container, value_type&& element) noexcept
 2618|  54.5k|            {
 2619|  54.5k|               if constexpr (emplace_backable<V>) {
 2620|  54.5k|                  container.emplace_back(std::move(element));
 2621|  54.5k|               }
 2622|  54.5k|               else if constexpr (emplaceable<V>) {
 2623|  54.5k|                  container.emplace(std::move(element));
 2624|  54.5k|               }
 2625|  54.5k|            }
 2626|  54.5k|         };
 2627|       |
 2628|  54.5k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 54.5k]
  |  Branch (2628:27): [True: 0, False: 54.5k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|  54.5k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|  54.5k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|  54.5k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|  54.5k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 10, False: 54.5k]
  ------------------
 2641|     10|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|  54.5k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 54.0k, False: 449]
  |  Branch (2644:27): [True: 7.51k, False: 46.5k]
  ------------------
 2645|  7.51k|            ++it;
 2646|  7.51k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  7.51k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 9, False: 7.50k]
  ------------------
 2648|      9|               return;
 2649|       |            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|       |               if (ctx.current_indent() < 0) {
 2651|       |                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|       |               }
 2653|       |            }
 2654|  7.50k|            return;
 2655|  7.51k|         }
 2656|       |
 2657|  47.0k|         bool just_saw_comma = false;
 2658|  47.0k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  47.0k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|  78.0k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 77.5k, False: 499]
  ------------------
 2663|  77.5k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|  77.5k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 77.5k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|  77.5k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 77.5k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|  77.5k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 5.54k, False: 71.9k]
  ------------------
 2673|  5.54k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 5.54k, False: 0]
  ------------------
 2674|  5.54k|                     ++it;
 2675|  5.54k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  5.54k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 8, False: 5.53k]
  ------------------
 2677|      8|                        return;
 2678|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|       |                        if (ctx.current_indent() < 0) {
 2680|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|       |                        }
 2682|       |                     }
 2683|  5.53k|                     return;
 2684|  5.54k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  5.54k|               }
 2688|       |
 2689|  71.9k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 182, False: 71.8k]
  |  Branch (2689:34): [True: 8, False: 71.7k]
  ------------------
 2690|    190|                  ctx.error = error_code::syntax_error;
 2691|    190|                  return;
 2692|    190|               }
 2693|  71.7k|               just_saw_comma = false;
 2694|       |
 2695|  71.7k|               value_type element{};
 2696|  71.7k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|  71.7k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 8.34k, False: 63.4k]
  ------------------
 2699|  8.34k|                  return;
 2700|       |
 2701|  63.4k|               bool saw_line_break_before_separator = false;
 2702|  63.4k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|  63.4k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 13, False: 63.4k]
  ------------------
 2704|     13|                  return;
 2705|       |
 2706|  63.4k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 62.6k, False: 797]
  |  Branch (2706:33): [True: 10.9k, False: 51.7k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  10.9k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 27, False: 10.8k]
  ------------------
 2709|     27|                     ctx.error = error_code::syntax_error;
 2710|     27|                     return;
 2711|     27|                  }
 2712|  10.8k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  10.8k|                     glz::generic key_node = std::move(element);
 2714|  10.8k|                     ++it;
 2715|  10.8k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  10.8k|                     glz::generic mapped{};
 2718|  10.8k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  10.8k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 495, False: 10.4k]
  ------------------
 2720|    495|                        return;
 2721|       |
 2722|  10.4k|                     std::string key;
 2723|  10.4k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 2, False: 10.4k]
  ------------------
 2724|      2|                        return;
 2725|       |
 2726|  10.4k|                     glz::generic pair{};
 2727|  10.4k|                     pair[key] = std::move(mapped);
 2728|  10.4k|                     element = std::move(pair);
 2729|       |
 2730|  10.4k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  10.4k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 3, False: 10.3k]
  ------------------
 2732|      3|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  10.8k|               }
 2739|       |
 2740|  63.4k|               adapter.append(value, std::move(element));
 2741|       |
 2742|  63.4k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 866, False: 62.5k]
  ------------------
 2743|    866|                  ctx.error = error_code::unexpected_end;
 2744|    866|                  return;
 2745|    866|               }
 2746|       |
 2747|  62.5k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 30.4k, False: 32.1k]
  ------------------
 2748|  30.4k|                  ++it;
 2749|  30.4k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  30.4k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 37, False: 30.3k]
  ------------------
 2751|     37|                     return;
 2752|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|       |                     if (ctx.current_indent() < 0) {
 2754|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|       |                     }
 2756|       |                  }
 2757|  30.3k|                  return;
 2758|  30.4k|               }
 2759|  32.1k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 31.0k, False: 1.12k]
  ------------------
 2760|  31.0k|                  ++it;
 2761|  31.0k|                  just_saw_comma = true;
 2762|  31.0k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  31.0k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 8, False: 31.0k]
  ------------------
 2764|      8|                     return;
 2765|  31.0k|               }
 2766|  1.12k|               else {
 2767|  1.12k|                  ctx.error = error_code::syntax_error;
 2768|  1.12k|                  return;
 2769|  1.12k|               }
 2770|  62.5k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  47.0k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|   386k|      {
 2581|   386k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|   386k|            if constexpr (!check_append_arrays(Opts)) {
 2584|   386k|               value.clear();
 2585|   386k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|   386k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|  62.9k|            {
 2619|  62.9k|               if constexpr (emplace_backable<V>) {
 2620|  62.9k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|  62.9k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|   332k|      {
 3082|   332k|         using V = std::remove_cvref_t<T>;
 3083|   332k|         using value_type = typename V::value_type;
 3084|       |
 3085|   332k|         struct sequence_container_adapter
 3086|   332k|         {
 3087|   332k|            size_t index = 0;
 3088|       |
 3089|   332k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|   332k|            {
 3091|   332k|               if constexpr (!resizable<V>) {
 3092|   332k|                  return index >= container.size();
 3093|   332k|               }
 3094|   332k|               else {
 3095|   332k|                  (void)container;
 3096|   332k|                  return false;
 3097|   332k|               }
 3098|   332k|            }
 3099|       |
 3100|   332k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|   332k|            inline void append(V& container, value_type&& element) noexcept
 3103|   332k|            {
 3104|   332k|               if constexpr (emplace_backable<V>) {
 3105|   332k|                  container.emplace_back(std::move(element));
 3106|   332k|               }
 3107|   332k|               else if constexpr (emplaceable<V>) {
 3108|   332k|                  container.emplace(std::move(element));
 3109|   332k|               }
 3110|   332k|            }
 3111|   332k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|   332k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|   332k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|   332k|         bool first_item = true;
 3122|   332k|         bool has_pending_item_anchor = false;
 3123|   332k|         std::string pending_item_anchor_name{};
 3124|   332k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|   694k|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 546k, False: 148k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|   546k|            int32_t line_indent = 0;
 3137|   546k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|   546k|            auto line_start = it;
 3139|       |
 3140|   708k|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 701k, False: 7.50k]
  ------------------
 3141|   701k|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 10.1k, False: 691k]
  ------------------
 3142|  10.1k|                  skip_comment(it, end);
 3143|  10.1k|                  skip_newline(it, end);
 3144|  10.1k|                  line_start = it;
 3145|  10.1k|                  line_indent = 0;
 3146|  10.1k|               }
 3147|   691k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 26.5k, False: 664k]
  |  Branch (3147:40): [True: 82.7k, False: 581k]
  ------------------
 3148|   109k|                  skip_newline(it, end);
 3149|   109k|                  line_start = it;
 3150|   109k|                  line_indent = 0;
 3151|   109k|               }
 3152|   581k|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 87.3k, False: 494k]
  ------------------
 3153|  87.3k|                  line_start = it;
 3154|  87.3k|                  line_indent = 0;
 3155|   307k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 306k, False: 1.08k]
  |  Branch (3155:39): [True: 220k, False: 86.2k]
  ------------------
 3156|   220k|                     ++line_indent;
 3157|   220k|                     ++it;
 3158|   220k|                  }
 3159|       |
 3160|  87.3k|                  bool saw_tab = false;
 3161|  95.5k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 93.8k, False: 1.72k]
  |  Branch (3161:40): [True: 4.12k, False: 89.6k]
  |  Branch (3161:54): [True: 4.05k, False: 85.6k]
  ------------------
 3162|  8.17k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 6.33k, False: 1.84k]
  |  Branch (3162:43): [True: 1.84k, False: 0]
  ------------------
 3163|  8.17k|                     ++it;
 3164|  8.17k|                  }
 3165|       |
 3166|  87.3k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 1.72k, False: 85.6k]
  |  Branch (3166:36): [True: 2.76k, False: 82.8k]
  |  Branch (3166:51): [True: 28.2k, False: 54.6k]
  |  Branch (3166:66): [True: 2.63k, False: 51.9k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|  35.4k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 33.6k, False: 1.72k]
  |  Branch (3168:39): [True: 2.63k, False: 31.0k]
  ------------------
 3169|  2.63k|                        skip_comment(it, end);
 3170|  2.63k|                     }
 3171|  35.4k|                     line_indent = 0;
 3172|  35.4k|                     continue;
 3173|  35.4k|                  }
 3174|       |
 3175|  51.9k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 9, False: 51.9k]
  ------------------
 3176|      9|                     ctx.error = error_code::syntax_error;
 3177|      9|                     return;
 3178|      9|                  }
 3179|  51.9k|                  break; // Found content
 3180|  51.9k|               }
 3181|   494k|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 8.01k, False: 486k]
  ------------------
 3182|  8.01k|                  line_start = it;
 3183|  17.5k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 16.9k, False: 590]
  |  Branch (3183:40): [True: 817, False: 16.1k]
  |  Branch (3183:54): [True: 8.70k, False: 7.42k]
  ------------------
 3184|  8.01k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 590, False: 7.42k]
  |  Branch (3184:36): [True: 286, False: 7.14k]
  |  Branch (3184:51): [True: 3.29k, False: 3.84k]
  |  Branch (3184:66): [True: 3.83k, False: 11]
  ------------------
 3185|  8.00k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 7.41k, False: 590]
  |  Branch (3185:39): [True: 3.83k, False: 3.58k]
  ------------------
 3186|  3.83k|                        skip_comment(it, end);
 3187|  3.83k|                     }
 3188|  8.00k|                     line_indent = 0;
 3189|  8.00k|                     continue;
 3190|  8.00k|                  }
 3191|     11|                  ctx.error = error_code::syntax_error;
 3192|     11|                  return;
 3193|  8.01k|               }
 3194|   486k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|   486k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 332k, False: 154k]
  |  Branch (3198:37): [True: 331k, False: 439]
  ------------------
 3199|   331k|                     line_indent = sequence_indent;
 3200|   331k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|   331k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 331k, False: 0]
  |  Branch (3201:49): [True: 331k, False: 0]
  ------------------
 3202|   331k|                           auto probe = it;
 3203|   331k|                           int32_t leading_ws = 0;
 3204|   331k|                           bool saw_tab = false;
 3205|   629k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 629k, False: 0]
  |  Branch (3205:64): [True: 292k, False: 337k]
  |  Branch (3205:87): [True: 5.53k, False: 331k]
  ------------------
 3206|   297k|                              --probe;
 3207|   297k|                              ++leading_ws;
 3208|   297k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 2.46k, False: 295k]
  |  Branch (3208:52): [True: 3.31k, False: 292k]
  ------------------
 3209|   297k|                           }
 3210|   331k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 0, False: 331k]
  |  Branch (3210:61): [True: 5.13k, False: 326k]
  |  Branch (3210:85): [True: 61.1k, False: 265k]
  ------------------
 3211|  66.2k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 1, False: 66.2k]
  ------------------
 3212|      1|                                 ctx.error = error_code::syntax_error;
 3213|      1|                                 return;
 3214|      1|                              }
 3215|  66.2k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|  66.2k|                           }
 3217|   331k|                        }
 3218|   331k|                     }
 3219|   331k|                  }
 3220|   331k|                  break;
 3221|   486k|               }
 3222|   701k|            }
 3223|       |
 3224|   546k|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 7.50k, False: 538k]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|   538k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 2.03k, False: 536k]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|   536k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 18.1k, False: 518k]
  ------------------
 3231|  18.1k|               it = line_start;
 3232|  18.1k|               return;
 3233|  18.1k|            }
 3234|       |
 3235|   518k|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 4.05k, False: 514k]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  4.05k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 7, False: 4.04k]
  ------------------
 3240|      7|                  ctx.error = error_code::syntax_error;
 3241|      7|                  return;
 3242|      7|               }
 3243|       |
 3244|  4.04k|               ++it;
 3245|  4.04k|               auto pending_name = parse_anchor_name(it, end);
 3246|  4.04k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 6, False: 4.04k]
  ------------------
 3247|      6|                  ctx.error = error_code::syntax_error;
 3248|      6|                  return;
 3249|      6|               }
 3250|  4.04k|               skip_inline_ws(it, end);
 3251|  4.04k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 4.01k, False: 32]
  |  Branch (3251:33): [True: 2.09k, False: 1.92k]
  ------------------
 3252|  2.09k|                  skip_comment(it, end);
 3253|  2.09k|               }
 3254|       |
 3255|  4.04k|               has_pending_item_anchor = true;
 3256|  4.04k|               pending_item_anchor_name = std::string(pending_name);
 3257|  4.04k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  4.04k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 41, False: 4.00k]
  |  Branch (3259:34): [True: 2.52k, False: 1.48k]
  |  Branch (3259:49): [True: 40, False: 2.48k]
  ------------------
 3260|     81|                  ctx.error = error_code::syntax_error;
 3261|     81|                  return;
 3262|     81|               }
 3263|       |
 3264|  3.96k|               skip_newline(it, end);
 3265|  3.96k|               continue;
 3266|  4.04k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|   514k|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 146k, False: 367k]
  ------------------
 3270|   146k|               it = line_start;
 3271|   146k|               return;
 3272|   146k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|   367k|            dash_col = line_indent;
 3278|   367k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|   367k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 367k, False: 1]
  ------------------
 3280|   367k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|   367k|               }
 3282|   367k|            }
 3283|       |
 3284|   367k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|   367k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 365k, False: 2.23k]
  |  Branch (3287:30): [True: 8.80k, False: 356k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|  8.80k|               it = line_start;
 3290|  8.80k|               return;
 3291|  8.80k|            }
 3292|       |
 3293|   358k|            bool saw_tab_after_dash = false;
 3294|  2.24M|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 2.23M, False: 4.75k]
  |  Branch (3294:34): [True: 1.71M, False: 523k]
  |  Branch (3294:48): [True: 169k, False: 354k]
  ------------------
 3295|  1.88M|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 1.30M, False: 573k]
  |  Branch (3295:59): [True: 132k, False: 441k]
  ------------------
 3296|  1.88M|               ++it;
 3297|  1.88M|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|   358k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 132k, False: 226k]
  |  Branch (3299:39): [True: 130k, False: 1.67k]
  |  Branch (3299:52): [True: 14.9k, False: 115k]
  ------------------
 3300|  14.9k|               const auto after_dash = it + 1;
 3301|  14.9k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 1, False: 14.9k]
  |  Branch (3301:41): [True: 3, False: 14.9k]
  ------------------
 3302|      4|                  ctx.error = error_code::syntax_error;
 3303|      4|                  return;
 3304|      4|               }
 3305|  14.9k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|   358k|            auto parse_element = [&](auto& element) {
 3309|   358k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|   358k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   358k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|   358k|                     return;
 3319|   358k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   358k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   358k|                  ctx.sequence_item_value_context = true;
 3322|   358k|                  ctx.sequence_dash_indent = dash_col;
 3323|   358k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   358k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   358k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   358k|                  ctx.pop_indent();
 3327|   358k|               }
 3328|   358k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   358k|                  skip_ws_and_comment(it, end);
 3331|   358k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   358k|                  auto nested_start = it;
 3335|   358k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   358k|                  if (bool(ctx.error)) [[unlikely]]
 3337|   358k|                     return;
 3338|   358k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   358k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|   358k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|   358k|                     const int32_t element_indent =
 3350|   358k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|   358k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|   358k|                        return;
 3353|   358k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|   358k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|   358k|                     ctx.sequence_item_value_context = true;
 3356|   358k|                     ctx.sequence_dash_indent = dash_col;
 3357|   358k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|   358k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|   358k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|   358k|                     ctx.pop_indent();
 3361|   358k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   358k|               }
 3364|       |
 3365|   358k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|   358k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|   358k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|   358k|                                                                      pending_item_anchor_indent};
 3369|   358k|                  has_pending_item_anchor = false;
 3370|   358k|               }
 3371|   358k|            };
 3372|       |
 3373|   358k|            if constexpr (emplace_backable<V>) {
 3374|   358k|               auto& element = value.emplace_back();
 3375|   358k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|   358k|            first_item = false;
 3394|       |
 3395|   358k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 248, False: 358k]
  ------------------
 3396|    248|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|   358k|         }
 3401|   332k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|   358k|            auto parse_element = [&](auto& element) {
 3309|   358k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 354k, False: 4.75k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|   358k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 354k, False: 4.75k]
  |  Branch (3312:33): [True: 236k, False: 117k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|   236k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 236k]
  ------------------
 3318|      0|                     return;
 3319|   236k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|   236k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|   236k|                  ctx.sequence_item_value_context = true;
 3322|   236k|                  ctx.sequence_dash_indent = dash_col;
 3323|   236k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|   236k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|   236k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|   236k|                  ctx.pop_indent();
 3327|   236k|               }
 3328|   122k|               else {
 3329|       |                  // Value on next line - nested block
 3330|   122k|                  skip_ws_and_comment(it, end);
 3331|   122k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|   122k|                  auto nested_start = it;
 3335|   122k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|   122k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 2, False: 122k]
  ------------------
 3337|      2|                     return;
 3338|   122k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|   122k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 63.1k, False: 59.3k]
  ------------------
 3344|   122k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 49.4k, False: 72.9k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  49.4k|                     const int32_t element_indent =
 3350|  49.4k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 49.4k]
  ------------------
 3351|  49.4k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 49.4k]
  ------------------
 3352|      0|                        return;
 3353|  49.4k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  49.4k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  49.4k|                     ctx.sequence_item_value_context = true;
 3356|  49.4k|                     ctx.sequence_dash_indent = dash_col;
 3357|  49.4k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  49.4k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  49.4k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  49.4k|                     ctx.pop_indent();
 3361|  49.4k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|   122k|               }
 3364|       |
 3365|   358k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 785, False: 358k]
  |  Branch (3365:47): [True: 746, False: 39]
  ------------------
 3366|    746|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 663, False: 83]
  ------------------
 3367|    746|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|    746|                                                                      pending_item_anchor_indent};
 3369|    746|                  has_pending_item_anchor = false;
 3370|    746|               }
 3371|   358k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_RNSI_12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5423|   702k|   {
 5424|   702k|      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|   702k|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|   702k|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|   702k|            int depth = 0;
 5432|   702k|            while (pos != stop) {
 5433|   702k|               const char c = *pos;
 5434|   702k|               if (c == '"' || c == '\'') {
 5435|   702k|                  const char quote = c;
 5436|   702k|                  ++pos;
 5437|   702k|                  while (pos != stop && *pos != quote) {
 5438|   702k|                     if (*pos == '\\' && quote == '"') {
 5439|   702k|                        ++pos;
 5440|   702k|                        if (pos != stop) ++pos;
 5441|   702k|                     }
 5442|   702k|                     else {
 5443|   702k|                        ++pos;
 5444|   702k|                     }
 5445|   702k|                  }
 5446|   702k|                  if (pos != stop) ++pos;
 5447|   702k|                  continue;
 5448|   702k|               }
 5449|   702k|               if (c == '[' || c == '{') {
 5450|   702k|                  ++depth;
 5451|   702k|                  ++pos;
 5452|   702k|                  continue;
 5453|   702k|               }
 5454|   702k|               if (c == ']' || c == '}') {
 5455|   702k|                  if (depth == 0) return false;
 5456|   702k|                  --depth;
 5457|   702k|                  ++pos;
 5458|   702k|                  continue;
 5459|   702k|               }
 5460|   702k|               if (c == ',' && depth == 0) return false;
 5461|   702k|               if (c == ':' && depth == 0) {
 5462|   702k|                  auto next = pos + 1;
 5463|   702k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|   702k|               }
 5465|   702k|               ++pos;
 5466|   702k|            }
 5467|   702k|            return false;
 5468|   702k|         };
 5469|       |
 5470|   702k|         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
  ------------------
  |  Branch (5470:14): [True: 191k, False: 510k]
  |  Branch (5470:49): [True: 11.8k, False: 498k]
  ------------------
 5471|   203k|            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5471:17): [True: 181k, False: 22.2k]
  ------------------
 5472|   181k|               return;
 5473|   181k|            }
 5474|  22.2k|            if (bool(ctx.error)) {
  ------------------
  |  Branch (5474:17): [True: 2.93k, False: 19.3k]
  ------------------
 5475|  2.93k|               return;
 5476|  2.93k|            }
 5477|  22.2k|         }
 5478|       |
 5479|   517k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|   517k|         return;
 5481|   702k|      }
 5482|       |
 5483|   702k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 0, False: 702k]
  ------------------
 5484|      0|         return;
 5485|      0|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|   702k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 0, False: 702k]
  ------------------
 5488|      0|         return;
 5489|      0|      }
 5490|   702k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|   702k|   }
_ZZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_RNSI_12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_ENKUlT_E_clISO_EEDaSX_:
 5427|   702k|         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|   702k|            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|   702k|            int depth = 0;
 5432|  32.6M|            while (pos != stop) {
  ------------------
  |  Branch (5432:20): [True: 32.4M, False: 211k]
  ------------------
 5433|  32.4M|               const char c = *pos;
 5434|  32.4M|               if (c == '"' || c == '\'') {
  ------------------
  |  Branch (5434:20): [True: 117k, False: 32.3M]
  |  Branch (5434:32): [True: 111k, False: 32.2M]
  ------------------
 5435|   229k|                  const char quote = c;
 5436|   229k|                  ++pos;
 5437|  24.2M|                  while (pos != stop && *pos != quote) {
  ------------------
  |  Branch (5437:26): [True: 24.1M, False: 89.3k]
  |  Branch (5437:41): [True: 23.9M, False: 139k]
  ------------------
 5438|  23.9M|                     if (*pos == '\\' && quote == '"') {
  ------------------
  |  Branch (5438:26): [True: 83.5k, False: 23.8M]
  |  Branch (5438:42): [True: 57.2k, False: 26.3k]
  ------------------
 5439|  57.2k|                        ++pos;
 5440|  57.2k|                        if (pos != stop) ++pos;
  ------------------
  |  Branch (5440:29): [True: 52.8k, False: 4.40k]
  ------------------
 5441|  57.2k|                     }
 5442|  23.9M|                     else {
 5443|  23.9M|                        ++pos;
 5444|  23.9M|                     }
 5445|  23.9M|                  }
 5446|   229k|                  if (pos != stop) ++pos;
  ------------------
  |  Branch (5446:23): [True: 139k, False: 89.3k]
  ------------------
 5447|   229k|                  continue;
 5448|   229k|               }
 5449|  32.2M|               if (c == '[' || c == '{') {
  ------------------
  |  Branch (5449:20): [True: 1.12M, False: 31.1M]
  |  Branch (5449:32): [True: 237k, False: 30.8M]
  ------------------
 5450|  1.36M|                  ++depth;
 5451|  1.36M|                  ++pos;
 5452|  1.36M|                  continue;
 5453|  1.36M|               }
 5454|  30.8M|               if (c == ']' || c == '}') {
  ------------------
  |  Branch (5454:20): [True: 39.7k, False: 30.8M]
  |  Branch (5454:32): [True: 80.6k, False: 30.7M]
  ------------------
 5455|   120k|                  if (depth == 0) return false;
  ------------------
  |  Branch (5455:23): [True: 42.5k, False: 77.8k]
  ------------------
 5456|  77.8k|                  --depth;
 5457|  77.8k|                  ++pos;
 5458|  77.8k|                  continue;
 5459|   120k|               }
 5460|  30.7M|               if (c == ',' && depth == 0) return false;
  ------------------
  |  Branch (5460:20): [True: 1.17M, False: 29.5M]
  |  Branch (5460:32): [True: 193k, False: 978k]
  ------------------
 5461|  30.5M|               if (c == ':' && depth == 0) {
  ------------------
  |  Branch (5461:20): [True: 588k, False: 29.9M]
  |  Branch (5461:32): [True: 254k, False: 334k]
  ------------------
 5462|   254k|                  auto next = pos + 1;
 5463|   254k|                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5463:26): [True: 7.26k, False: 247k]
  |  Branch (5463:41): [True: 104k, False: 142k]
  |  Branch (5463:57): [True: 27.6k, False: 114k]
  |  Branch (5463:74): [True: 17.9k, False: 96.8k]
  |  Branch (5463:91): [True: 34.2k, False: 62.5k]
  ------------------
 5464|   254k|               }
 5465|  30.3M|               ++pos;
 5466|  30.3M|            }
 5467|   211k|            return false;
 5468|   702k|         };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISN_EEDaSZ_:
 5848|  57.9k|            auto is_word_boundary = [&](const auto ptr) {
 5849|  57.9k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 3.54k, False: 54.3k]
  ------------------
 5850|  3.54k|                  return true;
 5851|  3.54k|               }
 5852|  54.3k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 41.0k, False: 13.3k]
  ------------------
 5853|  41.0k|                  auto next = ptr + 1;
 5854|  41.0k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 639, False: 40.3k]
  |  Branch (5854:43): [True: 1.03k, False: 39.3k]
  |  Branch (5854:59): [True: 13.4k, False: 25.9k]
  |  Branch (5854:76): [True: 2.35k, False: 23.5k]
  |  Branch (5854:93): [True: 12.4k, False: 11.1k]
  ------------------
 5855|  41.0k|               }
 5856|  13.3k|               return is_plain_scalar_boundary(*ptr);
 5857|  54.3k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5774|  13.3k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  13.3k|               switch (ch) {
 5776|    655|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 655, False: 12.7k]
  ------------------
 5777|  1.25k|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 604, False: 12.7k]
  ------------------
 5778|  6.26k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 5.00k, False: 8.36k]
  ------------------
 5779|  7.10k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 841, False: 12.5k]
  ------------------
 5780|  7.78k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 678, False: 12.6k]
  ------------------
 5781|  8.22k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 441, False: 12.9k]
  ------------------
 5782|  8.70k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 482, False: 12.8k]
  ------------------
 5783|  8.70k|                  return true;
 5784|  4.66k|               default:
  ------------------
  |  Branch (5784:16): [True: 4.66k, False: 8.70k]
  ------------------
 5785|  4.66k|                  return false;
 5786|  13.3k|               }
 5787|  13.3k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISN_EEDaSZ_:
 5789|  42.1k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|  42.1k|               if constexpr (yaml::check_flow_context(Opts)) {
 5791|  42.1k|                  return false;
 5792|  42.1k|               }
 5793|  42.1k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 0, False: 42.1k]
  ------------------
 5794|      0|                  return false;
 5795|      0|               }
 5796|  42.1k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 42.1k, False: 0]
  |  Branch (5796:40): [True: 0, False: 0]
  |  Branch (5796:61): [True: 0, False: 0]
  ------------------
 5797|      0|                  return false;
 5798|      0|               }
 5799|       |
 5800|  42.1k|               auto look = word_end;
 5801|  42.1k|               yaml::skip_newline(look, end);
 5802|  42.1k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 0, False: 42.1k]
  ------------------
 5803|      0|                  int32_t line_indent = 0;
 5804|      0|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 0, False: 0]
  |  Branch (5804:41): [True: 0, False: 0]
  ------------------
 5805|      0|                     ++line_indent;
 5806|      0|                     ++look;
 5807|      0|                  }
 5808|      0|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 0, False: 0]
  |  Branch (5808:38): [True: 0, False: 0]
  ------------------
 5809|      0|                     return false;
 5810|      0|                  }
 5811|      0|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 0, False: 0]
  |  Branch (5811:38): [True: 0, False: 0]
  |  Branch (5811:55): [True: 0, False: 0]
  ------------------
 5812|      0|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 0, False: 0]
  ------------------
 5813|      0|                        yaml::skip_newline(look, end);
 5814|      0|                        continue;
 5815|      0|                     }
 5816|      0|                     return false;
 5817|      0|                  }
 5818|      0|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 0, False: 0]
  ------------------
 5819|      0|                     yaml::skip_comment(look, end);
 5820|      0|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 0, False: 0]
  |  Branch (5820:42): [True: 0, False: 0]
  |  Branch (5820:59): [True: 0, False: 0]
  ------------------
 5821|      0|                        yaml::skip_newline(look, end);
 5822|      0|                        continue;
 5823|      0|                     }
 5824|      0|                     return false;
 5825|      0|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|      0|                  {
 5831|      0|                     auto scan = look;
 5832|      0|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 0, False: 0]
  |  Branch (5832:44): [True: 0, False: 0]
  |  Branch (5832:61): [True: 0, False: 0]
  ------------------
 5833|      0|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 0, False: 0]
  ------------------
 5834|      0|                           auto after_colon = scan + 1;
 5835|      0|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 0, False: 0]
  |  Branch (5835:54): [True: 0, False: 0]
  |  Branch (5835:77): [True: 0, False: 0]
  ------------------
 5836|      0|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 0, False: 0]
  |  Branch (5836:56): [True: 0, False: 0]
  ------------------
 5837|      0|                              return false;
 5838|      0|                           }
 5839|      0|                        }
 5840|      0|                        ++scan;
 5841|      0|                     }
 5842|      0|                  }
 5843|       |
 5844|      0|                  return line_indent > ctx.current_indent();
 5845|      0|               }
 5846|  42.1k|               return false;
 5847|  42.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_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5377|   317k|   {
 5378|   317k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   317k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   317k|         const bool could_be_mapping = [&] {
 5386|   317k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   317k|               return line_could_be_flow_mapping(it, end);
 5388|   317k|            }
 5389|   317k|            else {
 5390|   317k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   317k|            }
 5392|   317k|         }();
 5393|   317k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 123k, False: 193k]
  ------------------
 5394|   123k|            return false;
 5395|   123k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   193k|         auto temp_ctx = ctx.make_speculative();
 5398|   193k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   193k|                                                                                               end);
 5400|   193k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   193k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   193k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 188k, False: 5.48k]
  ------------------
 5403|   188k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   188k|            return true;
 5405|   188k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  5.48k|         ctx.error = temp_ctx.error;
 5410|  5.48k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  5.48k|         return false;
 5412|   193k|      }
 5413|   317k|   }
_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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj33EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5385|   317k|         const bool could_be_mapping = [&] {
 5386|   317k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   317k|               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|       |            else {
 5390|       |               return yaml::line_could_be_block_mapping(it, end);
 5391|       |            }
 5392|   317k|         }();
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRS4_E_clESN_:
 4658|   159k|               auto parse_implicit_null = [&](val_t& val) -> bool {
 4659|       |                  if constexpr (nullable_like<std::remove_cvref_t<val_t>>) {
 4660|       |                     val = {};
 4661|       |                     return true;
 4662|       |                  }
 4663|   159k|                  else if constexpr (std::same_as<std::remove_cvref_t<val_t>, glz::generic>) {
 4664|   159k|                     val = glz::generic{};
 4665|   159k|                     return true;
 4666|       |                  }
 4667|       |                  else {
 4668|       |                     static constexpr std::string_view null_value{"null"};
 4669|       |                     auto null_it = null_value.data();
 4670|       |                     from<YAML, val_t>::template op<yaml::flow_context_on<Opts>()>(
 4671|       |                        val, ctx, null_it, null_value.data() + null_value.size());
 4672|       |                     return !bool(ctx.error);
 4673|       |                  }
 4674|   159k|               };
_ZN3glz4yaml24parse_block_mapping_loopITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEENS0_12yaml_contextEPKcS5_ZNS_4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES7_EEEEE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj32EEERS5_RSB_TkNS_10is_contextERS3_S5_EEvOT1_OT2_OT0_T3_EUlRT_RSL_SH_iE_EEvSQ_RSH_SJ_iOSN_:
 3633|   271k|      {
 3634|       |         // A tagged-variant custom alternative hands its body (at the variant's own column) to a
 3635|       |         // discover-mode reader. Honor the known indent it published so continuation/dedent are
 3636|       |         // judged against the outer parent, not the body itself. One-shot: reset on observation.
 3637|   271k|         if (ctx.forced_block_mapping_indent >= 0) {
  ------------------
  |  Branch (3637:14): [True: 0, False: 271k]
  ------------------
 3638|      0|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3638:17): [True: 0, False: 0]
  ------------------
 3639|      0|               mapping_indent = ctx.forced_block_mapping_indent;
 3640|      0|            }
 3641|      0|            ctx.forced_block_mapping_indent = -1;
 3642|      0|         }
 3643|   271k|         const int32_t parent_indent = ctx.current_indent();
 3644|   271k|         const bool discover_indent = (mapping_indent < 0);
 3645|   271k|         bool first_key = !discover_indent;
 3646|   271k|         bool discovered_first_key_mid_line = false;
 3647|   271k|         int32_t discovered_first_key_visual_indent = 0;
 3648|       |
 3649|   694k|         while (it != end) {
  ------------------
  |  Branch (3649:17): [True: 529k, False: 165k]
  ------------------
 3650|   529k|            auto line_start = it;
 3651|   529k|            int32_t line_indent = first_key ? mapping_indent : 0;
  ------------------
  |  Branch (3651:35): [True: 0, False: 529k]
  ------------------
 3652|       |
 3653|       |            // Skip blank lines and comments, measure indent
 3654|   589k|            while (it != end) {
  ------------------
  |  Branch (3654:20): [True: 583k, False: 6.05k]
  ------------------
 3655|   583k|               if (*it == '#') {
  ------------------
  |  Branch (3655:20): [True: 13.2k, False: 570k]
  ------------------
 3656|  13.2k|                  skip_comment(it, end);
 3657|  13.2k|                  skip_newline(it, end);
 3658|  13.2k|                  first_key = false;
 3659|  13.2k|                  line_indent = 0;
 3660|  13.2k|               }
 3661|   570k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3661:25): [True: 8.70k, False: 561k]
  |  Branch (3661:40): [True: 28.1k, False: 533k]
  ------------------
 3662|  36.8k|                  skip_newline(it, end);
 3663|  36.8k|                  first_key = false;
 3664|  36.8k|                  line_indent = 0;
 3665|  36.8k|               }
 3666|   533k|               else if (*it == ' ') {
  ------------------
  |  Branch (3666:25): [True: 201k, False: 331k]
  ------------------
 3667|   201k|                  line_start = it;
 3668|   201k|                  line_indent = 0;
 3669|   540k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3669:26): [True: 539k, False: 722]
  |  Branch (3669:39): [True: 338k, False: 201k]
  ------------------
 3670|   338k|                     ++line_indent;
 3671|   338k|                     ++it;
 3672|   338k|                  }
 3673|       |
 3674|   201k|                  bool saw_tab = false;
 3675|   204k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3675:26): [True: 203k, False: 739]
  |  Branch (3675:40): [True: 1.19k, False: 202k]
  |  Branch (3675:54): [True: 1.44k, False: 201k]
  ------------------
 3676|  2.64k|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3676:32): [True: 1.59k, False: 1.04k]
  |  Branch (3676:43): [True: 1.04k, False: 0]
  ------------------
 3677|  2.64k|                     ++it;
 3678|  2.64k|                  }
 3679|       |
 3680|   201k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3680:23): [True: 739, False: 201k]
  |  Branch (3680:36): [True: 2.27k, False: 198k]
  |  Branch (3680:51): [True: 1.88k, False: 196k]
  |  Branch (3680:66): [True: 4.44k, False: 192k]
  ------------------
 3681|  9.34k|                     first_key = false;
 3682|  9.34k|                     line_indent = 0;
 3683|  9.34k|                     continue; // Blank or comment line
 3684|  9.34k|                  }
 3685|       |
 3686|   192k|                  if (saw_tab) {
  ------------------
  |  Branch (3686:23): [True: 56, False: 192k]
  ------------------
 3687|     56|                     ctx.error = error_code::syntax_error;
 3688|     56|                     return;
 3689|     56|                  }
 3690|       |
 3691|       |                  // Early dedent check
 3692|   192k|                  if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3692:23): [True: 191k, False: 1.22k]
  |  Branch (3692:46): [True: 294, False: 190k]
  ------------------
 3693|    294|                     it = line_start;
 3694|    294|                     return;
 3695|    294|                  }
 3696|       |
 3697|   192k|                  first_key = false;
 3698|   192k|                  break; // Found content
 3699|   192k|               }
 3700|   331k|               else if (*it == '\t') {
  ------------------
  |  Branch (3700:25): [True: 1.29k, False: 330k]
  ------------------
 3701|  1.29k|                  line_start = it;
 3702|  4.80k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3702:26): [True: 4.71k, False: 88]
  |  Branch (3702:40): [True: 935, False: 3.78k]
  |  Branch (3702:54): [True: 2.57k, False: 1.20k]
  ------------------
 3703|  1.29k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3703:23): [True: 88, False: 1.20k]
  |  Branch (3703:36): [True: 189, False: 1.01k]
  |  Branch (3703:51): [True: 555, False: 460]
  |  Branch (3703:66): [True: 391, False: 69]
  ------------------
 3704|  1.22k|                     first_key = false;
 3705|  1.22k|                     line_indent = 0;
 3706|  1.22k|                     continue; // Blank or comment-only line with tab indentation
 3707|  1.22k|                  }
 3708|     69|                  ctx.error = error_code::syntax_error;
 3709|     69|                  return;
 3710|  1.29k|               }
 3711|   330k|               else {
 3712|   330k|                  line_start = it;
 3713|   330k|                  break; // Content at column 0
 3714|   330k|               }
 3715|   583k|            }
 3716|       |
 3717|   528k|            if (it == end) break;
  ------------------
  |  Branch (3717:17): [True: 6.05k, False: 522k]
  ------------------
 3718|       |
 3719|       |            // Document boundaries terminate the current mapping in both discovered
 3720|       |            // and fixed-indent modes.
 3721|   522k|            if (at_document_end(it, end) || at_document_start(it, end)) break;
  ------------------
  |  Branch (3721:17): [True: 1.89k, False: 520k]
  |  Branch (3721:45): [True: 400, False: 520k]
  ------------------
 3722|       |
 3723|       |            // Dedent checks (skip on first key for struct case)
 3724|       |            // Must check BEFORE establishing mapping_indent so the first discovered key
 3725|       |            // isn't rejected by the parent_indent check (mapping_indent is still -1).
 3726|   520k|            if (!first_key) {
  ------------------
  |  Branch (3726:17): [True: 520k, False: 0]
  ------------------
 3727|       |               // Parent indent check for nested maps (only after mapping_indent established)
 3728|   520k|               if (discover_indent && mapping_indent >= 0 && parent_indent >= 0 && line_indent <= parent_indent) {
  ------------------
  |  Branch (3728:20): [True: 520k, False: 0]
  |  Branch (3728:39): [True: 249k, False: 271k]
  |  Branch (3728:62): [True: 115k, False: 133k]
  |  Branch (3728:84): [True: 77.3k, False: 38.6k]
  ------------------
 3729|  77.3k|                  it = line_start;
 3730|  77.3k|                  return;
 3731|  77.3k|               }
 3732|   443k|               if (mapping_indent >= 0 && line_indent < mapping_indent) {
  ------------------
  |  Branch (3732:20): [True: 172k, False: 271k]
  |  Branch (3732:43): [True: 16, False: 172k]
  ------------------
 3733|     16|                  it = line_start;
 3734|     16|                  return;
 3735|     16|               }
 3736|   443k|            }
 3737|       |
 3738|       |            // Establish mapping indent from first key (map case)
 3739|   443k|            bool established_mapping_indent_this_line = false;
 3740|   443k|            if (mapping_indent < 0) {
  ------------------
  |  Branch (3740:17): [True: 271k, False: 172k]
  ------------------
 3741|   271k|               mapping_indent = line_indent;
 3742|   271k|               established_mapping_indent_this_line = true;
 3743|   271k|               discovered_first_key_visual_indent = line_indent;
 3744|   271k|               if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3745|   271k|                  if (ctx.stream_begin && line_start > ctx.stream_begin) {
  ------------------
  |  Branch (3745:23): [True: 271k, False: 0]
  |  Branch (3745:43): [True: 267k, False: 3.08k]
  ------------------
 3746|   267k|                     const auto prefix = ctx.line_prefix_before(line_start);
 3747|   267k|                     if (prefix.has_tab) {
  ------------------
  |  Branch (3747:26): [True: 118, False: 267k]
  ------------------
 3748|    118|                        ctx.error = error_code::syntax_error;
 3749|    118|                        return;
 3750|    118|                     }
 3751|       |
 3752|   267k|                     discovered_first_key_mid_line = prefix.has_content;
 3753|   267k|                     if (mapping_indent == 0 && prefix.column > 0) {
  ------------------
  |  Branch (3753:26): [True: 266k, False: 1.22k]
  |  Branch (3753:49): [True: 202k, False: 64.5k]
  ------------------
 3754|   202k|                        discovered_first_key_visual_indent = prefix.column;
 3755|   202k|                     }
 3756|   267k|                  }
 3757|   271k|               }
 3758|   271k|            }
 3759|       |
 3760|       |            // In discovered-indent block mappings, sibling keys must stay at the same
 3761|       |            // indent level, except when the first key started mid-line (e.g. "--- k: v").
 3762|   443k|            if (discover_indent && mapping_indent >= 0 && !established_mapping_indent_this_line &&
  ------------------
  |  Branch (3762:17): [True: 443k, False: 118]
  |  Branch (3762:36): [True: 443k, False: 0]
  |  Branch (3762:59): [True: 172k, False: 270k]
  ------------------
 3763|   172k|                !discovered_first_key_mid_line) {
  ------------------
  |  Branch (3763:17): [True: 31.7k, False: 140k]
  ------------------
 3764|  31.7k|               if (mapping_indent == 0 && discovered_first_key_visual_indent > 0) {
  ------------------
  |  Branch (3764:20): [True: 31.4k, False: 331]
  |  Branch (3764:43): [True: 16.3k, False: 15.1k]
  ------------------
 3765|  16.3k|                  if (line_indent > discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3765:23): [True: 28, False: 16.2k]
  ------------------
 3766|     28|                     ctx.error = error_code::syntax_error;
 3767|     28|                     return;
 3768|     28|                  }
 3769|  16.2k|                  if (line_indent < discovered_first_key_visual_indent) {
  ------------------
  |  Branch (3769:23): [True: 800, False: 15.4k]
  ------------------
 3770|    800|                     it = line_start;
 3771|    800|                     return;
 3772|    800|                  }
 3773|  16.2k|               }
 3774|  15.4k|               else if (line_indent > mapping_indent &&
  ------------------
  |  Branch (3774:25): [True: 1.13k, False: 14.3k]
  ------------------
 3775|  1.13k|                        (parent_indent < 0 || mapping_indent > 0 ||
  ------------------
  |  Branch (3775:26): [True: 171, False: 967]
  |  Branch (3775:47): [True: 2, False: 965]
  ------------------
 3776|    965|                         (parent_indent >= 0 && mapping_indent == 0 && line_indent > (parent_indent + 1)))) {
  ------------------
  |  Branch (3776:27): [True: 965, False: 0]
  |  Branch (3776:49): [True: 965, False: 0]
  |  Branch (3776:72): [True: 8, False: 957]
  ------------------
 3777|    181|                  ctx.error = error_code::syntax_error;
 3778|    181|                  return;
 3779|    181|               }
 3780|  31.7k|            }
 3781|       |
 3782|       |            // Sequence indicator check (struct case only - map parser lets key parsing
 3783|       |            // handle '- ' which produces appropriate errors for misindented items)
 3784|   442k|            if (!discover_indent && *it == '-' &&
  ------------------
  |  Branch (3784:17): [True: 0, False: 442k]
  |  Branch (3784:37): [True: 0, False: 0]
  ------------------
 3785|      0|                ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n')) {
  ------------------
  |  Branch (3785:18): [True: 0, False: 0]
  |  Branch (3785:37): [True: 0, False: 0]
  |  Branch (3785:57): [True: 0, False: 0]
  |  Branch (3785:78): [True: 0, False: 0]
  ------------------
 3786|      0|               it = line_start;
 3787|      0|               return;
 3788|      0|            }
 3789|       |
 3790|       |            // Skip indented comment lines
 3791|   442k|            if (*it == '#') {
  ------------------
  |  Branch (3791:17): [True: 0, False: 442k]
  ------------------
 3792|      0|               skip_comment(it, end);
 3793|      0|               first_key = false;
 3794|      0|               continue;
 3795|      0|            }
 3796|       |
 3797|       |            // Skip blank/empty lines after indent
 3798|   442k|            if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3798:17): [True: 118, False: 442k]
  |  Branch (3798:32): [True: 0, False: 442k]
  ------------------
 3799|      0|               first_key = false;
 3800|      0|               continue;
 3801|      0|            }
 3802|       |
 3803|       |            // While parsing an explicit mapping key node ('? key-node'),
 3804|       |            // a subsequent standalone ':' at the same indentation starts
 3805|       |            // the outer value indicator and must terminate this key-node map.
 3806|       |            // Keep same-line ': x' on the first key-node line valid.
 3807|   442k|            if (ctx.explicit_mapping_key_context && !established_mapping_indent_this_line && *it == ':') {
  ------------------
  |  Branch (3807:17): [True: 247k, False: 194k]
  |  Branch (3807:53): [True: 80.3k, False: 166k]
  |  Branch (3807:94): [True: 19.7k, False: 60.5k]
  ------------------
 3808|  19.7k|               const auto after_colon = it + 1;
 3809|  19.7k|               const int32_t explicit_value_indicator_indent = (parent_indent < 0) ? 0 : (parent_indent + 1);
  ------------------
  |  Branch (3809:64): [True: 17.3k, False: 2.45k]
  ------------------
 3810|  19.7k|               if ((after_colon == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (3810:21): [True: 12, False: 19.7k]
  |  Branch (3810:43): [True: 17.3k, False: 2.43k]
  ------------------
 3811|  17.3k|                   line_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (3811:20): [True: 244, False: 17.0k]
  ------------------
 3812|    244|                  it = line_start;
 3813|    244|                  return;
 3814|    244|               }
 3815|  19.7k|            }
 3816|       |
 3817|       |            // Process this mapping entry (key + colon + value)
 3818|   441k|            int32_t effective_line_indent = line_indent;
 3819|   441k|            if (discover_indent && established_mapping_indent_this_line &&
  ------------------
  |  Branch (3819:17): [True: 441k, False: 118]
  |  Branch (3819:36): [True: 270k, False: 170k]
  ------------------
 3820|   270k|                discovered_first_key_visual_indent > effective_line_indent &&
  ------------------
  |  Branch (3820:17): [True: 202k, False: 68.8k]
  ------------------
 3821|   202k|                !(discovered_first_key_mid_line && parent_indent < 0)) {
  ------------------
  |  Branch (3821:19): [True: 177k, False: 24.5k]
  |  Branch (3821:52): [True: 10.7k, False: 166k]
  ------------------
 3822|       |               // The first discovered key has no indentation of its own left to measure: it may
 3823|       |               // begin mid-line (a sequence entry's "- key: value"), or the caller may have already
 3824|       |               // consumed the line's indentation before handing the mapping over. Pass its visual
 3825|       |               // column so the entry judges its value against the key's real indent -- otherwise a
 3826|       |               // key with an empty value takes the following sibling line for nested content
 3827|       |               // (issue #2827) and same-line block scalars compute the wrong indentation.
 3828|       |               // The exception is a ROOT mapping whose first key begins mid-line, which means node
 3829|       |               // properties sit ahead of it (`!!str &a1 "foo":`): those belong to the document node
 3830|       |               // rather than to the key's column, so the measured indent stands. Conformance tests
 3831|       |               // 7FWL and HMQ5 pin that case.
 3832|   191k|               effective_line_indent = discovered_first_key_visual_indent;
 3833|   191k|            }
 3834|       |
 3835|   441k|            if (!process_entry(ctx, it, end, effective_line_indent)) {
  ------------------
  |  Branch (3835:17): [True: 19.4k, False: 422k]
  ------------------
 3836|  19.4k|               return;
 3837|  19.4k|            }
 3838|   422k|            first_key = false;
 3839|       |
 3840|   422k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3840:17): [True: 0, False: 422k]
  ------------------
 3841|      0|               return;
 3842|       |
 3843|       |            if constexpr (yaml::check_flow_context(Opts)) {
 3844|       |               // In flow context, an implicit "key: value" pair used as a sequence entry
 3845|       |               // ends at ',', ']', or '}'. Let the enclosing flow parser consume it.
 3846|       |               auto flow_end = it;
 3847|       |               skip_flow_ws_and_newlines(ctx, flow_end, end);
 3848|       |               if (bool(ctx.error)) [[unlikely]]
 3849|       |                  return;
 3850|       |               if (flow_end != end && (*flow_end == ',' || *flow_end == ']' || *flow_end == '}')) {
 3851|       |                  it = flow_end;
 3852|       |                  return;
 3853|       |               }
 3854|       |            }
 3855|       |
 3856|       |            // Trailing whitespace handling (peek-ahead pattern).
 3857|       |            // After parsing, iterator may be at leading indent of next line.
 3858|       |            // Don't consume it - let the outer loop handle indent measurement.
 3859|   422k|            if (it != end) {
  ------------------
  |  Branch (3859:17): [True: 300k, False: 122k]
  ------------------
 3860|   300k|               if (*it == ' ' || *it == '\t') {
  ------------------
  |  Branch (3860:20): [True: 169k, False: 130k]
  |  Branch (3860:34): [True: 1.57k, False: 129k]
  ------------------
 3861|   171k|                  auto peek = it;
 3862|   171k|                  skip_inline_ws(peek, end);
 3863|   171k|                  if (peek != end && *peek != '\n' && *peek != '\r' && *peek != '#') {
  ------------------
  |  Branch (3863:23): [True: 170k, False: 87]
  |  Branch (3863:38): [True: 170k, False: 984]
  |  Branch (3863:55): [True: 168k, False: 1.06k]
  |  Branch (3863:72): [True: 166k, False: 2.25k]
  ------------------
 3864|   166k|                     continue; // At leading indent of new line
 3865|   166k|                  }
 3866|   171k|               }
 3867|   133k|               skip_inline_ws(it, end);
 3868|   133k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3868:20): [True: 133k, False: 87]
  |  Branch (3868:33): [True: 7.92k, False: 125k]
  ------------------
 3869|  7.92k|                  if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3870|  7.92k|                     if (it > line_start) {
  ------------------
  |  Branch (3870:26): [True: 7.92k, False: 0]
  ------------------
 3871|  7.92k|                        const char prev = *(it - 1);
 3872|  7.92k|                        if (prev != ' ' && prev != '\t' && prev != '\n' && prev != '\r') {
  ------------------
  |  Branch (3872:29): [True: 2.90k, False: 5.01k]
  |  Branch (3872:44): [True: 966, False: 1.93k]
  |  Branch (3872:60): [True: 441, False: 525]
  |  Branch (3872:76): [True: 13, False: 428]
  ------------------
 3873|     13|                           ctx.error = error_code::syntax_error;
 3874|     13|                           return;
 3875|     13|                        }
 3876|  7.92k|                     }
 3877|  7.92k|                  }
 3878|  7.92k|               }
 3879|  7.91k|               skip_comment(it, end);
 3880|   133k|               if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (3880:20): [True: 133k, False: 288]
  |  Branch (3880:34): [True: 39.8k, False: 93.5k]
  |  Branch (3880:49): [True: 59.4k, False: 34.0k]
  ------------------
 3881|  99.3k|                  skip_newline(it, end);
 3882|  99.3k|               }
 3883|  34.3k|               else if (it != end) {
  ------------------
  |  Branch (3883:25): [True: 34.0k, False: 288]
  ------------------
 3884|       |                  // The entry stopped part way along its line with something other than
 3885|       |                  // whitespace or a comment after it -- a ':' its value could not take as a
 3886|       |                  // separator, say. The next pass measures indent as though this were the start
 3887|       |                  // of a line, so what is left of the real one is lost; reject it instead.
 3888|  34.0k|                  if constexpr (requires { ctx.line_prefix_before(it); }) {
 3889|  34.0k|                     if (ctx.line_prefix_before(it).has_content) {
  ------------------
  |  Branch (3889:26): [True: 593, False: 33.5k]
  ------------------
 3890|    593|                        ctx.error = error_code::syntax_error;
 3891|    593|                        return;
 3892|    593|                     }
 3893|  34.0k|                  }
 3894|  34.0k|               }
 3895|   133k|            }
 3896|   422k|         }
 3897|   271k|      }
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_i:
 4777|   441k|               ctx, it, end, int32_t(-1), [&](auto& ctx, auto& it, auto end, int32_t line_indent) -> bool {
 4778|   441k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   441k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4780|   441k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   441k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   441k|                           if (ctx.stream_begin) {
 4788|   441k|                              auto is_line_content_start = [&](auto pos) {
 4789|   441k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   441k|                              };
 4791|       |
 4792|   441k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   441k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   441k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   441k|                                 return line != end && *line == ':';
 4796|   441k|                              };
 4797|       |
 4798|   441k|                              if (!is_line_content_start(it) &&
 4799|   441k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
 4800|   441k|                                  !line_has_explicit_value_indicator(it)) {
 4801|   441k|                                 ctx.error = error_code::syntax_error;
 4802|   441k|                                 return false;
 4803|   441k|                              }
 4804|   441k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   441k|                           }
 4806|   441k|                        }
 4807|       |
 4808|   441k|                        if (*it == '-' &&
 4809|   441k|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
 4810|   441k|                            !line_starts_with_explicit_value_indicator) {
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|   441k|                           ctx.error = error_code::syntax_error;
 4813|   441k|                           return false;
 4814|   441k|                        }
 4815|       |
 4816|   441k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 4817|   441k|                           return false;
 4818|   441k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   441k|                        ctx.pop_indent();
 4820|   441k|                     }
 4821|   441k|                     else {
 4822|   441k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|   441k|                        if (nested_indent >= 0) {
 4824|   441k|                           yaml::skip_to_content(it, end);
 4825|   441k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
 4826|   441k|                              ctx.error = error_code::syntax_error;
 4827|   441k|                              return false;
 4828|   441k|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|   441k|                           const int32_t value_indent =
 4832|   441k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
 4833|   441k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
 4834|   441k|                              return false;
 4835|   441k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|   441k|                           ctx.pop_indent();
 4837|   441k|                        }
 4838|   441k|                     }
 4839|   441k|                     return !bool(ctx.error);
 4840|   441k|                  };
 4841|       |
 4842|       |                  // Explicit key entry form:
 4843|       |                  // ? key
 4844|       |                  // : value
 4845|   441k|                  if (*it == '?' && ((it + 1) != end) && *(it + 1) == '\t') {
  ------------------
  |  Branch (4845:23): [True: 157k, False: 284k]
  |  Branch (4845:37): [True: 156k, False: 322]
  |  Branch (4845:58): [True: 5, False: 156k]
  ------------------
 4846|      5|                     ctx.error = error_code::syntax_error;
 4847|      5|                     return false;
 4848|      5|                  }
 4849|   441k|                  if (*it == '?' && ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\n' || *(it + 1) == '\r')) {
  ------------------
  |  Branch (4849:23): [True: 157k, False: 284k]
  |  Branch (4849:38): [True: 322, False: 156k]
  |  Branch (4849:57): [True: 48.1k, False: 108k]
  |  Branch (4849:77): [True: 97.6k, False: 10.9k]
  |  Branch (4849:98): [True: 7.43k, False: 3.53k]
  ------------------
 4850|   153k|                     ++it; // skip '?'
 4851|   153k|                     yaml::skip_inline_ws(it, end);
 4852|       |
 4853|   153k|                     const int32_t explicit_value_indicator_indent =
 4854|   153k|                        (ctx.current_indent() < 0) ? 0 : (ctx.current_indent() + 1);
  ------------------
  |  Branch (4854:25): [True: 40.0k, False: 113k]
  ------------------
 4855|       |
 4856|   153k|                     key_t key{};
 4857|   153k|                     if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 4858|   153k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   153k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   153k|                        };
 4861|       |
 4862|   153k|                        auto key_it = it;
 4863|   153k|                        yaml::skip_inline_ws(key_it, end);
 4864|       |
 4865|   153k|                        auto content = key_it;
 4866|   153k|                        yaml::skip_to_content(content, end);
 4867|   153k|                        bool handled_anchor_only_empty_key = false;
 4868|       |
 4869|       |                        // Anchor on an empty explicit key node:
 4870|       |                        //   ? &a
 4871|       |                        //   : value
 4872|   153k|                        if (content != end && *content == '&') {
  ------------------
  |  Branch (4872:29): [True: 152k, False: 1.21k]
  |  Branch (4872:47): [True: 47.8k, False: 104k]
  ------------------
 4873|  47.8k|                           auto anchor_probe = content + 1;
 4874|  47.8k|                           auto anchor_name = yaml::parse_anchor_name(anchor_probe, end);
 4875|  47.8k|                           if (!anchor_name.empty()) {
  ------------------
  |  Branch (4875:32): [True: 47.8k, False: 7]
  ------------------
 4876|  47.8k|                              auto after_anchor = anchor_probe;
 4877|  47.8k|                              yaml::skip_inline_ws(after_anchor, end);
 4878|       |
 4879|  47.8k|                              auto value_indicator = after_anchor;
 4880|  47.8k|                              if (value_indicator != end && *value_indicator == ':') {
  ------------------
  |  Branch (4880:35): [True: 45.5k, False: 2.27k]
  |  Branch (4880:61): [True: 1.70k, False: 43.8k]
  ------------------
 4881|  1.70k|                                 key.clear();
 4882|  1.70k|                                 ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4883|  1.70k|                                 it = value_indicator;
 4884|  1.70k|                                 handled_anchor_only_empty_key = true;
 4885|  1.70k|                              }
 4886|  46.1k|                              else {
 4887|  46.1k|                                 if (value_indicator != end && *value_indicator == '#') {
  ------------------
  |  Branch (4887:38): [True: 43.8k, False: 2.27k]
  |  Branch (4887:64): [True: 1.15k, False: 42.6k]
  ------------------
 4888|  1.15k|                                    yaml::skip_comment(value_indicator, end);
 4889|  1.15k|                                 }
 4890|  46.1k|                                 if (value_indicator != end && (*value_indicator == '\n' || *value_indicator == '\r')) {
  ------------------
  |  Branch (4890:38): [True: 43.8k, False: 2.28k]
  |  Branch (4890:65): [True: 5.29k, False: 38.5k]
  |  Branch (4890:93): [True: 4.62k, False: 33.9k]
  ------------------
 4891|  9.91k|                                    yaml::skip_newline(value_indicator, end);
 4892|  9.91k|                                    auto value_line = value_indicator;
 4893|  9.91k|                                    int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 4894|  9.91k|                                    if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4894:41): [True: 2, False: 9.91k]
  ------------------
 4895|      2|                                       return false;
 4896|  9.91k|                                    if (value_line != end && *value_line == ':' &&
  ------------------
  |  Branch (4896:41): [True: 8.84k, False: 1.07k]
  |  Branch (4896:62): [True: 957, False: 7.88k]
  ------------------
 4897|    957|                                        value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (4897:41): [True: 939, False: 18]
  ------------------
 4898|    939|                                       key.clear();
 4899|    939|                                       ctx.anchors[std::string(anchor_name)] = {content, content, ctx.current_indent()};
 4900|    939|                                       it = value_line;
 4901|    939|                                       handled_anchor_only_empty_key = true;
 4902|    939|                                    }
 4903|  8.97k|                                    else if (value_line != end && *value_line == ':') {
  ------------------
  |  Branch (4903:46): [True: 7.90k, False: 1.07k]
  |  Branch (4903:67): [True: 18, False: 7.88k]
  ------------------
 4904|       |                                       // In explicit-key form ("? &a"), a following ':'
 4905|       |                                       // starts the outer value indicator only at the same
 4906|       |                                       // indentation. A deeper-indented ': value' is malformed.
 4907|     18|                                       ctx.error = error_code::syntax_error;
 4908|     18|                                       return false;
 4909|     18|                                    }
 4910|  9.91k|                                 }
 4911|  46.1k|                              }
 4912|  47.8k|                           }
 4913|  47.8k|                        }
 4914|       |
 4915|   153k|                        const bool key_content_spans_lines = [&] {
 4916|   153k|                           auto scan = key_it;
 4917|   153k|                           while (scan != content && scan != end) {
 4918|   153k|                              if (*scan == '\n' || *scan == '\r') return true;
 4919|   153k|                              ++scan;
 4920|   153k|                           }
 4921|   153k|                           return false;
 4922|   153k|                        }();
 4923|       |
 4924|   153k|                        if (handled_anchor_only_empty_key) {
  ------------------
  |  Branch (4924:29): [True: 2.64k, False: 150k]
  ------------------
 4925|       |                           // 'it' already points to the explicit value indicator ':'
 4926|  2.64k|                        }
 4927|   150k|                        else if (content == end || (*content == ':' && key_content_spans_lines)) {
  ------------------
  |  Branch (4927:34): [True: 1.21k, False: 149k]
  |  Branch (4927:53): [True: 2.61k, False: 146k]
  |  Branch (4927:72): [True: 1.48k, False: 1.12k]
  ------------------
 4928|  2.70k|                           key.clear();
 4929|  2.70k|                           it = content;
 4930|  2.70k|                        }
 4931|   148k|                        else {
 4932|       |                           // Explicit mapping keys ('? key-node') are full YAML nodes.
 4933|       |                           // Parse the key node structurally (not via plain-key scanning)
 4934|       |                           // so inputs like '? []: x' and '? JSON: like' are interpreted
 4935|       |                           // as complex keys, not split into implicit key/value pairs.
 4936|   148k|                           auto key_node_it = content;
 4937|   148k|                           auto key_node_end = end;
 4938|   148k|                           if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 4939|       |                              // In explicit-key form, a following standalone ':'
 4940|       |                              // line (same or lower indentation) belongs to the
 4941|       |                              // outer mapping value, not the key node itself.
 4942|   148k|                              auto scan = content;
 4943|  1.81M|                              while (scan != end) {
  ------------------
  |  Branch (4943:38): [True: 1.73M, False: 79.4k]
  ------------------
 4944|   288M|                                 while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (4944:41): [True: 288M, False: 33.9k]
  |  Branch (4944:56): [True: 287M, False: 948k]
  |  Branch (4944:73): [True: 286M, False: 754k]
  ------------------
 4945|   286M|                                    ++scan;
 4946|   286M|                                 }
 4947|  1.73M|                                 if (scan == end) {
  ------------------
  |  Branch (4947:38): [True: 33.9k, False: 1.70M]
  ------------------
 4948|  33.9k|                                    break;
 4949|  33.9k|                                 }
 4950|       |
 4951|  1.70M|                                 yaml::skip_newline(scan, end);
 4952|  1.70M|                                 auto line_start = scan;
 4953|       |
 4954|  1.70M|                                 int32_t indicator_indent = 0;
 4955|  2.53M|                                 while (scan != end && *scan == ' ') {
  ------------------
  |  Branch (4955:41): [True: 2.46M, False: 79.4k]
  |  Branch (4955:56): [True: 836k, False: 1.62M]
  ------------------
 4956|   836k|                                    ++indicator_indent;
 4957|   836k|                                    ++scan;
 4958|   836k|                                 }
 4959|       |
 4960|  1.70M|                                 if (scan != end && *scan == ':') {
  ------------------
  |  Branch (4960:38): [True: 1.62M, False: 79.4k]
  |  Branch (4960:53): [True: 265k, False: 1.35M]
  ------------------
 4961|   265k|                                    const auto after_colon = scan + 1;
 4962|   265k|                                    if ((after_colon == end ||
  ------------------
  |  Branch (4962:42): [True: 90, False: 265k]
  ------------------
 4963|   265k|                                         yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_colon)]) &&
  ------------------
  |  Branch (4963:42): [True: 212k, False: 53.0k]
  ------------------
 4964|   212k|                                        indicator_indent <= line_indent) {
  ------------------
  |  Branch (4964:41): [True: 34.6k, False: 178k]
  ------------------
 4965|  34.6k|                                       key_node_end = line_start;
 4966|  34.6k|                                       break;
 4967|  34.6k|                                    }
 4968|   265k|                                 }
 4969|  1.70M|                              }
 4970|   148k|                           }
 4971|       |
 4972|   148k|                           glz::generic key_node{};
 4973|   148k|                           const bool prev_explicit_mapping_key_context = ctx.explicit_mapping_key_context;
 4974|   148k|                           ctx.explicit_mapping_key_context = true;
 4975|   148k|                           from<YAML, glz::generic>::template op<Opts>(key_node, ctx, key_node_it, key_node_end);
 4976|   148k|                           ctx.explicit_mapping_key_context = prev_explicit_mapping_key_context;
 4977|   148k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4977:32): [True: 3.52k, False: 144k]
  ------------------
 4978|  3.52k|                              return false;
 4979|   144k|                           it = key_node_it;
 4980|   144k|                           if (!to_string_key(key_node)) [[unlikely]]
  ------------------
  |  Branch (4980:32): [True: 38, False: 144k]
  ------------------
 4981|     38|                              return false;
 4982|   144k|                        }
 4983|       |                     }
 4984|       |                     else {
 4985|       |                        if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 4986|       |                           from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 4987|       |                           if (bool(ctx.error)) [[unlikely]]
 4988|       |                              return false;
 4989|       |                        }
 4990|       |                     }
 4991|       |
 4992|   149k|                     yaml::skip_inline_ws(it, end);
 4993|   153k|                     yaml::skip_comment(it, end);
 4994|       |
 4995|       |                     // Value indicator may appear on the next line at the same indent.
 4996|   153k|                     if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (4996:26): [True: 102k, False: 50.6k]
  |  Branch (4996:40): [True: 12.4k, False: 90.3k]
  |  Branch (4996:55): [True: 40.7k, False: 49.6k]
  ------------------
 4997|  53.2k|                        auto probe = it;
 4998|  53.2k|                        bool found_value_indicator = false;
 4999|       |
 5000|   109k|                        while (probe != end && (*probe == '\n' || *probe == '\r')) {
  ------------------
  |  Branch (5000:32): [True: 71.6k, False: 37.5k]
  |  Branch (5000:49): [True: 17.3k, False: 54.3k]
  |  Branch (5000:67): [True: 54.3k, False: 0]
  ------------------
 5001|  71.6k|                           yaml::skip_newline(probe, end);
 5002|       |
 5003|  71.6k|                           auto value_line = probe;
 5004|  71.6k|                           int32_t value_indent = yaml::measure_indent(value_line, end, ctx);
 5005|  71.6k|                           if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5005:32): [True: 10, False: 71.6k]
  ------------------
 5006|     10|                              return false;
 5007|       |
 5008|  71.6k|                           if (value_line == end || *value_line == '\n' || *value_line == '\r') {
  ------------------
  |  Branch (5008:32): [True: 37.5k, False: 34.0k]
  |  Branch (5008:53): [True: 2.81k, False: 31.2k]
  |  Branch (5008:76): [True: 12.7k, False: 18.4k]
  ------------------
 5009|  53.1k|                              probe = value_line;
 5010|  53.1k|                              continue; // blank line
 5011|  53.1k|                           }
 5012|  18.4k|                           if (*value_line == '#') {
  ------------------
  |  Branch (5012:32): [True: 2.86k, False: 15.6k]
  ------------------
 5013|  2.86k|                              yaml::skip_comment(value_line, end);
 5014|  2.86k|                              probe = value_line;
 5015|  2.86k|                              continue; // comment-only line
 5016|  2.86k|                           }
 5017|  15.6k|                           if (*value_line == ':' && value_indent == explicit_value_indicator_indent) {
  ------------------
  |  Branch (5017:32): [True: 3.69k, False: 11.9k]
  |  Branch (5017:54): [True: 658, False: 3.03k]
  ------------------
 5018|    658|                              it = value_line;
 5019|    658|                              found_value_indicator = true;
 5020|    658|                           }
 5021|  15.6k|                           break;
 5022|  18.4k|                        }
 5023|       |
 5024|  53.1k|                        if (found_value_indicator) {
  ------------------
  |  Branch (5024:29): [True: 658, False: 52.5k]
  ------------------
 5025|    658|                           yaml::skip_inline_ws(it, end);
 5026|    658|                        }
 5027|  53.1k|                     }
 5028|       |
 5029|   153k|                     val_t val{};
 5030|   153k|                     if (it != end && *it == ':') {
  ------------------
  |  Branch (5030:26): [True: 102k, False: 50.6k]
  |  Branch (5030:39): [True: 43.1k, False: 59.7k]
  ------------------
 5031|  43.1k|                        ++it;
 5032|  43.1k|                        if (it != end && *it == '\t') {
  ------------------
  |  Branch (5032:29): [True: 42.3k, False: 766]
  |  Branch (5032:42): [True: 3, False: 42.3k]
  ------------------
 5033|      3|                           ctx.error = error_code::syntax_error;
 5034|      3|                           return false;
 5035|      3|                        }
 5036|  43.0k|                        if (it != end && (*it == '\n' || *it == '\r')) {
  ------------------
  |  Branch (5036:29): [True: 42.3k, False: 766]
  |  Branch (5036:43): [True: 935, False: 41.3k]
  |  Branch (5036:58): [True: 2.73k, False: 38.6k]
  ------------------
 5037|  3.66k|                           auto probe = it;
 5038|  3.66k|                           yaml::skip_newline(probe, end);
 5039|  7.54k|                           while (probe != end && *probe == ' ') ++probe;
  ------------------
  |  Branch (5039:35): [True: 6.93k, False: 611]
  |  Branch (5039:51): [True: 3.87k, False: 3.05k]
  ------------------
 5040|  3.66k|                           if (probe != end && *probe == ':' && ((probe + 1) != end) && *(probe + 1) == '\t') {
  ------------------
  |  Branch (5040:32): [True: 3.05k, False: 611]
  |  Branch (5040:48): [True: 453, False: 2.60k]
  |  Branch (5040:65): [True: 453, False: 0]
  |  Branch (5040:89): [True: 1, False: 452]
  ------------------
 5041|      1|                              ctx.error = error_code::syntax_error;
 5042|      1|                              return false;
 5043|      1|                           }
 5044|  3.66k|                        }
 5045|  43.0k|                        yaml::skip_inline_ws(it, end);
 5046|  43.0k|                        if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5046:29): [True: 499, False: 42.5k]
  ------------------
 5047|    499|                           return false;
 5048|  43.0k|                     }
 5049|       |
 5050|   152k|                     value.emplace(std::move(key), std::move(val));
 5051|   152k|                     return true;
 5052|   153k|                  }
 5053|       |
 5054|   288k|                  key_t key{};
 5055|   288k|                  if constexpr (std::same_as<std::remove_cvref_t<key_t>, std::string>) {
 5056|   288k|                     auto key_probe = it;
 5057|   288k|                     yaml::skip_inline_ws(key_probe, end);
 5058|   288k|                     const bool complex_flow_key = (key_probe != end && (*key_probe == '[' || *key_probe == '{'));
  ------------------
  |  Branch (5058:53): [True: 288k, False: 0]
  |  Branch (5058:74): [True: 888, False: 287k]
  |  Branch (5058:95): [True: 1.00k, False: 286k]
  ------------------
 5059|   288k|                     if (complex_flow_key) {
  ------------------
  |  Branch (5059:26): [True: 1.89k, False: 286k]
  ------------------
 5060|  1.89k|                        glz::generic key_node{};
 5061|  1.89k|                        from<YAML, glz::generic>::template op<yaml::flow_context_on<Opts>()>(key_node, ctx, it, end);
 5062|  1.89k|                        if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (5062:29): [True: 429, False: 1.46k]
  ------------------
 5063|    429|                           return false;
 5064|  1.46k|                        if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (5064:29): [True: 1, False: 1.46k]
  ------------------
 5065|      1|                           return false;
 5066|  1.46k|                     }
 5067|   286k|                     else {
 5068|   286k|                        if (!yaml::parse_yaml_key(key, ctx, it, end, false)) {
  ------------------
  |  Branch (5068:29): [True: 1.77k, False: 284k]
  ------------------
 5069|  1.77k|                           return false;
 5070|  1.77k|                        }
 5071|   286k|                     }
 5072|       |                  }
 5073|       |                  else {
 5074|       |                     from<YAML, key_t>::template op<Opts>(key, ctx, it, end);
 5075|       |                     if (bool(ctx.error)) [[unlikely]]
 5076|       |                        return false;
 5077|       |                  }
 5078|       |
 5079|   286k|                  yaml::skip_inline_ws(it, end);
 5080|       |
 5081|   288k|                  if (it == end || *it != ':') {
  ------------------
  |  Branch (5081:23): [True: 3.04k, False: 285k]
  |  Branch (5081:36): [True: 853, False: 284k]
  ------------------
 5082|  1.69k|                     ctx.error = error_code::syntax_error;
 5083|  1.69k|                     return false;
 5084|  1.69k|                  }
 5085|   286k|                  ++it;
 5086|   286k|                  yaml::skip_inline_ws(it, end);
 5087|       |
 5088|   286k|                  val_t val{};
 5089|   286k|                  if (!parse_map_value(val)) [[unlikely]]
  ------------------
  |  Branch (5089:23): [True: 11.4k, False: 275k]
  ------------------
 5090|  11.4k|                     return false;
 5091|       |
 5092|   275k|                  value.emplace(std::move(key), std::move(val));
 5093|   275k|                  return true;
 5094|   286k|               });
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlvE_clEv:
 4915|   153k|                        const bool key_content_spans_lines = [&] {
 4916|   153k|                           auto scan = key_it;
 4917|   165k|                           while (scan != content && scan != end) {
  ------------------
  |  Branch (4917:35): [True: 119k, False: 46.0k]
  |  Branch (4917:54): [True: 119k, False: 0]
  ------------------
 4918|   119k|                              if (*scan == '\n' || *scan == '\r') return true;
  ------------------
  |  Branch (4918:35): [True: 98.6k, False: 21.0k]
  |  Branch (4918:52): [True: 8.69k, False: 12.3k]
  ------------------
 4919|  12.3k|                              ++scan;
 4920|  12.3k|                           }
 4921|  46.0k|                           return false;
 4922|   153k|                        }();
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E0_clESS_:
 4858|   144k|                        auto to_string_key = [&](glz::generic& key_node) {
 4859|   144k|                           return yaml::materialize_key(key, key_node, ctx);
 4860|   144k|                        };
_ZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_ENKUlRT_RSK_SG_iE_clISE_SB_SB_EEbSO_SP_SG_iENKUlRS4_E_clESS_:
 4778|   327k|                  auto parse_map_value = [&](val_t& val) -> bool {
 4779|   327k|                     if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (4779:26): [True: 324k, False: 2.79k]
  |  Branch (4779:39): [True: 241k, False: 83.0k]
  ------------------
 4780|   241k|                        bool line_starts_with_explicit_value_indicator = false;
 4781|       |
 4782|       |                        // Inline mapping values in block context cannot start with a
 4783|       |                        // plain "key: value" pair on the same line (e.g. "a: b: c").
 4784|       |                        // Such constructs are malformed unless wrapped in flow
 4785|       |                        // delimiters ({...} / [...]) or quoted.
 4786|   241k|                        if constexpr (std::is_pointer_v<std::decay_t<decltype(it)>>) {
 4787|   241k|                           if (ctx.stream_begin) {
  ------------------
  |  Branch (4787:32): [True: 241k, False: 0]
  ------------------
 4788|   241k|                              auto is_line_content_start = [&](auto pos) {
 4789|   241k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   241k|                              };
 4791|       |
 4792|   241k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   241k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   241k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
 4795|   241k|                                 return line != end && *line == ':';
 4796|   241k|                              };
 4797|       |
 4798|   241k|                              if (!is_line_content_start(it) &&
  ------------------
  |  Branch (4798:35): [True: 241k, False: 0]
  ------------------
 4799|   241k|                                  yaml::inline_value_has_plain_mapping_indicator(it, end) &&
  ------------------
  |  Branch (4799:35): [True: 16.6k, False: 225k]
  ------------------
 4800|  16.6k|                                  !line_has_explicit_value_indicator(it)) {
  ------------------
  |  Branch (4800:35): [True: 197, False: 16.4k]
  ------------------
 4801|    197|                                 ctx.error = error_code::syntax_error;
 4802|    197|                                 return false;
 4803|    197|                              }
 4804|   241k|                              line_starts_with_explicit_value_indicator = line_has_explicit_value_indicator(it);
 4805|   241k|                           }
 4806|   241k|                        }
 4807|       |
 4808|   241k|                        if (*it == '-' &&
  ------------------
  |  Branch (4808:29): [True: 982, False: 240k]
  ------------------
 4809|    982|                            ((it + 1) == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*(it + 1))]) &&
  ------------------
  |  Branch (4809:30): [True: 1, False: 981]
  |  Branch (4809:49): [True: 121, False: 860]
  ------------------
 4810|    122|                            !line_starts_with_explicit_value_indicator) {
  ------------------
  |  Branch (4810:29): [True: 7, False: 115]
  ------------------
 4811|       |                           // "key: - item" is not valid block sequence syntax.
 4812|      7|                           ctx.error = error_code::syntax_error;
 4813|      7|                           return false;
 4814|      7|                        }
 4815|       |
 4816|   241k|                        if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (4816:29): [True: 0, False: 241k]
  ------------------
 4817|      0|                           return false;
 4818|   241k|                        from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4819|   241k|                        ctx.pop_indent();
 4820|   241k|                     }
 4821|  85.8k|                     else {
 4822|  85.8k|                        int32_t nested_indent = yaml::detect_nested_value_indent(ctx, it, end, line_indent);
 4823|  85.8k|                        if (nested_indent >= 0) {
  ------------------
  |  Branch (4823:29): [True: 13.5k, False: 72.2k]
  ------------------
 4824|  13.5k|                           yaml::skip_to_content(it, end);
 4825|  13.5k|                           if (it != end && *it == ':' && (it + 1) != end && *(it + 1) == '\t') {
  ------------------
  |  Branch (4825:32): [True: 13.5k, False: 0]
  |  Branch (4825:45): [True: 0, False: 13.5k]
  |  Branch (4825:59): [True: 0, False: 0]
  |  Branch (4825:78): [True: 0, False: 0]
  ------------------
 4826|      0|                              ctx.error = error_code::syntax_error;
 4827|      0|                              return false;
 4828|      0|                           }
 4829|       |                           // A struct value reads the pushed indent as its own key column;
 4830|       |                           // every other value type reads it as the enclosing baseline.
 4831|  13.5k|                           const int32_t value_indent =
 4832|  13.5k|                              yaml::receives_block_mapping_column<val_t>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (4832:31): [Folded, False: 13.5k]
  ------------------
 4833|  13.5k|                           if (!ctx.push_indent(value_indent)) [[unlikely]]
  ------------------
  |  Branch (4833:32): [True: 0, False: 13.5k]
  ------------------
 4834|      0|                              return false;
 4835|  13.5k|                           from<YAML, val_t>::template op<Opts>(val, ctx, it, end);
 4836|  13.5k|                           ctx.pop_indent();
 4837|  13.5k|                        }
 4838|  85.8k|                     }
 4839|   327k|                     return !bool(ctx.error);
 4840|   327k|                  };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_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_:
 4788|   241k|                              auto is_line_content_start = [&](auto pos) {
 4789|   241k|                                 return !ctx.line_prefix_before(pos).has_content;
 4790|   241k|                              };
_ZZZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_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_:
 4792|   258k|                              auto line_has_explicit_value_indicator = [&](auto pos) {
 4793|   258k|                                 const char* line = ctx.line_begin_of(pos);
 4794|   541k|                                 while (line != end && (*line == ' ' || *line == '\t')) ++line;
  ------------------
  |  Branch (4794:41): [True: 541k, False: 0]
  |  Branch (4794:57): [True: 282k, False: 258k]
  |  Branch (4794:73): [True: 630, False: 258k]
  ------------------
 4795|   258k|                                 return line != end && *line == ':';
  ------------------
  |  Branch (4795:41): [True: 258k, False: 0]
  |  Branch (4795:56): [True: 141k, False: 116k]
  ------------------
 4796|   258k|                              };
_ZZN3glz4fromILj450ENS_17ordered_small_mapINS_12generic_jsonILNS_8num_modeE0ES1_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS5_TkNS_10is_contextERNS8_12yaml_contextESB_EEvOT1_OT2_OT0_T3_EN19merge_restore_guardD2Ev:
 4547|   296k|            {
 4548|       |               // emplace is a no-op for keys the document already wrote, so only
 4549|       |               // untouched pre-existing entries are put back.
 4550|   296k|               for (auto& entry : saved) {
  ------------------
  |  Branch (4550:33): [True: 0, False: 296k]
  ------------------
 4551|      0|                  target.emplace(entry.first, std::move(entry.second));
 4552|      0|               }
 4553|   296k|            }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__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|  64.6k|      {
  301|  64.6k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 64.6k]
  |  Branch (301:27): [True: 0, False: 64.6k]
  ------------------
  302|       |
  303|  64.6k|         ++it; // skip '*'
  304|  64.6k|         auto name = parse_anchor_name(it, end);
  305|  64.6k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 39, False: 64.6k]
  ------------------
  306|     39|            ctx.error = error_code::syntax_error;
  307|     39|            return true;
  308|     39|         }
  309|       |
  310|  64.6k|         auto anchor_it = ctx.anchors.find(name);
  311|  64.6k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 750, False: 63.8k]
  ------------------
  312|    750|            ctx.error = error_code::syntax_error; // undefined alias
  313|    750|            return true;
  314|    750|         }
  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|  63.8k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  63.8k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 994, False: 62.8k]
  ------------------
  322|    994|            return true;
  323|    994|         }
  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|  62.8k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 24, False: 62.8k]
  ------------------
  329|     24|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     24|            return true;
  331|     24|         }
  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|  62.8k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  62.8k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 3, False: 62.8k]
  ------------------
  339|      3|            return true;
  340|       |
  341|  62.8k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 6, False: 62.8k]
  ------------------
  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|  62.8k|         auto replay_it = span.begin;
  348|  62.8k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  62.8k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  62.8k|         ctx.indent_stack.clear();
  353|  62.8k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 52.7k, False: 10.1k]
  ------------------
  354|  52.7k|            ctx.push_indent(span.base_indent - 1);
  355|  52.7k|         }
  356|       |
  357|  62.8k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  62.8k|         using V = std::remove_cvref_t<T>;
  360|  62.8k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  62.8k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  62.8k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  62.8k|         return true;
  367|  62.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_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  95.4k|      {
 5206|  95.4k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  95.4k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  95.4k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  95.4k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  95.4k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 95.4k, False: 0]
  ------------------
 5216|  95.4k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  95.4k|      }
_ZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_:
 1892|  97.6k|      {
 1893|  97.6k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (1893:14): [True: 4.78k, False: 92.8k]
  ------------------
 1894|  4.78k|            return;
 1895|       |
 1896|  92.8k|         yaml::node_preamble_state preamble{};
 1897|  92.8k|         if (yaml::parse_node_preamble<Opts, yaml::node_property_policy{true, false, false, true}>(
  ------------------
  |  Branch (1897:14): [True: 2.77k, False: 90.0k]
  ------------------
 1898|  92.8k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
 1899|  2.77k|            return;
 1900|       |
 1901|  90.0k|         std::string str;
 1902|  90.0k|         const auto style = yaml::detect_scalar_style(*it);
 1903|       |
 1904|  90.0k|         switch (style) {
  ------------------
  |  Branch (1904:18): [True: 90.0k, False: 0]
  ------------------
 1905|    487|         case yaml::scalar_style::double_quoted:
  ------------------
  |  Branch (1905:10): [True: 487, False: 89.5k]
  ------------------
 1906|    487|            yaml::parse_double_quoted_string(str, ctx, it, end);
 1907|    487|            break;
 1908|  1.13k|         case yaml::scalar_style::single_quoted:
  ------------------
  |  Branch (1908:10): [True: 1.13k, False: 88.9k]
  ------------------
 1909|  1.13k|            yaml::parse_single_quoted_string(str, ctx, it, end);
 1910|  1.13k|            break;
 1911|    954|         case yaml::scalar_style::literal_block:
  ------------------
  |  Branch (1911:10): [True: 954, False: 89.1k]
  ------------------
 1912|  1.55k|         case yaml::scalar_style::folded_block:
  ------------------
  |  Branch (1912:10): [True: 605, False: 89.4k]
  ------------------
 1913|       |            // For same-line mapping/sequence values, parsing context is typically pushed
 1914|       |            // one column past the key/item indicator; block scalar indentation is relative
 1915|       |            // to the parent line indent.
 1916|  1.55k|            yaml::parse_block_scalar(str, ctx, it, end,
 1917|  1.55k|                                     ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : ctx.current_indent());
  ------------------
  |  Branch (1917:38): [True: 405, False: 1.15k]
  ------------------
 1918|  1.55k|            break;
 1919|  86.8k|         case yaml::scalar_style::plain:
  ------------------
  |  Branch (1919:10): [True: 86.8k, False: 3.18k]
  ------------------
 1920|       |            // In block context with known indent, use multiline parsing to support
 1921|       |            // plain scalars that span multiple lines (folding behavior)
 1922|  86.8k|            if constexpr (!yaml::check_flow_context(Opts)) {
 1923|  86.8k|               if (ctx.current_indent() >= 0) {
  ------------------
  |  Branch (1923:20): [True: 74.8k, False: 12.0k]
  ------------------
 1924|  74.8k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, ctx.current_indent());
 1925|  74.8k|               }
 1926|  12.0k|               else {
 1927|       |                  // Top-level plain scalars may continue on same-indent or indented lines.
 1928|  12.0k|                  yaml::parse_plain_scalar_multiline(str, ctx, it, end, int32_t(0));
 1929|  12.0k|               }
 1930|       |            }
 1931|       |            else {
 1932|       |               yaml::parse_plain_scalar(str, ctx, it, end, true);
 1933|       |            }
 1934|  86.8k|            break;
 1935|  90.0k|         }
 1936|       |
 1937|  90.0k|         if (!bool(ctx.error)) {
  ------------------
  |  Branch (1937:14): [True: 89.8k, False: 232]
  ------------------
 1938|  89.8k|            value = std::move(str);
 1939|  89.8k|            yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 1940|  89.8k|         }
 1941|  90.0k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEELb0ERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_ZNS_4fromILj450ESA_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSE_SB_TkNS_10is_contextERSC_SE_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSN_RSQ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  92.8k|      {
  466|  92.8k|         skip_inline_ws(it, end);
  467|       |
  468|  92.8k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 3, False: 92.8k]
  ------------------
  469|      3|            if constexpr (!AllowEmptyInput) {
  470|      3|               ctx.error = error_code::unexpected_end;
  471|      3|            }
  472|      3|            return true;
  473|      3|         }
  474|       |
  475|  92.8k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  92.8k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 7, False: 92.8k]
  ------------------
  477|      7|            ctx.error = error_code::syntax_error;
  478|      7|            return true;
  479|      7|         }
  480|  92.8k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 8, False: 92.8k]
  ------------------
  481|      8|            ctx.error = error_code::syntax_error;
  482|      8|            return true;
  483|      8|         }
  484|       |
  485|  92.8k|         skip_inline_ws(it, end);
  486|       |
  487|  92.8k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 10, False: 92.8k]
  ------------------
  488|     10|            if constexpr (!AllowEmptyInput) {
  489|     10|               ctx.error = error_code::unexpected_end;
  490|     10|            }
  491|     10|            return true;
  492|     10|         }
  493|       |
  494|  92.8k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 2.74k, False: 90.0k]
  ------------------
  495|  2.74k|            return true;
  496|  2.74k|         }
  497|       |
  498|  90.0k|         return false;
  499|  92.8k|      }
_ZZN3glz4fromILj450ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS7_TkNS_10is_contextERNSA_12yaml_contextESD_EEvOT1_OT2_OT0_T3_ENKUlNSA_8yaml_tagEE_clESP_:
 1898|  92.8k|                value, ctx, it, end, preamble, [](yaml::yaml_tag tag) { return yaml::tag_valid_for_string(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1ELb0ELb0ELb1EEERNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_12yaml_contextEPKcSE_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  92.8k|      {
  409|  92.8k|         state.has_anchor = false;
  410|  92.8k|         state.anchor_name.clear();
  411|  92.8k|         state.anchor_start = nullptr;
  412|  92.8k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  92.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|  92.8k|            else {
  421|  92.8k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 2.71k, False: 90.1k]
  ------------------
  422|  92.8k|            }
  423|  92.8k|         }
  424|       |
  425|  92.8k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 90.1k, False: 2.71k]
  |  Branch (425:27): [True: 2.09k, False: 88.0k]
  ------------------
  426|  2.09k|            ++it;
  427|  2.09k|            auto name = parse_anchor_name(it, end);
  428|  2.09k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 6, False: 2.09k]
  ------------------
  429|      6|               ctx.error = error_code::syntax_error;
  430|      6|               return true;
  431|      6|            }
  432|  2.09k|            skip_inline_ws(it, end);
  433|  2.09k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 22, False: 2.07k]
  ------------------
  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|  2.07k|            if constexpr (Policy.disallow_anchor_on_alias) {
  440|  2.07k|               if (*it == '*') {
  ------------------
  |  Branch (440:20): [True: 2, False: 2.06k]
  ------------------
  441|      2|                  ctx.error = error_code::syntax_error;
  442|      2|                  return true;
  443|      2|               }
  444|  2.07k|            }
  445|  2.06k|            state.has_anchor = true;
  446|  2.07k|            state.anchor_name = std::string(name);
  447|  2.07k|            state.anchor_start = &*it;
  448|  2.07k|         }
  449|       |
  450|  92.7k|         return false;
  451|  92.8k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS0_12yaml_contextEPKcSD_EEbOT0_RT1_RT2_T3_:
  300|  92.8k|      {
  301|  92.8k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 92.8k]
  |  Branch (301:27): [True: 90.1k, False: 2.71k]
  ------------------
  302|       |
  303|  2.71k|         ++it; // skip '*'
  304|  2.71k|         auto name = parse_anchor_name(it, end);
  305|  2.71k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 3, False: 2.71k]
  ------------------
  306|      3|            ctx.error = error_code::syntax_error;
  307|      3|            return true;
  308|      3|         }
  309|       |
  310|  2.71k|         auto anchor_it = ctx.anchors.find(name);
  311|  2.71k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 39, False: 2.67k]
  ------------------
  312|     39|            ctx.error = error_code::syntax_error; // undefined alias
  313|     39|            return true;
  314|     39|         }
  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.67k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  2.67k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 446, False: 2.23k]
  ------------------
  322|    446|            return true;
  323|    446|         }
  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.23k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 11, False: 2.22k]
  ------------------
  329|     11|            ctx.error = error_code::syntax_error; // cyclic alias
  330|     11|            return true;
  331|     11|         }
  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.22k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  2.22k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 2.21k]
  ------------------
  339|      1|            return true;
  340|       |
  341|  2.21k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 2.21k]
  ------------------
  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.21k|         auto replay_it = span.begin;
  348|  2.21k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  2.21k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  2.21k|         ctx.indent_stack.clear();
  353|  2.21k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 2.04k, False: 179]
  ------------------
  354|  2.04k|            ctx.push_indent(span.base_indent - 1);
  355|  2.04k|         }
  356|       |
  357|  2.21k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  2.21k|         using V = std::remove_cvref_t<T>;
  360|  2.21k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  2.21k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  2.21k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  2.21k|         return true;
  367|  2.21k|      }
_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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  21.5k|      {
 5206|  21.5k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  21.5k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  21.5k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  21.5k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  21.5k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 21.5k, False: 0]
  ------------------
 5216|  21.5k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  21.5k|      }
_ZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2047|  22.4k|      {
 2048|  22.4k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2048:14): [True: 0, False: 22.4k]
  ------------------
 2049|      0|            return;
 2050|       |
 2051|  22.4k|         yaml::node_preamble_state preamble{};
 2052|  22.4k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
  ------------------
  |  Branch (2052:14): [True: 2.66k, False: 19.8k]
  ------------------
 2053|  22.4k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  22.4k|                   return yaml::tag_valid_for_float(tag);
 2055|  22.4k|                }
 2056|  22.4k|                else {
 2057|  22.4k|                   return yaml::tag_valid_for_int(tag);
 2058|  22.4k|                }
 2059|  22.4k|             }))
 2060|  2.66k|            return;
 2061|       |
 2062|  19.8k|         auto finalize = [&] { yaml::finalize_node_anchor(preamble.node_props, ctx, it); };
 2063|       |
 2064|       |         // Check for special float values
 2065|  19.8k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2066|  19.8k|            auto start = it;
 2067|       |
 2068|       |            // Check for .inf, .nan, -.inf, etc.
 2069|  19.8k|            if (*it == '.') {
  ------------------
  |  Branch (2069:17): [True: 5.18k, False: 14.6k]
  ------------------
 2070|  5.18k|               ++it;
 2071|  5.18k|               if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2071:20): [True: 4.84k, False: 341]
  |  Branch (2071:38): [True: 693, False: 4.14k]
  |  Branch (2071:74): [True: 85, False: 4.06k]
  ------------------
 2072|  4.06k|                                     std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2072:38): [True: 22, False: 4.04k]
  ------------------
 2073|    800|                  value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2074|    800|                  it += 3;
 2075|    800|                  finalize();
 2076|    800|                  return;
 2077|    800|               }
 2078|  4.38k|               if (it + 3 <= end && (std::string_view(it, 3) == "nan" || std::string_view(it, 3) == "NaN" ||
  ------------------
  |  Branch (2078:20): [True: 4.04k, False: 341]
  |  Branch (2078:38): [True: 126, False: 3.91k]
  |  Branch (2078:74): [True: 94, False: 3.82k]
  ------------------
 2079|  3.82k|                                     std::string_view(it, 3) == "NAN")) {
  ------------------
  |  Branch (2079:38): [True: 8, False: 3.81k]
  ------------------
 2080|    228|                  value = std::numeric_limits<std::remove_cvref_t<T>>::quiet_NaN();
 2081|    228|                  it += 3;
 2082|    228|                  finalize();
 2083|    228|                  return;
 2084|    228|               }
 2085|  4.15k|               it = start;
 2086|  4.15k|            }
 2087|       |
 2088|  18.7k|            if (*it == '-' || *it == '+') {
  ------------------
  |  Branch (2088:17): [True: 1.11k, False: 17.6k]
  |  Branch (2088:31): [True: 2.05k, False: 15.6k]
  ------------------
 2089|  3.17k|               const char sign = *it;
 2090|  3.17k|               ++it;
 2091|  3.17k|               if (it != end && *it == '.') {
  ------------------
  |  Branch (2091:20): [True: 3.06k, False: 105]
  |  Branch (2091:33): [True: 1.31k, False: 1.74k]
  ------------------
 2092|  1.31k|                  ++it;
 2093|  1.31k|                  if (it + 3 <= end && (std::string_view(it, 3) == "inf" || std::string_view(it, 3) == "Inf" ||
  ------------------
  |  Branch (2093:23): [True: 980, False: 339]
  |  Branch (2093:41): [True: 204, False: 776]
  |  Branch (2093:77): [True: 169, False: 607]
  ------------------
 2094|    675|                                        std::string_view(it, 3) == "INF")) {
  ------------------
  |  Branch (2094:41): [True: 302, False: 305]
  ------------------
 2095|    675|                     if (sign == '-') {
  ------------------
  |  Branch (2095:26): [True: 375, False: 300]
  ------------------
 2096|    375|                        value = -std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2097|    375|                     }
 2098|    300|                     else {
 2099|    300|                        value = std::numeric_limits<std::remove_cvref_t<T>>::infinity();
 2100|    300|                     }
 2101|    675|                     it += 3;
 2102|    675|                     finalize();
 2103|    675|                     return;
 2104|    675|                  }
 2105|  1.31k|               }
 2106|  2.49k|               it = start;
 2107|  2.49k|            }
 2108|  18.7k|         }
 2109|       |
 2110|       |         // Parse as plain scalar and convert
 2111|  18.1k|         auto start = it;
 2112|       |
 2113|       |         // Find end of number - use same rules as plain scalar for colons
 2114|  11.4M|         while (it != end) {
  ------------------
  |  Branch (2114:17): [True: 11.4M, False: 4.26k]
  ------------------
 2115|  11.4M|            const char c = *it;
 2116|  11.4M|            if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ',' || c == ']' || c == '}' || c == '#') {
  ------------------
  |  Branch (2116:17): [True: 4.59k, False: 11.4M]
  |  Branch (2116:29): [True: 1.25k, False: 11.4M]
  |  Branch (2116:42): [True: 1.92k, False: 11.4M]
  |  Branch (2116:55): [True: 898, False: 11.4M]
  |  Branch (2116:68): [True: 943, False: 11.4M]
  |  Branch (2116:80): [True: 330, False: 11.4M]
  |  Branch (2116:92): [True: 932, False: 11.4M]
  |  Branch (2116:104): [True: 2.19k, False: 11.4M]
  ------------------
 2117|  13.0k|               break;
 2118|  13.0k|            }
 2119|       |            // Colon only ends number if followed by space/tab/newline/end (YAML mapping indicator)
 2120|  11.4M|            if (c == ':') {
  ------------------
  |  Branch (2120:17): [True: 12.1k, False: 11.4M]
  ------------------
 2121|  12.1k|               if ((it + 1) == end || *(it + 1) == ' ' || *(it + 1) == '\t' || *(it + 1) == '\n' || *(it + 1) == '\r') {
  ------------------
  |  Branch (2121:20): [True: 320, False: 11.8k]
  |  Branch (2121:39): [True: 1.66k, False: 10.1k]
  |  Branch (2121:59): [True: 104, False: 10.0k]
  |  Branch (2121:80): [True: 203, False: 9.86k]
  |  Branch (2121:101): [True: 174, False: 9.68k]
  ------------------
 2122|  2.46k|                  break;
 2123|  2.46k|               }
 2124|  12.1k|            }
 2125|  11.4M|            ++it;
 2126|  11.4M|         }
 2127|       |
 2128|  19.8k|         const std::string_view num_str(&*start, static_cast<size_t>(it - start));
 2129|       |
 2130|  19.8k|         if (num_str.empty()) {
  ------------------
  |  Branch (2130:14): [True: 1.02k, False: 18.7k]
  ------------------
 2131|  1.02k|            ctx.error = error_code::parse_number_failure;
 2132|  1.02k|            return;
 2133|  1.02k|         }
 2134|       |
 2135|       |         // Handle hex, octal, binary
 2136|       |         if constexpr (std::integral<std::remove_cvref_t<T>>) {
 2137|       |            if (num_str.size() > 2 && num_str[0] == '0') {
 2138|       |               int base = 10;
 2139|       |               size_t offset = 0;
 2140|       |
 2141|       |               if (num_str[1] == 'x' || num_str[1] == 'X') {
 2142|       |                  base = 16;
 2143|       |                  offset = 2;
 2144|       |               }
 2145|       |               else if (num_str[1] == 'o' || num_str[1] == 'O') {
 2146|       |                  base = 8;
 2147|       |                  offset = 2;
 2148|       |               }
 2149|       |               else if (num_str[1] == 'b' || num_str[1] == 'B') {
 2150|       |                  base = 2;
 2151|       |                  offset = 2;
 2152|       |               }
 2153|       |
 2154|       |               if (base != 10) {
 2155|       |                  const auto digits = num_str.substr(offset);
 2156|       |                  const bool has_underscores = (digits.find('_') != std::string_view::npos);
 2157|       |
 2158|       |                  std::string clean_storage;
 2159|       |                  std::string_view clean_view;
 2160|       |
 2161|       |                  if (has_underscores) {
 2162|       |                     clean_storage.reserve(digits.size());
 2163|       |                     for (char c : digits) {
 2164|       |                        if (c != '_') {
 2165|       |                           clean_storage.push_back(c);
 2166|       |                        }
 2167|       |                     }
 2168|       |                     clean_view = clean_storage;
 2169|       |                  }
 2170|       |                  else {
 2171|       |                     clean_view = digits;
 2172|       |                  }
 2173|       |
 2174|       |                  auto [ptr, ec] =
 2175|       |                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), value, base);
 2176|       |                  if (ec != std::errc{}) {
 2177|       |                     ctx.error = error_code::parse_number_failure;
 2178|       |                  }
 2179|       |                  finalize();
 2180|       |                  return;
 2181|       |               }
 2182|       |            }
 2183|       |         }
 2184|  18.7k|         else if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2185|  18.7k|            bool negative = false;
 2186|  18.7k|            std::string_view digits = num_str;
 2187|       |
 2188|  18.7k|            if (!digits.empty() && (digits.front() == '+' || digits.front() == '-')) {
  ------------------
  |  Branch (2188:17): [True: 17.0k, False: 1.70k]
  |  Branch (2188:37): [True: 1.75k, False: 15.3k]
  |  Branch (2188:62): [True: 739, False: 14.5k]
  ------------------
 2189|  2.49k|               negative = (digits.front() == '-');
 2190|  2.49k|               digits.remove_prefix(1);
 2191|  2.49k|            }
 2192|       |
 2193|  18.7k|            if (digits.size() > 2 && digits[0] == '0') {
  ------------------
  |  Branch (2193:17): [True: 12.9k, False: 5.84k]
  |  Branch (2193:38): [True: 5.02k, False: 7.90k]
  ------------------
 2194|  5.02k|               int base = 10;
 2195|  5.02k|               size_t offset = 0;
 2196|       |
 2197|  5.02k|               if (digits[1] == 'x' || digits[1] == 'X') {
  ------------------
  |  Branch (2197:20): [True: 1.88k, False: 3.14k]
  |  Branch (2197:40): [True: 585, False: 2.56k]
  ------------------
 2198|  2.46k|                  base = 16;
 2199|  2.46k|                  offset = 2;
 2200|  2.46k|               }
 2201|  2.56k|               else if (digits[1] == 'o' || digits[1] == 'O') {
  ------------------
  |  Branch (2201:25): [True: 84, False: 2.47k]
  |  Branch (2201:45): [True: 217, False: 2.26k]
  ------------------
 2202|    301|                  base = 8;
 2203|    301|                  offset = 2;
 2204|    301|               }
 2205|  2.26k|               else if (digits[1] == 'b' || digits[1] == 'B') {
  ------------------
  |  Branch (2205:25): [True: 95, False: 2.16k]
  |  Branch (2205:45): [True: 449, False: 1.71k]
  ------------------
 2206|    544|                  base = 2;
 2207|    544|                  offset = 2;
 2208|    544|               }
 2209|       |
 2210|  5.02k|               if (base != 10) {
  ------------------
  |  Branch (2210:20): [True: 3.31k, False: 1.71k]
  ------------------
 2211|  3.31k|                  auto raw_digits = digits.substr(offset);
 2212|  3.31k|                  const bool has_underscores = (raw_digits.find('_') != std::string_view::npos);
 2213|       |
 2214|  3.31k|                  std::string clean_storage;
 2215|  3.31k|                  std::string_view clean_view;
 2216|  3.31k|                  if (has_underscores) {
  ------------------
  |  Branch (2216:23): [True: 1.60k, False: 1.70k]
  ------------------
 2217|  1.60k|                     clean_storage.reserve(raw_digits.size());
 2218|  2.03M|                     for (char c : raw_digits) {
  ------------------
  |  Branch (2218:34): [True: 2.03M, False: 1.60k]
  ------------------
 2219|  2.03M|                        if (c != '_') {
  ------------------
  |  Branch (2219:29): [True: 2.03M, False: 2.77k]
  ------------------
 2220|  2.03M|                           clean_storage.push_back(c);
 2221|  2.03M|                        }
 2222|  2.03M|                     }
 2223|  1.60k|                     clean_view = clean_storage;
 2224|  1.60k|                  }
 2225|  1.70k|                  else {
 2226|  1.70k|                     clean_view = raw_digits;
 2227|  1.70k|                  }
 2228|       |
 2229|  3.31k|                  uint64_t parsed_int{};
 2230|  3.31k|                  auto [ptr, ec] =
 2231|  3.31k|                     std::from_chars(clean_view.data(), clean_view.data() + clean_view.size(), parsed_int, base);
 2232|  3.31k|                  if (ec != std::errc{} || ptr != (clean_view.data() + clean_view.size())) {
  ------------------
  |  Branch (2232:23): [True: 1.53k, False: 1.77k]
  |  Branch (2232:44): [True: 883, False: 896]
  ------------------
 2233|  2.41k|                     ctx.error = error_code::parse_number_failure;
 2234|  2.41k|                     finalize();
 2235|  2.41k|                     return;
 2236|  2.41k|                  }
 2237|       |
 2238|    896|                  const auto as_float = static_cast<std::remove_cvref_t<T>>(parsed_int);
 2239|    896|                  value = negative ? -as_float : as_float;
  ------------------
  |  Branch (2239:27): [True: 479, False: 417]
  ------------------
 2240|    896|                  finalize();
 2241|    896|                  return;
 2242|  3.31k|               }
 2243|  5.02k|            }
 2244|  18.7k|         }
 2245|       |
 2246|       |         // Standard number parsing - only allocate if underscores present
 2247|  15.4k|         const bool has_underscores = (num_str.find('_') != std::string_view::npos);
 2248|       |
 2249|  18.7k|         std::string clean_storage;
 2250|  18.7k|         std::string_view clean_view;
 2251|       |
 2252|  18.7k|         if (has_underscores) {
  ------------------
  |  Branch (2252:14): [True: 985, False: 17.7k]
  ------------------
 2253|    985|            clean_storage.reserve(num_str.size());
 2254|   960k|            for (char c : num_str) {
  ------------------
  |  Branch (2254:25): [True: 960k, False: 985]
  ------------------
 2255|   960k|               if (c != '_') {
  ------------------
  |  Branch (2255:20): [True: 958k, False: 2.32k]
  ------------------
 2256|   958k|                  clean_storage.push_back(c);
 2257|   958k|               }
 2258|   960k|            }
 2259|    985|            clean_view = clean_storage;
 2260|    985|         }
 2261|  17.7k|         else {
 2262|  17.7k|            clean_view = num_str;
 2263|  17.7k|         }
 2264|       |
 2265|       |         // YAML allows leading '+' for positive numbers, but C++ from_chars doesn't
 2266|       |         // Strip leading '+' if present
 2267|  18.7k|         auto parse_view = clean_view;
 2268|  18.7k|         if (!parse_view.empty() && parse_view.front() == '+') {
  ------------------
  |  Branch (2268:14): [True: 13.6k, False: 5.10k]
  |  Branch (2268:37): [True: 1.75k, False: 11.9k]
  ------------------
 2269|  1.75k|            parse_view.remove_prefix(1);
 2270|  1.75k|            if (parse_view.empty()) {
  ------------------
  |  Branch (2270:17): [True: 275, False: 1.48k]
  ------------------
 2271|    275|               ctx.error = error_code::parse_number_failure;
 2272|    275|               return;
 2273|    275|            }
 2274|  1.75k|         }
 2275|       |
 2276|  18.5k|         if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2277|  18.5k|            auto result = glz::fast_float::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2278|       |            // Check both for errors and that all input was consumed (e.g., "12:30" is not a valid number)
 2279|  18.5k|            if (result.ec != std::errc{} || result.ptr != parse_view.data() + parse_view.size()) {
  ------------------
  |  Branch (2279:17): [True: 10.7k, False: 7.79k]
  |  Branch (2279:45): [True: 5.68k, False: 2.10k]
  ------------------
 2280|  11.3k|               ctx.error = error_code::parse_number_failure;
 2281|  11.3k|            }
 2282|       |         }
 2283|       |         else {
 2284|       |            auto [ptr, ec] = std::from_chars(parse_view.data(), parse_view.data() + parse_view.size(), value);
 2285|       |            // Check both for errors and that all input was consumed
 2286|       |            if (ec != std::errc{} || ptr != parse_view.data() + parse_view.size()) {
 2287|       |               ctx.error = error_code::parse_number_failure;
 2288|       |            }
 2289|       |         }
 2290|       |
 2291|  18.5k|         finalize();
 2292|  18.5k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1EEELb0ERdNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EdE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj32EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  22.4k|      {
  466|  22.4k|         skip_inline_ws(it, end);
  467|       |
  468|  22.4k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 143, False: 22.3k]
  ------------------
  469|    143|            if constexpr (!AllowEmptyInput) {
  470|    143|               ctx.error = error_code::unexpected_end;
  471|    143|            }
  472|    143|            return true;
  473|    143|         }
  474|       |
  475|  22.3k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  22.3k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 231, False: 22.0k]
  ------------------
  477|    231|            ctx.error = error_code::syntax_error;
  478|    231|            return true;
  479|    231|         }
  480|  22.0k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 73, False: 22.0k]
  ------------------
  481|     73|            ctx.error = error_code::syntax_error;
  482|     73|            return true;
  483|     73|         }
  484|       |
  485|  22.0k|         skip_inline_ws(it, end);
  486|       |
  487|  22.0k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 87, False: 21.9k]
  ------------------
  488|     87|            if constexpr (!AllowEmptyInput) {
  489|     87|               ctx.error = error_code::unexpected_end;
  490|     87|            }
  491|     87|            return true;
  492|     87|         }
  493|       |
  494|  21.9k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 2.13k, False: 19.8k]
  ------------------
  495|  2.13k|            return true;
  496|  2.13k|         }
  497|       |
  498|  19.8k|         return false;
  499|  21.9k|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2052|  22.0k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble, [](yaml::yaml_tag tag) {
 2053|  22.0k|                if constexpr (std::floating_point<std::remove_cvref_t<T>>) {
 2054|  22.0k|                   return yaml::tag_valid_for_float(tag);
 2055|       |                }
 2056|       |                else {
 2057|       |                   return yaml::tag_valid_for_int(tag);
 2058|       |                }
 2059|  22.0k|             }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1EEERdNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  21.9k|      {
  409|  21.9k|         state.has_anchor = false;
  410|  21.9k|         state.anchor_name.clear();
  411|  21.9k|         state.anchor_start = nullptr;
  412|  21.9k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  21.9k|         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|  21.9k|            else {
  421|  21.9k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 1.78k, False: 20.1k]
  ------------------
  422|  21.9k|            }
  423|  21.9k|         }
  424|       |
  425|  21.9k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 20.1k, False: 1.78k]
  |  Branch (425:27): [True: 1.90k, False: 18.2k]
  ------------------
  426|  1.90k|            ++it;
  427|  1.90k|            auto name = parse_anchor_name(it, end);
  428|  1.90k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 153, False: 1.74k]
  ------------------
  429|    153|               ctx.error = error_code::syntax_error;
  430|    153|               return true;
  431|    153|            }
  432|  1.74k|            skip_inline_ws(it, end);
  433|  1.74k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 195, False: 1.55k]
  ------------------
  434|    195|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|    195|                  ctx.error = error_code::unexpected_end;
  436|    195|               }
  437|    195|               return true;
  438|    195|            }
  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.55k|            state.has_anchor = true;
  446|  1.55k|            state.anchor_name = std::string(name);
  447|  1.55k|            state.anchor_start = &*it;
  448|  1.55k|         }
  449|       |
  450|  21.5k|         return false;
  451|  21.9k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERdNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  21.9k|      {
  301|  21.9k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 21.9k]
  |  Branch (301:27): [True: 20.1k, False: 1.78k]
  ------------------
  302|       |
  303|  1.78k|         ++it; // skip '*'
  304|  1.78k|         auto name = parse_anchor_name(it, end);
  305|  1.78k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 275, False: 1.50k]
  ------------------
  306|    275|            ctx.error = error_code::syntax_error;
  307|    275|            return true;
  308|    275|         }
  309|       |
  310|  1.50k|         auto anchor_it = ctx.anchors.find(name);
  311|  1.50k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 499, False: 1.00k]
  ------------------
  312|    499|            ctx.error = error_code::syntax_error; // undefined alias
  313|    499|            return true;
  314|    499|         }
  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.00k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.00k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 72, False: 937]
  ------------------
  322|     72|            return true;
  323|     72|         }
  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|    937|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 3, False: 934]
  ------------------
  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|    934|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    934|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 2, False: 932]
  ------------------
  339|      2|            return true;
  340|       |
  341|    932|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 932]
  ------------------
  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|    932|         auto replay_it = span.begin;
  348|    932|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    932|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    932|         ctx.indent_stack.clear();
  353|    932|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 692, False: 240]
  ------------------
  354|    692|            ctx.push_indent(span.base_indent - 1);
  355|    692|         }
  356|       |
  357|    932|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    932|         using V = std::remove_cvref_t<T>;
  360|    932|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    932|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    932|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    932|         return true;
  367|    932|      }
_ZZN3glz4fromILj450EdE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRdTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlvE_clEv:
 2062|  18.5k|         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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  5.89k|      {
 5206|  5.89k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  5.89k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  5.89k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  5.89k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  5.89k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 5.89k, False: 0]
  ------------------
 5216|  5.89k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  5.89k|      }
_ZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2012|  6.20k|      {
 2013|  6.20k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2013:14): [True: 0, False: 6.20k]
  ------------------
 2014|      0|            return;
 2015|       |
 2016|  6.20k|         yaml::node_preamble_state preamble{};
 2017|  6.20k|         if (yaml::parse_node_preamble<Opts>(value, ctx, it, end, preamble,
  ------------------
  |  Branch (2017:14): [True: 696, False: 5.50k]
  ------------------
 2018|  6.20k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
 2019|    696|            return;
 2020|       |
 2021|       |         // Parse as plain scalar first
 2022|  5.50k|         std::string str;
 2023|  5.50k|         yaml::parse_plain_scalar(str, ctx, it, end, yaml::check_flow_context(Opts));
 2024|       |
 2025|  5.50k|         if (str == "true" || str == "True" || str == "TRUE" || str == "yes" || str == "Yes" || str == "YES" ||
  ------------------
  |  Branch (2025:14): [True: 1.65k, False: 3.85k]
  |  Branch (2025:31): [True: 1.04k, False: 2.80k]
  |  Branch (2025:48): [True: 22, False: 2.78k]
  |  Branch (2025:65): [True: 121, False: 2.66k]
  |  Branch (2025:81): [True: 134, False: 2.53k]
  |  Branch (2025:97): [True: 1, False: 2.52k]
  ------------------
 2026|  3.44k|             str == "on" || str == "On" || str == "ON") {
  ------------------
  |  Branch (2026:14): [True: 323, False: 2.20k]
  |  Branch (2026:29): [True: 51, False: 2.15k]
  |  Branch (2026:44): [True: 88, False: 2.06k]
  ------------------
 2027|  3.44k|            value = true;
 2028|  3.44k|         }
 2029|  2.06k|         else if (str == "false" || str == "False" || str == "FALSE" || str == "no" || str == "No" || str == "NO" ||
  ------------------
  |  Branch (2029:19): [True: 286, False: 1.78k]
  |  Branch (2029:37): [True: 217, False: 1.56k]
  |  Branch (2029:55): [True: 447, False: 1.11k]
  |  Branch (2029:73): [True: 585, False: 532]
  |  Branch (2029:88): [True: 307, False: 225]
  |  Branch (2029:103): [True: 12, False: 213]
  ------------------
 2030|  1.88k|                  str == "off" || str == "Off" || str == "OFF") {
  ------------------
  |  Branch (2030:19): [True: 18, False: 195]
  |  Branch (2030:35): [True: 1, False: 194]
  |  Branch (2030:51): [True: 10, False: 184]
  ------------------
 2031|  1.88k|            value = false;
 2032|  1.88k|         }
 2033|    184|         else {
 2034|    184|            ctx.error = error_code::expected_true_or_false;
 2035|    184|         }
 2036|       |
 2037|  5.50k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 2038|  5.50k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1EEELb0ERbNS0_12yaml_contextEPKcS7_ZNS_4fromILj450EbE2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj32EEERS7_S4_TkNS_10is_contextERS5_S7_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSG_RSJ_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  6.20k|      {
  466|  6.20k|         skip_inline_ws(it, end);
  467|       |
  468|  6.20k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 0, False: 6.20k]
  ------------------
  469|      0|            if constexpr (!AllowEmptyInput) {
  470|      0|               ctx.error = error_code::unexpected_end;
  471|      0|            }
  472|      0|            return true;
  473|      0|         }
  474|       |
  475|  6.20k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  6.20k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 1, False: 6.20k]
  ------------------
  477|      1|            ctx.error = error_code::syntax_error;
  478|      1|            return true;
  479|      1|         }
  480|  6.20k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 2, False: 6.20k]
  ------------------
  481|      2|            ctx.error = error_code::syntax_error;
  482|      2|            return true;
  483|      2|         }
  484|       |
  485|  6.20k|         skip_inline_ws(it, end);
  486|       |
  487|  6.20k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 2, False: 6.20k]
  ------------------
  488|      2|            if constexpr (!AllowEmptyInput) {
  489|      2|               ctx.error = error_code::unexpected_end;
  490|      2|            }
  491|      2|            return true;
  492|      2|         }
  493|       |
  494|  6.20k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 691, False: 5.50k]
  ------------------
  495|    691|            return true;
  496|    691|         }
  497|       |
  498|  5.50k|         return false;
  499|  6.20k|      }
_ZZN3glz4fromILj450EbE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRbTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_ENKUlNS3_8yaml_tagEE_clESI_:
 2018|  6.20k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_bool(tag); }))
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1EEERbNS0_12yaml_contextEPKcS7_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  6.20k|      {
  409|  6.20k|         state.has_anchor = false;
  410|  6.20k|         state.anchor_name.clear();
  411|  6.20k|         state.anchor_start = nullptr;
  412|  6.20k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  6.20k|         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|  6.20k|            else {
  421|  6.20k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 680, False: 5.52k]
  ------------------
  422|  6.20k|            }
  423|  6.20k|         }
  424|       |
  425|  6.20k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 5.52k, False: 680]
  |  Branch (425:27): [True: 702, False: 4.81k]
  ------------------
  426|    702|            ++it;
  427|    702|            auto name = parse_anchor_name(it, end);
  428|    702|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 3, False: 699]
  ------------------
  429|      3|               ctx.error = error_code::syntax_error;
  430|      3|               return true;
  431|      3|            }
  432|    699|            skip_inline_ws(it, end);
  433|    699|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 8, False: 691]
  ------------------
  434|      8|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|      8|                  ctx.error = error_code::unexpected_end;
  436|      8|               }
  437|      8|               return true;
  438|      8|            }
  439|       |            if constexpr (Policy.disallow_anchor_on_alias) {
  440|       |               if (*it == '*') {
  441|       |                  ctx.error = error_code::syntax_error;
  442|       |                  return true;
  443|       |               }
  444|       |            }
  445|    691|            state.has_anchor = true;
  446|    691|            state.anchor_name = std::string(name);
  447|    691|            state.anchor_start = &*it;
  448|    691|         }
  449|       |
  450|  6.18k|         return false;
  451|  6.20k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERbNS0_12yaml_contextEPKcS6_EEbOT0_RT1_RT2_T3_:
  300|  6.20k|      {
  301|  6.20k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 6.20k]
  |  Branch (301:27): [True: 5.52k, False: 680]
  ------------------
  302|       |
  303|    680|         ++it; // skip '*'
  304|    680|         auto name = parse_anchor_name(it, end);
  305|    680|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 2, False: 678]
  ------------------
  306|      2|            ctx.error = error_code::syntax_error;
  307|      2|            return true;
  308|      2|         }
  309|       |
  310|    678|         auto anchor_it = ctx.anchors.find(name);
  311|    678|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 32, False: 646]
  ------------------
  312|     32|            ctx.error = error_code::syntax_error; // undefined alias
  313|     32|            return true;
  314|     32|         }
  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|    646|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|    646|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 332, False: 314]
  ------------------
  322|    332|            return true;
  323|    332|         }
  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|    314|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 4, False: 310]
  ------------------
  329|      4|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      4|            return true;
  331|      4|         }
  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|    310|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|    310|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 1, False: 309]
  ------------------
  339|      1|            return true;
  340|       |
  341|    309|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 309]
  ------------------
  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|    309|         auto replay_it = span.begin;
  348|    309|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|    309|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|    309|         ctx.indent_stack.clear();
  353|    309|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 292, False: 17]
  ------------------
  354|    292|            ctx.push_indent(span.base_indent - 1);
  355|    292|         }
  356|       |
  357|    309|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|    309|         using V = std::remove_cvref_t<T>;
  360|    309|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|    309|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|    309|         ctx.indent_stack = std::move(saved_indent_stack);
  366|    309|         return true;
  367|    309|      }
_ZN3glz4fromILj450EDnE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRDnTkNS_10is_contextERNS3_12yaml_contextES6_EEvOT1_OT2_OT0_T3_:
 2398|  1.43k|      {
 2399|  1.43k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2399:14): [True: 0, False: 1.43k]
  ------------------
 2400|      0|            return;
 2401|       |
 2402|  1.43k|         yaml::skip_inline_ws(it, end);
 2403|       |
 2404|  1.43k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2404:14): [True: 3, False: 1.43k]
  ------------------
 2405|      3|            ctx.error = error_code::unexpected_end;
 2406|      3|            return;
 2407|      3|         }
 2408|       |
 2409|       |         // Check for null values: null, Null, NULL, ~
 2410|  1.43k|         if (*it == '~') {
  ------------------
  |  Branch (2410:14): [True: 384, False: 1.05k]
  ------------------
 2411|    384|            ++it;
 2412|    384|            return;
 2413|    384|         }
 2414|       |
 2415|       |         // Parse as plain scalar and check if it's a null keyword
 2416|  1.05k|         auto start = it;
 2417|  4.84k|         while (it != end && !yaml::plain_scalar_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (2417:17): [True: 4.67k, False: 165]
  |  Branch (2417:30): [True: 3.79k, False: 885]
  ------------------
 2418|  3.79k|            ++it;
 2419|  3.79k|         }
 2420|       |
 2421|  1.05k|         std::string_view str{start, static_cast<size_t>(it - start)};
 2422|  1.05k|         if (!yaml::is_yaml_null(str)) {
  ------------------
  |  Branch (2422:14): [True: 33, False: 1.01k]
  ------------------
 2423|     33|            ctx.error = error_code::syntax_error;
 2424|     33|         }
 2425|  1.05k|      }
_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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_TkNS_10is_contextERNSL_12yaml_contextERPKcSR_EEvOT0_OT1_OT2_T3_:
 5205|  73.7k|      {
 5206|  73.7k|         constexpr auto category_count = yaml_variant_count_v<Variant, Trait>;
 5207|       |
 5208|       |         if constexpr (category_count == 0) {
 5209|       |            ctx.error = error_code::no_matching_variant_type;
 5210|       |         }
 5211|  73.7k|         else if constexpr (category_count == 1) {
 5212|       |            // Only one type in this category, use it directly
 5213|  73.7k|            constexpr auto first_idx = yaml_variant_first_index_v<Variant, Trait>;
 5214|  73.7k|            using V = std::variant_alternative_t<first_idx, Variant>;
 5215|  73.7k|            if (!std::holds_alternative<V>(value)) value = V{};
  ------------------
  |  Branch (5215:17): [True: 73.7k, False: 0]
  ------------------
 5216|  73.7k|            from<YAML, V>::template op<Opts>(std::get<V>(value), ctx, it, end);
 5217|       |         }
 5218|       |         else {
 5219|       |            // Multiple types in this category, try each one
 5220|       |            constexpr auto N = std::variant_size_v<Variant>;
 5221|       |            bool found_match{};
 5222|       |            size_t match_idx = 0;
 5223|       |            // Only the last alternative propagates its error, so an alternative that exhausted an
 5224|       |            // expansion budget would otherwise be reported as no_matching_variant_type -- a wrong
 5225|       |            // diagnosis for a document that is hostile rather than merely the wrong shape. Held
 5226|       |            // aside and used only if nothing matched, so an alternative that does succeed later
 5227|       |            // (one that materializes no key text can still parse under a latched budget) is
 5228|       |            // unaffected.
 5229|       |            error_code expansion_error{};
 5230|       |            std::string_view expansion_message{};
 5231|       |
 5232|       |            for_each<N>([&]<size_t I>() {
 5233|       |               if (found_match) {
 5234|       |                  return;
 5235|       |               }
 5236|       |               using V = std::variant_alternative_t<I, Variant>;
 5237|       |               if constexpr (Trait<V>::value) {
 5238|       |                  auto copy_it = it;
 5239|       |                  if (!std::holds_alternative<V>(value)) {
 5240|       |                     value = V{};
 5241|       |                  }
 5242|       |
 5243|       |                  auto temp_ctx = ctx.make_speculative();
 5244|       |                  from<YAML, V>::template op<Opts>(std::get<V>(value), temp_ctx, it, end);
 5245|       |
 5246|       |                  // Charged whether or not the alternative fit: a rejected probe still replayed
 5247|       |                  // whatever aliases it reached, and an attempt that is never billed is an
 5248|       |                  // attempt that can be repeated for free.
 5249|       |                  ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget;
 5250|       |                  ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5251|       |
 5252|       |                  if (!bool(temp_ctx.error)) {
 5253|       |                     found_match = true;
 5254|       |                     ctx.anchors = std::move(temp_ctx.anchors);
 5255|       |                  }
 5256|       |                  else {
 5257|       |                     it = copy_it;
 5258|       |                     if (temp_ctx.error == error_code::exceeded_max_expansion && expansion_error == error_code::none) {
 5259|       |                        expansion_error = temp_ctx.error;
 5260|       |                        expansion_message = temp_ctx.custom_error_message;
 5261|       |                     }
 5262|       |                     if (match_idx + 1 < category_count) {
 5263|       |                        // Not the last type, continue trying
 5264|       |                     }
 5265|       |                     else {
 5266|       |                        // Last type failed, propagate error
 5267|       |                        ctx.error = temp_ctx.error;
 5268|       |                        ctx.custom_error_message = temp_ctx.custom_error_message;
 5269|       |                     }
 5270|       |                  }
 5271|       |                  ++match_idx;
 5272|       |               }
 5273|       |            });
 5274|       |
 5275|       |            if (!found_match && !bool(ctx.error)) {
 5276|       |               if (expansion_error != error_code::none) {
 5277|       |                  ctx.error = expansion_error;
 5278|       |                  ctx.custom_error_message = expansion_message;
 5279|       |               }
 5280|       |               else {
 5281|       |                  ctx.error = error_code::no_matching_variant_type;
 5282|       |               }
 5283|       |            }
 5284|       |         }
 5285|  73.7k|      }
_ZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_:
 4098|  75.1k|      {
 4099|  75.1k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (4099:14): [True: 0, False: 75.1k]
  ------------------
 4100|      0|            return;
 4101|       |
 4102|       |         // Peek ahead to check for tag (don't consume indentation for block sequences)
 4103|  75.1k|         auto peek = it;
 4104|  75.1k|         yaml::node_preamble_state preamble{};
 4105|  75.1k|         if (yaml::parse_node_preamble<Opts>(value, ctx, peek, end, preamble,
  ------------------
  |  Branch (4105:14): [True: 1.75k, False: 73.3k]
  ------------------
 4106|  75.1k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
 4107|  1.75k|            it = peek;
 4108|  1.75k|            return;
 4109|  1.75k|         }
 4110|       |
 4111|  73.3k|         if (*peek == '[') {
  ------------------
  |  Branch (4111:14): [True: 26.2k, False: 47.1k]
  ------------------
 4112|       |            // Flow sequence - consume whitespace and parse
 4113|  26.2k|            it = peek;
 4114|  26.2k|            yaml::parse_flow_sequence<Opts>(value, ctx, it, end);
 4115|  26.2k|         }
 4116|  47.1k|         else if (*peek == '-') {
  ------------------
  |  Branch (4116:19): [True: 47.0k, False: 99]
  ------------------
 4117|       |            // Block sequence - don't consume leading whitespace, let parse_block_sequence handle it
 4118|       |            // But if there was a tag, we need to advance past it
 4119|  47.0k|            if (preamble.tag != yaml::yaml_tag::none || preamble.node_props.has_anchor) {
  ------------------
  |  Branch (4119:17): [True: 31, False: 46.9k]
  |  Branch (4119:57): [True: 1.15k, False: 45.8k]
  ------------------
 4120|  1.18k|               it = peek;
 4121|  1.18k|            }
 4122|  47.0k|            int32_t seq_indent = ctx.current_indent();
 4123|  47.0k|            if (*it == '-' && ctx.current_indent() >= 0) {
  ------------------
  |  Branch (4123:17): [True: 46.9k, False: 59]
  |  Branch (4123:31): [True: 43.1k, False: 3.76k]
  ------------------
 4124|  43.1k|               seq_indent = ctx.allow_indentless_sequence ? (ctx.current_indent() > 0 ? (ctx.current_indent() - 1) : 0)
  ------------------
  |  Branch (4124:29): [True: 32.2k, False: 10.9k]
  |  Branch (4124:62): [True: 16.4k, False: 15.8k]
  ------------------
 4125|  43.1k|                                                          : (ctx.current_indent() + 1);
 4126|  43.1k|            }
 4127|  47.0k|            yaml::parse_block_sequence<Opts>(value, ctx, it, end, seq_indent);
 4128|  47.0k|         }
 4129|     99|         else {
 4130|     99|            ctx.error = error_code::syntax_error;
 4131|     99|         }
 4132|       |
 4133|  73.3k|         yaml::finalize_node_anchor(preamble.node_props, ctx, it);
 4134|  73.3k|      }
_ZN3glz4yaml19parse_node_preambleITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1EEELb0ERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_ZNS_4fromILj450ESC_E2opITnDaXtlS2_Lj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSG_SD_TkNS_10is_contextERSE_SG_EEvOT1_OT2_OT0_T3_EUlNS0_8yaml_tagEE_EEbSP_RSS_RT4_T5_RNS0_19node_preamble_stateEOT6_:
  465|  75.1k|      {
  466|  75.1k|         skip_inline_ws(it, end);
  467|       |
  468|  75.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (468:14): [True: 1, False: 75.1k]
  ------------------
  469|      1|            if constexpr (!AllowEmptyInput) {
  470|      1|               ctx.error = error_code::unexpected_end;
  471|      1|            }
  472|      1|            return true;
  473|      1|         }
  474|       |
  475|  75.1k|         preamble.tag = parse_yaml_tag(it, end, ctx);
  476|  75.1k|         if (preamble.tag == yaml_tag::unknown) [[unlikely]] {
  ------------------
  |  Branch (476:14): [True: 1, False: 75.1k]
  ------------------
  477|      1|            ctx.error = error_code::syntax_error;
  478|      1|            return true;
  479|      1|         }
  480|  75.1k|         if (!tag_validator(preamble.tag)) [[unlikely]] {
  ------------------
  |  Branch (480:14): [True: 1, False: 75.1k]
  ------------------
  481|      1|            ctx.error = error_code::syntax_error;
  482|      1|            return true;
  483|      1|         }
  484|       |
  485|  75.1k|         skip_inline_ws(it, end);
  486|       |
  487|  75.1k|         if (it == end) [[unlikely]] {
  ------------------
  |  Branch (487:14): [True: 4, False: 75.1k]
  ------------------
  488|      4|            if constexpr (!AllowEmptyInput) {
  489|      4|               ctx.error = error_code::unexpected_end;
  490|      4|            }
  491|      4|            return true;
  492|      4|         }
  493|       |
  494|  75.1k|         if (parse_node_properties<Opts, PropertyPolicy>(std::forward<T>(value), ctx, it, end, preamble.node_props)) {
  ------------------
  |  Branch (494:14): [True: 1.75k, False: 73.3k]
  ------------------
  495|  1.75k|            return true;
  496|  1.75k|         }
  497|       |
  498|  73.3k|         return false;
  499|  75.1k|      }
_ZZN3glz4fromILj450ENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS1_9allocatorIS6_EEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRS9_TkNS_10is_contextERNSC_12yaml_contextESF_EEvOT1_OT2_OT0_T3_ENKUlNSC_8yaml_tagEE_clESR_:
 4106|  75.1k|                                             [](yaml::yaml_tag tag) { return yaml::tag_valid_for_seq(tag); })) {
_ZN3glz4yaml21parse_node_propertiesITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEEXtlNS0_20node_property_policyELb1EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS4_9allocatorIS9_EEEENS0_12yaml_contextEPKcSG_EEbOT1_RT2_RT3_T4_RNS0_19node_property_stateE:
  408|  75.1k|      {
  409|  75.1k|         state.has_anchor = false;
  410|  75.1k|         state.anchor_name.clear();
  411|  75.1k|         state.anchor_start = nullptr;
  412|  75.1k|         state.anchor_indent = ctx.current_indent();
  413|       |
  414|  75.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|  75.1k|            else {
  421|  75.1k|               if (handle_alias<Opts>(std::forward<T>(value), ctx, it, end)) return true;
  ------------------
  |  Branch (421:20): [True: 1.73k, False: 73.3k]
  ------------------
  422|  75.1k|            }
  423|  75.1k|         }
  424|       |
  425|  75.1k|         if (it != end && *it == '&') {
  ------------------
  |  Branch (425:14): [True: 73.3k, False: 1.73k]
  |  Branch (425:27): [True: 1.53k, False: 71.8k]
  ------------------
  426|  1.53k|            ++it;
  427|  1.53k|            auto name = parse_anchor_name(it, end);
  428|  1.53k|            if (name.empty()) {
  ------------------
  |  Branch (428:17): [True: 4, False: 1.53k]
  ------------------
  429|      4|               ctx.error = error_code::syntax_error;
  430|      4|               return true;
  431|      4|            }
  432|  1.53k|            skip_inline_ws(it, end);
  433|  1.53k|            if (it == end) {
  ------------------
  |  Branch (433:17): [True: 10, False: 1.52k]
  ------------------
  434|     10|               if constexpr (!Policy.allow_empty_after_anchor) {
  435|     10|                  ctx.error = error_code::unexpected_end;
  436|     10|               }
  437|     10|               return true;
  438|     10|            }
  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.52k|            state.has_anchor = true;
  446|  1.52k|            state.anchor_name = std::string(name);
  447|  1.52k|            state.anchor_start = &*it;
  448|  1.52k|         }
  449|       |
  450|  75.0k|         return false;
  451|  75.1k|      }
_ZN3glz4yaml12handle_aliasITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEbOT0_RT1_RT2_T3_:
  300|  75.1k|      {
  301|  75.1k|         if (it == end || *it != '*') return false;
  ------------------
  |  Branch (301:14): [True: 0, False: 75.1k]
  |  Branch (301:27): [True: 73.3k, False: 1.73k]
  ------------------
  302|       |
  303|  1.73k|         ++it; // skip '*'
  304|  1.73k|         auto name = parse_anchor_name(it, end);
  305|  1.73k|         if (name.empty()) {
  ------------------
  |  Branch (305:14): [True: 4, False: 1.73k]
  ------------------
  306|      4|            ctx.error = error_code::syntax_error;
  307|      4|            return true;
  308|      4|         }
  309|       |
  310|  1.73k|         auto anchor_it = ctx.anchors.find(name);
  311|  1.73k|         if (anchor_it == ctx.anchors.end()) {
  ------------------
  |  Branch (311:14): [True: 35, False: 1.69k]
  ------------------
  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|  1.69k|         const auto span = anchor_it->second;
  319|       |
  320|       |         // Empty anchor span (anchor on null/empty node) — leave value as default
  321|  1.69k|         if (span.begin == span.end) {
  ------------------
  |  Branch (321:14): [True: 350, False: 1.34k]
  ------------------
  322|    350|            return true;
  323|    350|         }
  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.34k|         if (ctx.alias_span_is_replaying(span.begin, span.end)) [[unlikely]] {
  ------------------
  |  Branch (328:14): [True: 2, False: 1.34k]
  ------------------
  329|      2|            ctx.error = error_code::syntax_error; // cyclic alias
  330|      2|            return true;
  331|      2|         }
  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.34k|         depth_guard guard{ctx, yaml::max_yaml_recursive_depth};
  338|  1.34k|         if (!guard) [[unlikely]]
  ------------------
  |  Branch (338:14): [True: 0, False: 1.34k]
  ------------------
  339|      0|            return true;
  340|       |
  341|  1.34k|         if (!ctx.charge_alias_expansion(static_cast<size_t>(span.end - span.begin))) [[unlikely]] {
  ------------------
  |  Branch (341:14): [True: 0, False: 1.34k]
  ------------------
  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.34k|         auto replay_it = span.begin;
  348|  1.34k|         auto replay_end = span.end;
  349|       |
  350|       |         // Save indent context and set up for replay
  351|  1.34k|         auto saved_indent_stack = std::move(ctx.indent_stack);
  352|  1.34k|         ctx.indent_stack.clear();
  353|  1.34k|         if (span.base_indent > 0) {
  ------------------
  |  Branch (353:14): [True: 1.21k, False: 132]
  ------------------
  354|  1.21k|            ctx.push_indent(span.base_indent - 1);
  355|  1.21k|         }
  356|       |
  357|  1.34k|         ctx.active_alias_spans.emplace_back(span.begin, span.end);
  358|       |
  359|  1.34k|         using V = std::remove_cvref_t<T>;
  360|  1.34k|         from<YAML, V>::template op<Opts>(std::forward<T>(value), ctx, replay_it, replay_end);
  361|       |
  362|  1.34k|         ctx.active_alias_spans.pop_back();
  363|       |
  364|       |         // Restore indent context
  365|  1.34k|         ctx.indent_stack = std::move(saved_indent_stack);
  366|  1.34k|         return true;
  367|  1.34k|      }
_ZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_:
 2596|  26.2k|      {
 2597|  26.2k|         using V = std::remove_cvref_t<T>;
 2598|  26.2k|         using value_type = typename V::value_type;
 2599|       |
 2600|  26.2k|         struct sequence_container_adapter
 2601|  26.2k|         {
 2602|  26.2k|            size_t index = 0;
 2603|       |
 2604|  26.2k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 2605|  26.2k|            {
 2606|  26.2k|               if constexpr (!resizable<V>) {
 2607|  26.2k|                  return index >= container.size();
 2608|  26.2k|               }
 2609|  26.2k|               else {
 2610|  26.2k|                  (void)container;
 2611|  26.2k|                  return false;
 2612|  26.2k|               }
 2613|  26.2k|            }
 2614|       |
 2615|  26.2k|            inline void commit_fixed_slot() noexcept { ++index; }
 2616|       |
 2617|  26.2k|            inline void append(V& container, value_type&& element) noexcept
 2618|  26.2k|            {
 2619|  26.2k|               if constexpr (emplace_backable<V>) {
 2620|  26.2k|                  container.emplace_back(std::move(element));
 2621|  26.2k|               }
 2622|  26.2k|               else if constexpr (emplaceable<V>) {
 2623|  26.2k|                  container.emplace(std::move(element));
 2624|  26.2k|               }
 2625|  26.2k|            }
 2626|  26.2k|         };
 2627|       |
 2628|  26.2k|         if (it == end || *it != '[') [[unlikely]] {
  ------------------
  |  Branch (2628:14): [True: 0, False: 26.2k]
  |  Branch (2628:27): [True: 0, False: 26.2k]
  ------------------
 2629|      0|            ctx.error = error_code::syntax_error;
 2630|      0|            return;
 2631|      0|         }
 2632|       |
 2633|       |         // Overwrite (do not append to) any pre-existing contents. Must happen
 2634|       |         // before the empty-array early return below so that `[]` also clears.
 2635|  26.2k|         clear_sequence_before_read<Opts>(value);
 2636|       |
 2637|  26.2k|         ++it; // Skip '['
 2638|       |         // Skip whitespace and newlines after opening bracket (YAML allows multi-line flow sequences)
 2639|  26.2k|         skip_flow_ws_and_newlines(ctx, it, end);
 2640|  26.2k|         if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2640:14): [True: 16, False: 26.2k]
  ------------------
 2641|     16|            return;
 2642|       |
 2643|       |         // Handle empty array
 2644|  26.2k|         if (it != end && *it == ']') {
  ------------------
  |  Branch (2644:14): [True: 25.6k, False: 581]
  |  Branch (2644:27): [True: 2.80k, False: 22.8k]
  ------------------
 2645|  2.80k|            ++it;
 2646|  2.80k|            validate_flow_node_adjacent_tail(ctx, it, end);
 2647|  2.80k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2647:17): [True: 14, False: 2.79k]
  ------------------
 2648|     14|               return;
 2649|  2.79k|            if constexpr (!yaml::check_flow_context(Opts)) {
 2650|  2.79k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2650:20): [True: 96, False: 2.69k]
  ------------------
 2651|     96|                  validate_root_flow_tail_after_close(ctx, it, end);
 2652|     96|               }
 2653|  2.79k|            }
 2654|  2.79k|            return;
 2655|  2.80k|         }
 2656|       |
 2657|  23.4k|         bool just_saw_comma = false;
 2658|  23.4k|         sequence_container_adapter adapter{};
 2659|       |
 2660|  23.4k|         if constexpr (emplace_backable<V> || emplaceable<V>) {
 2661|       |            // Dynamic containers append items (vector-like and set-like)
 2662|  43.8k|            while (it != end) {
  ------------------
  |  Branch (2662:20): [True: 42.3k, False: 1.49k]
  ------------------
 2663|  42.3k|               skip_flow_ws_and_newlines(ctx, it, end);
 2664|  42.3k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2664:20): [True: 0, False: 42.3k]
  ------------------
 2665|      0|                  return;
 2666|       |
 2667|  42.3k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2667:20): [True: 0, False: 42.3k]
  ------------------
 2668|      0|                  ctx.error = error_code::unexpected_end;
 2669|      0|                  return;
 2670|      0|               }
 2671|       |
 2672|  42.3k|               if (*it == ']') {
  ------------------
  |  Branch (2672:20): [True: 3.03k, False: 39.2k]
  ------------------
 2673|  3.03k|                  if (just_saw_comma) {
  ------------------
  |  Branch (2673:23): [True: 3.03k, False: 0]
  ------------------
 2674|  3.03k|                     ++it;
 2675|  3.03k|                     validate_flow_node_adjacent_tail(ctx, it, end);
 2676|  3.03k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2676:26): [True: 6, False: 3.03k]
  ------------------
 2677|      6|                        return;
 2678|  3.03k|                     if constexpr (!yaml::check_flow_context(Opts)) {
 2679|  3.03k|                        if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2679:29): [True: 83, False: 2.94k]
  ------------------
 2680|     83|                           validate_root_flow_tail_after_close(ctx, it, end);
 2681|     83|                        }
 2682|  3.03k|                     }
 2683|  3.03k|                     return;
 2684|  3.03k|                  }
 2685|      0|                  ctx.error = error_code::syntax_error;
 2686|      0|                  return;
 2687|  3.03k|               }
 2688|       |
 2689|  39.2k|               if (*it == ',' || *it == '#') {
  ------------------
  |  Branch (2689:20): [True: 261, False: 39.0k]
  |  Branch (2689:34): [True: 15, False: 39.0k]
  ------------------
 2690|    276|                  ctx.error = error_code::syntax_error;
 2691|    276|                  return;
 2692|    276|               }
 2693|  39.0k|               just_saw_comma = false;
 2694|       |
 2695|  39.0k|               value_type element{};
 2696|  39.0k|               from<YAML, value_type>::template op<flow_context_on<Opts>()>(element, ctx, it, end);
 2697|       |
 2698|  39.0k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2698:20): [True: 13.0k, False: 25.9k]
  ------------------
 2699|  13.0k|                  return;
 2700|       |
 2701|  25.9k|               bool saw_line_break_before_separator = false;
 2702|  25.9k|               skip_flow_ws_and_newlines(ctx, it, end, &saw_line_break_before_separator);
 2703|  25.9k|               if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2703:20): [True: 10, False: 25.9k]
  ------------------
 2704|     10|                  return;
 2705|       |
 2706|  25.9k|               if (it != end && *it == ':') {
  ------------------
  |  Branch (2706:20): [True: 24.3k, False: 1.59k]
  |  Branch (2706:33): [True: 6.01k, False: 18.3k]
  ------------------
 2707|       |                  // In flow sequences, implicit key-value pairs must be on a single line.
 2708|  6.01k|                  if (saw_line_break_before_separator) {
  ------------------
  |  Branch (2708:23): [True: 36, False: 5.97k]
  ------------------
 2709|     36|                     ctx.error = error_code::syntax_error;
 2710|     36|                     return;
 2711|     36|                  }
 2712|  5.97k|                  if constexpr (std::same_as<std::remove_cvref_t<value_type>, glz::generic>) {
 2713|  5.97k|                     glz::generic key_node = std::move(element);
 2714|  5.97k|                     ++it;
 2715|  5.97k|                     skip_inline_ws(it, end);
 2716|       |
 2717|  5.97k|                     glz::generic mapped{};
 2718|  5.97k|                     from<YAML, glz::generic>::template op<flow_context_on<Opts>()>(mapped, ctx, it, end);
 2719|  5.97k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2719:26): [True: 281, False: 5.69k]
  ------------------
 2720|    281|                        return;
 2721|       |
 2722|  5.69k|                     std::string key;
 2723|  5.69k|                     if (!yaml::materialize_key(key, key_node, ctx)) [[unlikely]]
  ------------------
  |  Branch (2723:26): [True: 2, False: 5.69k]
  ------------------
 2724|      2|                        return;
 2725|       |
 2726|  5.69k|                     glz::generic pair{};
 2727|  5.69k|                     pair[key] = std::move(mapped);
 2728|  5.69k|                     element = std::move(pair);
 2729|       |
 2730|  5.69k|                     skip_flow_ws_and_newlines(ctx, it, end);
 2731|  5.69k|                     if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2731:26): [True: 4, False: 5.69k]
  ------------------
 2732|      4|                        return;
 2733|       |                  }
 2734|       |                  else {
 2735|       |                     ctx.error = error_code::syntax_error;
 2736|       |                     return;
 2737|       |                  }
 2738|  5.97k|               }
 2739|       |
 2740|  25.8k|               adapter.append(value, std::move(element));
 2741|       |
 2742|  25.8k|               if (it == end) [[unlikely]] {
  ------------------
  |  Branch (2742:20): [True: 1.71k, False: 24.1k]
  ------------------
 2743|  1.71k|                  ctx.error = error_code::unexpected_end;
 2744|  1.71k|                  return;
 2745|  1.71k|               }
 2746|       |
 2747|  24.1k|               if (*it == ']') {
  ------------------
  |  Branch (2747:20): [True: 2.63k, False: 21.5k]
  ------------------
 2748|  2.63k|                  ++it;
 2749|  2.63k|                  validate_flow_node_adjacent_tail(ctx, it, end);
 2750|  2.63k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2750:23): [True: 84, False: 2.54k]
  ------------------
 2751|     84|                     return;
 2752|  2.54k|                  if constexpr (!yaml::check_flow_context(Opts)) {
 2753|  2.54k|                     if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (2753:26): [True: 223, False: 2.32k]
  ------------------
 2754|    223|                        validate_root_flow_tail_after_close(ctx, it, end);
 2755|    223|                     }
 2756|  2.54k|                  }
 2757|  2.54k|                  return;
 2758|  2.63k|               }
 2759|  21.5k|               else if (*it == ',') {
  ------------------
  |  Branch (2759:25): [True: 20.3k, False: 1.13k]
  ------------------
 2760|  20.3k|                  ++it;
 2761|  20.3k|                  just_saw_comma = true;
 2762|  20.3k|                  skip_flow_ws_and_newlines(ctx, it, end);
 2763|  20.3k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (2763:23): [True: 6, False: 20.3k]
  ------------------
 2764|      6|                     return;
 2765|  20.3k|               }
 2766|  1.13k|               else {
 2767|  1.13k|                  ctx.error = error_code::syntax_error;
 2768|  1.13k|                  return;
 2769|  1.13k|               }
 2770|  24.1k|            }
 2771|       |         }
 2772|       |         else if constexpr (!resizable<V>) {
 2773|       |            // Fixed-size containers (std::array)
 2774|       |            while (it != end && !adapter.fixed_capacity_reached(value)) {
 2775|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2776|       |               if (bool(ctx.error)) [[unlikely]]
 2777|       |                  return;
 2778|       |
 2779|       |               if (it == end) [[unlikely]] {
 2780|       |                  ctx.error = error_code::unexpected_end;
 2781|       |                  return;
 2782|       |               }
 2783|       |
 2784|       |               if (*it == ']') {
 2785|       |                  if (just_saw_comma) {
 2786|       |                     ++it;
 2787|       |                     validate_flow_node_adjacent_tail(ctx, it, end);
 2788|       |                     if (bool(ctx.error)) [[unlikely]]
 2789|       |                        return;
 2790|       |                     if constexpr (!yaml::check_flow_context(Opts)) {
 2791|       |                        if (ctx.current_indent() < 0) {
 2792|       |                           validate_root_flow_tail_after_close(ctx, it, end);
 2793|       |                        }
 2794|       |                     }
 2795|       |                     return;
 2796|       |                  }
 2797|       |                  ctx.error = error_code::syntax_error;
 2798|       |                  return;
 2799|       |               }
 2800|       |
 2801|       |               if (*it == ',' || *it == '#') {
 2802|       |                  ctx.error = error_code::syntax_error;
 2803|       |                  return;
 2804|       |               }
 2805|       |               just_saw_comma = false;
 2806|       |
 2807|       |               from<YAML, value_type>::template op<flow_context_on<Opts>()>(value[adapter.index], ctx, it, end);
 2808|       |
 2809|       |               if (bool(ctx.error)) [[unlikely]]
 2810|       |                  return;
 2811|       |
 2812|       |               adapter.commit_fixed_slot();
 2813|       |               skip_flow_ws_and_newlines(ctx, it, end);
 2814|       |               if (bool(ctx.error)) [[unlikely]]
 2815|       |                  return;
 2816|       |
 2817|       |               if (it == end) [[unlikely]] {
 2818|       |                  ctx.error = error_code::unexpected_end;
 2819|       |                  return;
 2820|       |               }
 2821|       |
 2822|       |               if (*it == ']') {
 2823|       |                  ++it;
 2824|       |                  validate_flow_node_adjacent_tail(ctx, it, end);
 2825|       |                  if (bool(ctx.error)) [[unlikely]]
 2826|       |                     return;
 2827|       |                  if constexpr (!yaml::check_flow_context(Opts)) {
 2828|       |                     if (ctx.current_indent() < 0) {
 2829|       |                        validate_root_flow_tail_after_close(ctx, it, end);
 2830|       |                     }
 2831|       |                  }
 2832|       |                  return;
 2833|       |               }
 2834|       |               else if (*it == ',') {
 2835|       |                  ++it;
 2836|       |                  just_saw_comma = true;
 2837|       |                  skip_flow_ws_and_newlines(ctx, it, end);
 2838|       |                  if (bool(ctx.error)) [[unlikely]]
 2839|       |                     return;
 2840|       |               }
 2841|       |               else {
 2842|       |                  ctx.error = error_code::syntax_error;
 2843|       |                  return;
 2844|       |               }
 2845|       |            }
 2846|       |
 2847|       |            // If we exited because the fixed-size container is full but haven't seen ']',
 2848|       |            // skip to the closing bracket to consume overflow elements.
 2849|       |            int bracket_depth = 1;
 2850|       |            while (it != end && bracket_depth > 0) {
 2851|       |               if (*it == '[') {
 2852|       |                  ++bracket_depth;
 2853|       |               }
 2854|       |               else if (*it == ']') {
 2855|       |                  --bracket_depth;
 2856|       |               }
 2857|       |               ++it;
 2858|       |            }
 2859|       |         }
 2860|       |         else {
 2861|       |            ctx.error = error_code::syntax_error;
 2862|       |            return;
 2863|       |         }
 2864|  23.4k|      }
_ZN3glz4yaml26clear_sequence_before_readITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEENSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEEEEvRT0_:
 2580|  73.2k|      {
 2581|  73.2k|         if constexpr (emplace_backable<V> && requires { value.clear(); }) {
 2582|       |            // vector-like: honor the append_arrays option, matching json/read.hpp
 2583|  73.2k|            if constexpr (!check_append_arrays(Opts)) {
 2584|  73.2k|               value.clear();
 2585|  73.2k|            }
 2586|       |         }
 2587|       |         else if constexpr (emplaceable<V> && requires { value.clear(); }) {
 2588|       |            // set-like: json/read.hpp clears unconditionally; append_arrays does not apply
 2589|       |            value.clear();
 2590|       |         }
 2591|  73.2k|      }
_ZZN3glz4yaml19parse_flow_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_EN26sequence_container_adapter6appendESC_OS8_:
 2618|  25.5k|            {
 2619|  25.5k|               if constexpr (emplace_backable<V>) {
 2620|  25.5k|                  container.emplace_back(std::move(element));
 2621|       |               }
 2622|       |               else if constexpr (emplaceable<V>) {
 2623|       |                  container.emplace(std::move(element));
 2624|       |               }
 2625|  25.5k|            }
_ZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_i:
 3081|  47.0k|      {
 3082|  47.0k|         using V = std::remove_cvref_t<T>;
 3083|  47.0k|         using value_type = typename V::value_type;
 3084|       |
 3085|  47.0k|         struct sequence_container_adapter
 3086|  47.0k|         {
 3087|  47.0k|            size_t index = 0;
 3088|       |
 3089|  47.0k|            inline bool fixed_capacity_reached(const V& container) const noexcept
 3090|  47.0k|            {
 3091|  47.0k|               if constexpr (!resizable<V>) {
 3092|  47.0k|                  return index >= container.size();
 3093|  47.0k|               }
 3094|  47.0k|               else {
 3095|  47.0k|                  (void)container;
 3096|  47.0k|                  return false;
 3097|  47.0k|               }
 3098|  47.0k|            }
 3099|       |
 3100|  47.0k|            inline void commit_fixed_slot() noexcept { ++index; }
 3101|       |
 3102|  47.0k|            inline void append(V& container, value_type&& element) noexcept
 3103|  47.0k|            {
 3104|  47.0k|               if constexpr (emplace_backable<V>) {
 3105|  47.0k|                  container.emplace_back(std::move(element));
 3106|  47.0k|               }
 3107|  47.0k|               else if constexpr (emplaceable<V>) {
 3108|  47.0k|                  container.emplace(std::move(element));
 3109|  47.0k|               }
 3110|  47.0k|            }
 3111|  47.0k|         };
 3112|       |
 3113|       |         // Overwrite (do not append to) any pre-existing contents. A block
 3114|       |         // sequence is only entered once a '-' item is confirmed, so clearing
 3115|       |         // up front correctly (re)assigns the container to the parsed sequence.
 3116|  47.0k|         clear_sequence_before_read<Opts>(value);
 3117|       |
 3118|  47.0k|         sequence_container_adapter adapter{};
 3119|       |
 3120|       |         // Track if this is the first item (for handling whitespace-consumed case)
 3121|  47.0k|         bool first_item = true;
 3122|  47.0k|         bool has_pending_item_anchor = false;
 3123|  47.0k|         std::string pending_item_anchor_name{};
 3124|  47.0k|         int32_t pending_item_anchor_indent = sequence_indent;
 3125|       |
 3126|   132k|         while (it != end) {
  ------------------
  |  Branch (3126:17): [True: 101k, False: 31.2k]
  ------------------
 3127|       |            // For fixed-size arrays (e.g. std::array), stop when we've filled all elements.
 3128|       |            // Exclude emplaceable types (e.g. std::set) which are not resizable but grow dynamically.
 3129|       |            if constexpr (!resizable<V> && !emplaceable<V>) {
 3130|       |               if (adapter.fixed_capacity_reached(value)) {
 3131|       |                  return;
 3132|       |               }
 3133|       |            }
 3134|       |
 3135|       |            // Skip blank lines and comments, track indent
 3136|   101k|            int32_t line_indent = 0;
 3137|   101k|            int32_t dash_col = -1; // actual column of the '-' on the line
 3138|   101k|            auto line_start = it;
 3139|       |
 3140|   150k|            while (it != end) {
  ------------------
  |  Branch (3140:20): [True: 148k, False: 2.21k]
  ------------------
 3141|   148k|               if (*it == '#') {
  ------------------
  |  Branch (3141:20): [True: 12.8k, False: 135k]
  ------------------
 3142|  12.8k|                  skip_comment(it, end);
 3143|  12.8k|                  skip_newline(it, end);
 3144|  12.8k|                  line_start = it;
 3145|  12.8k|                  line_indent = 0;
 3146|  12.8k|               }
 3147|   135k|               else if (*it == '\n' || *it == '\r') {
  ------------------
  |  Branch (3147:25): [True: 16.3k, False: 119k]
  |  Branch (3147:40): [True: 11.3k, False: 108k]
  ------------------
 3148|  27.7k|                  skip_newline(it, end);
 3149|  27.7k|                  line_start = it;
 3150|  27.7k|                  line_indent = 0;
 3151|  27.7k|               }
 3152|   108k|               else if (*it == ' ') {
  ------------------
  |  Branch (3152:25): [True: 19.2k, False: 88.8k]
  ------------------
 3153|  19.2k|                  line_start = it;
 3154|  19.2k|                  line_indent = 0;
 3155|  46.3k|                  while (it != end && *it == ' ') {
  ------------------
  |  Branch (3155:26): [True: 46.0k, False: 252]
  |  Branch (3155:39): [True: 27.0k, False: 18.9k]
  ------------------
 3156|  27.0k|                     ++line_indent;
 3157|  27.0k|                     ++it;
 3158|  27.0k|                  }
 3159|       |
 3160|  19.2k|                  bool saw_tab = false;
 3161|  20.2k|                  while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3161:26): [True: 19.9k, False: 259]
  |  Branch (3161:40): [True: 421, False: 19.5k]
  |  Branch (3161:54): [True: 543, False: 18.9k]
  ------------------
 3162|    964|                     saw_tab = saw_tab || (*it == '\t');
  ------------------
  |  Branch (3162:32): [True: 838, False: 126]
  |  Branch (3162:43): [True: 126, False: 0]
  ------------------
 3163|    964|                     ++it;
 3164|    964|                  }
 3165|       |
 3166|  19.2k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3166:23): [True: 259, False: 18.9k]
  |  Branch (3166:36): [True: 336, False: 18.6k]
  |  Branch (3166:51): [True: 524, False: 18.1k]
  |  Branch (3166:66): [True: 6.68k, False: 11.4k]
  ------------------
 3167|       |                     // Blank or comment line - continue to next line
 3168|  7.80k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3168:26): [True: 7.54k, False: 259]
  |  Branch (3168:39): [True: 6.68k, False: 860]
  ------------------
 3169|  6.68k|                        skip_comment(it, end);
 3170|  6.68k|                     }
 3171|  7.80k|                     line_indent = 0;
 3172|  7.80k|                     continue;
 3173|  7.80k|                  }
 3174|       |
 3175|  11.4k|                  if (saw_tab) {
  ------------------
  |  Branch (3175:23): [True: 11, False: 11.4k]
  ------------------
 3176|     11|                     ctx.error = error_code::syntax_error;
 3177|     11|                     return;
 3178|     11|                  }
 3179|  11.4k|                  break; // Found content
 3180|  11.4k|               }
 3181|  88.8k|               else if (*it == '\t') {
  ------------------
  |  Branch (3181:25): [True: 1.34k, False: 87.4k]
  ------------------
 3182|  1.34k|                  line_start = it;
 3183|  4.76k|                  while (it != end && (*it == ' ' || *it == '\t')) ++it;
  ------------------
  |  Branch (3183:26): [True: 4.69k, False: 70]
  |  Branch (3183:40): [True: 648, False: 4.05k]
  |  Branch (3183:54): [True: 2.77k, False: 1.27k]
  ------------------
 3184|  1.34k|                  if (it == end || *it == '\n' || *it == '\r' || *it == '#') {
  ------------------
  |  Branch (3184:23): [True: 70, False: 1.27k]
  |  Branch (3184:36): [True: 260, False: 1.01k]
  |  Branch (3184:51): [True: 417, False: 595]
  |  Branch (3184:66): [True: 573, False: 22]
  ------------------
 3185|  1.32k|                     if (it != end && *it == '#') {
  ------------------
  |  Branch (3185:26): [True: 1.25k, False: 70]
  |  Branch (3185:39): [True: 573, False: 677]
  ------------------
 3186|    573|                        skip_comment(it, end);
 3187|    573|                     }
 3188|  1.32k|                     line_indent = 0;
 3189|  1.32k|                     continue;
 3190|  1.32k|                  }
 3191|     22|                  ctx.error = error_code::syntax_error;
 3192|     22|                  return;
 3193|  1.34k|               }
 3194|  87.4k|               else {
 3195|       |                  // At content (no leading space on this line)
 3196|       |                  // If first item and at '-', whitespace was consumed by caller;
 3197|       |                  // treat as having correct indentation
 3198|  87.4k|                  if (first_item && *it == '-') {
  ------------------
  |  Branch (3198:23): [True: 47.0k, False: 40.4k]
  |  Branch (3198:37): [True: 46.9k, False: 59]
  ------------------
 3199|  46.9k|                     line_indent = sequence_indent;
 3200|  46.9k|                     if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3201|  46.9k|                        if (ctx.stream_begin && it > ctx.stream_begin) {
  ------------------
  |  Branch (3201:29): [True: 46.9k, False: 0]
  |  Branch (3201:49): [True: 46.6k, False: 346]
  ------------------
 3202|  46.6k|                           auto probe = it;
 3203|  46.6k|                           int32_t leading_ws = 0;
 3204|  46.6k|                           bool saw_tab = false;
 3205|  88.5k|                           while (probe > ctx.stream_begin && (*(probe - 1) == ' ' || *(probe - 1) == '\t')) {
  ------------------
  |  Branch (3205:35): [True: 88.4k, False: 58]
  |  Branch (3205:64): [True: 37.7k, False: 50.6k]
  |  Branch (3205:87): [True: 4.12k, False: 46.5k]
  ------------------
 3206|  41.9k|                              --probe;
 3207|  41.9k|                              ++leading_ws;
 3208|  41.9k|                              saw_tab = saw_tab || (*probe == '\t');
  ------------------
  |  Branch (3208:41): [True: 3.91k, False: 37.9k]
  |  Branch (3208:52): [True: 261, False: 37.7k]
  ------------------
 3209|  41.9k|                           }
 3210|  46.6k|                           if (probe == ctx.stream_begin || *(probe - 1) == '\n' || *(probe - 1) == '\r') {
  ------------------
  |  Branch (3210:32): [True: 58, False: 46.5k]
  |  Branch (3210:61): [True: 16.5k, False: 30.0k]
  |  Branch (3210:85): [True: 5.22k, False: 24.7k]
  ------------------
 3211|  21.8k|                              if (saw_tab) {
  ------------------
  |  Branch (3211:35): [True: 12, False: 21.8k]
  ------------------
 3212|     12|                                 ctx.error = error_code::syntax_error;
 3213|     12|                                 return;
 3214|     12|                              }
 3215|  21.8k|                              line_indent = (std::max)(line_indent, leading_ws);
 3216|  21.8k|                           }
 3217|  46.6k|                        }
 3218|  46.9k|                     }
 3219|  46.9k|                  }
 3220|  46.9k|                  break;
 3221|  87.4k|               }
 3222|   148k|            }
 3223|       |
 3224|   101k|            if (it == end) break;
  ------------------
  |  Branch (3224:17): [True: 2.21k, False: 98.9k]
  ------------------
 3225|       |
 3226|       |            // Check for document end marker
 3227|  98.9k|            if (at_document_end(it, end)) break;
  ------------------
  |  Branch (3227:17): [True: 1.62k, False: 97.3k]
  ------------------
 3228|       |
 3229|       |            // Check for dedent
 3230|  97.3k|            if (line_indent < sequence_indent) {
  ------------------
  |  Branch (3230:17): [True: 6.33k, False: 90.9k]
  ------------------
 3231|  6.33k|               it = line_start;
 3232|  6.33k|               return;
 3233|  6.33k|            }
 3234|       |
 3235|  90.9k|            if (*it == '&') {
  ------------------
  |  Branch (3235:17): [True: 12.8k, False: 78.0k]
  ------------------
 3236|       |               // Standalone anchor lines before "- item" are only supported for
 3237|       |               // indentless mapping values. At top-level block sequences these are
 3238|       |               // malformed in yaml-test-suite cases.
 3239|  12.8k|               if (!ctx.allow_indentless_sequence) {
  ------------------
  |  Branch (3239:20): [True: 12, False: 12.8k]
  ------------------
 3240|     12|                  ctx.error = error_code::syntax_error;
 3241|     12|                  return;
 3242|     12|               }
 3243|       |
 3244|  12.8k|               ++it;
 3245|  12.8k|               auto pending_name = parse_anchor_name(it, end);
 3246|  12.8k|               if (pending_name.empty()) {
  ------------------
  |  Branch (3246:20): [True: 5, False: 12.8k]
  ------------------
 3247|      5|                  ctx.error = error_code::syntax_error;
 3248|      5|                  return;
 3249|      5|               }
 3250|  12.8k|               skip_inline_ws(it, end);
 3251|  12.8k|               if (it != end && *it == '#') {
  ------------------
  |  Branch (3251:20): [True: 12.8k, False: 26]
  |  Branch (3251:33): [True: 6.32k, False: 6.51k]
  ------------------
 3252|  6.32k|                  skip_comment(it, end);
 3253|  6.32k|               }
 3254|       |
 3255|  12.8k|               has_pending_item_anchor = true;
 3256|  12.8k|               pending_item_anchor_name = std::string(pending_name);
 3257|  12.8k|               pending_item_anchor_indent = line_indent;
 3258|       |
 3259|  12.8k|               if (it == end || (*it != '\n' && *it != '\r')) {
  ------------------
  |  Branch (3259:20): [True: 37, False: 12.8k]
  |  Branch (3259:34): [True: 5.45k, False: 7.37k]
  |  Branch (3259:49): [True: 29, False: 5.42k]
  ------------------
 3260|     66|                  ctx.error = error_code::syntax_error;
 3261|     66|                  return;
 3262|     66|               }
 3263|       |
 3264|  12.7k|               skip_newline(it, end);
 3265|  12.7k|               continue;
 3266|  12.8k|            }
 3267|       |
 3268|       |            // Expect dash for sequence item
 3269|  78.0k|            if (*it != '-') {
  ------------------
  |  Branch (3269:17): [True: 4.02k, False: 74.0k]
  ------------------
 3270|  4.02k|               it = line_start;
 3271|  4.02k|               return;
 3272|  4.02k|            }
 3273|       |
 3274|       |            // Compute the actual column of this sequence dash.
 3275|       |            // This is needed by plain-scalar multiline folding to distinguish
 3276|       |            // sibling "- item" entries from deeper "- " continuation content.
 3277|  74.0k|            dash_col = line_indent;
 3278|  74.0k|            if constexpr (std::is_pointer_v<std::decay_t<It>>) {
 3279|  74.0k|               if (ctx.stream_begin) {
  ------------------
  |  Branch (3279:20): [True: 74.0k, False: 12]
  ------------------
 3280|  74.0k|                  dash_col = ctx.line_prefix_before(&*it).column;
 3281|  74.0k|               }
 3282|  74.0k|            }
 3283|       |
 3284|  74.0k|            ++it; // Skip '-'
 3285|       |
 3286|       |            // Check for valid sequence item indicator (- followed by space or newline)
 3287|  74.0k|            if (it != end && !yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3287:17): [True: 72.6k, False: 1.43k]
  |  Branch (3287:30): [True: 994, False: 71.6k]
  ------------------
 3288|       |               // Not a sequence item (could be a number like -5)
 3289|    994|               it = line_start;
 3290|    994|               return;
 3291|    994|            }
 3292|       |
 3293|  73.0k|            bool saw_tab_after_dash = false;
 3294|   116k|            while (it != end && (*it == ' ' || *it == '\t')) {
  ------------------
  |  Branch (3294:20): [True: 115k, False: 1.47k]
  |  Branch (3294:34): [True: 39.5k, False: 76.0k]
  |  Branch (3294:48): [True: 4.41k, False: 71.5k]
  ------------------
 3295|  43.9k|               saw_tab_after_dash = saw_tab_after_dash || (*it == '\t');
  ------------------
  |  Branch (3295:37): [True: 875, False: 43.0k]
  |  Branch (3295:59): [True: 3.70k, False: 39.3k]
  ------------------
 3296|  43.9k|               ++it;
 3297|  43.9k|            }
 3298|       |            // A tab-separated nested "- " marker is not valid block indentation.
 3299|  73.0k|            if (saw_tab_after_dash && it != end && *it == '-') {
  ------------------
  |  Branch (3299:17): [True: 3.70k, False: 69.3k]
  |  Branch (3299:39): [True: 3.69k, False: 7]
  |  Branch (3299:52): [True: 1.58k, False: 2.11k]
  ------------------
 3300|  1.58k|               const auto after_dash = it + 1;
 3301|  1.58k|               if (after_dash == end || yaml::whitespace_or_line_end_table[static_cast<uint8_t>(*after_dash)]) {
  ------------------
  |  Branch (3301:20): [True: 1, False: 1.58k]
  |  Branch (3301:41): [True: 2, False: 1.58k]
  ------------------
 3302|      3|                  ctx.error = error_code::syntax_error;
 3303|      3|                  return;
 3304|      3|               }
 3305|  1.58k|            }
 3306|       |
 3307|       |            // Get reference to element to parse into
 3308|  73.0k|            auto parse_element = [&](auto& element) {
 3309|  73.0k|               const char* element_start = (it != end) ? &*it : nullptr;
 3310|       |
 3311|       |               // Check what follows
 3312|  73.0k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  73.0k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
 3318|  73.0k|                     return;
 3319|  73.0k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  73.0k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  73.0k|                  ctx.sequence_item_value_context = true;
 3322|  73.0k|                  ctx.sequence_dash_indent = dash_col;
 3323|  73.0k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  73.0k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  73.0k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  73.0k|                  ctx.pop_indent();
 3327|  73.0k|               }
 3328|  73.0k|               else {
 3329|       |                  // Value on next line - nested block
 3330|  73.0k|                  skip_ws_and_comment(it, end);
 3331|  73.0k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  73.0k|                  auto nested_start = it;
 3335|  73.0k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  73.0k|                  if (bool(ctx.error)) [[unlikely]]
 3337|  73.0k|                     return;
 3338|  73.0k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  73.0k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
 3344|  73.0k|                  if (nested_indent > effective_line_indent) {
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  73.0k|                     const int32_t element_indent =
 3350|  73.0k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
 3351|  73.0k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
 3352|  73.0k|                        return;
 3353|  73.0k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  73.0k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  73.0k|                     ctx.sequence_item_value_context = true;
 3356|  73.0k|                     ctx.sequence_dash_indent = dash_col;
 3357|  73.0k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  73.0k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  73.0k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  73.0k|                     ctx.pop_indent();
 3361|  73.0k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  73.0k|               }
 3364|       |
 3365|  73.0k|               if (has_pending_item_anchor && !bool(ctx.error)) {
 3366|  73.0k|                  const char* element_end = (it != end) ? &*it : element_start;
 3367|  73.0k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  73.0k|                                                                      pending_item_anchor_indent};
 3369|  73.0k|                  has_pending_item_anchor = false;
 3370|  73.0k|               }
 3371|  73.0k|            };
 3372|       |
 3373|  73.0k|            if constexpr (emplace_backable<V>) {
 3374|  73.0k|               auto& element = value.emplace_back();
 3375|  73.0k|               parse_element(element);
 3376|       |            }
 3377|       |            else if constexpr (emplaceable<V>) {
 3378|       |               value_type element{};
 3379|       |               parse_element(element);
 3380|       |               if (!bool(ctx.error)) {
 3381|       |                  adapter.append(value, std::move(element));
 3382|       |               }
 3383|       |            }
 3384|       |            else if constexpr (!resizable<V>) {
 3385|       |               parse_element(value[adapter.index]);
 3386|       |               adapter.commit_fixed_slot();
 3387|       |            }
 3388|       |            else {
 3389|       |               ctx.error = error_code::syntax_error;
 3390|       |               return;
 3391|       |            }
 3392|       |
 3393|  73.0k|            first_item = false;
 3394|       |
 3395|  73.0k|            if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3395:17): [True: 465, False: 72.5k]
  ------------------
 3396|    465|               return;
 3397|       |
 3398|       |            // Note: after parsing nested block content, iterator may already be
 3399|       |            // at the start of the next line. The outer loop will handle it.
 3400|  73.0k|         }
 3401|  47.0k|      }
_ZZN3glz4yaml20parse_block_sequenceITnDaXtlNS0_9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNSt3__16vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS3_9allocatorIS8_EEEENS0_12yaml_contextEPKcSF_EEvOT0_RT1_RT2_T3_iENKUlRT_E_clIS8_EEDaSO_:
 3308|  73.0k|            auto parse_element = [&](auto& element) {
 3309|  73.0k|               const char* element_start = (it != end) ? &*it : nullptr;
  ------------------
  |  Branch (3309:44): [True: 71.5k, False: 1.46k]
  ------------------
 3310|       |
 3311|       |               // Check what follows
 3312|  73.0k|               if (it != end && !yaml::line_end_or_comment_table[static_cast<uint8_t>(*it)]) {
  ------------------
  |  Branch (3312:20): [True: 71.5k, False: 1.46k]
  |  Branch (3312:33): [True: 34.4k, False: 37.0k]
  ------------------
 3313|       |                  // Content on same line as dash - set indent to one less than content column
 3314|       |                  // This allows nested block mappings to continue parsing keys at the content indent
 3315|       |                  // For "- key: val", if dash is at column 0, content is at column 2
 3316|       |                  // We set parent indent to 1 so keys at column 2 pass the "indent > parent" check
 3317|  34.4k|                  if (!ctx.push_indent(line_indent + 1)) [[unlikely]]
  ------------------
  |  Branch (3317:23): [True: 0, False: 34.4k]
  ------------------
 3318|      0|                     return;
 3319|  34.4k|                  const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3320|  34.4k|                  const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3321|  34.4k|                  ctx.sequence_item_value_context = true;
 3322|  34.4k|                  ctx.sequence_dash_indent = dash_col;
 3323|  34.4k|                  from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3324|  34.4k|                  ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3325|  34.4k|                  ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3326|  34.4k|                  ctx.pop_indent();
 3327|  34.4k|               }
 3328|  38.5k|               else {
 3329|       |                  // Value on next line - nested block
 3330|  38.5k|                  skip_ws_and_comment(it, end);
 3331|  38.5k|                  skip_newline(it, end);
 3332|       |
 3333|       |                  // Get indent of nested content
 3334|  38.5k|                  auto nested_start = it;
 3335|  38.5k|                  int32_t nested_indent = measure_indent(it, end, ctx);
 3336|  38.5k|                  if (bool(ctx.error)) [[unlikely]]
  ------------------
  |  Branch (3336:23): [True: 6, False: 38.5k]
  ------------------
 3337|      6|                     return;
 3338|  38.5k|                  it = nested_start;
 3339|       |
 3340|       |                  // Content is nested only if indented more than the current line.
 3341|       |                  // When line_indent is negative (root level), use 0 as the baseline.
 3342|       |                  // This prevents content at column 0 from being treated as nested.
 3343|  38.5k|                  const int32_t effective_line_indent = (line_indent < 0) ? 0 : line_indent;
  ------------------
  |  Branch (3343:57): [True: 398, False: 38.1k]
  ------------------
 3344|  38.5k|                  if (nested_indent > effective_line_indent) {
  ------------------
  |  Branch (3344:23): [True: 17.2k, False: 21.2k]
  ------------------
 3345|       |                     // Save and set indent for nested parsing.
 3346|       |                     // A struct element reads the pushed indent as its own key column; every
 3347|       |                     // other element type reads it as the enclosing baseline, so it gets one
 3348|       |                     // less than the content indent and its content passes "indent > parent".
 3349|  17.2k|                     const int32_t element_indent =
 3350|  17.2k|                        receives_block_mapping_column<value_type>() ? nested_indent : nested_indent - 1;
  ------------------
  |  Branch (3350:25): [Folded, False: 17.2k]
  ------------------
 3351|  17.2k|                     if (!ctx.push_indent(element_indent)) [[unlikely]]
  ------------------
  |  Branch (3351:26): [True: 0, False: 17.2k]
  ------------------
 3352|      0|                        return;
 3353|  17.2k|                     const bool prev_sequence_item_value_context = ctx.sequence_item_value_context;
 3354|  17.2k|                     const int32_t prev_sequence_dash_indent = ctx.sequence_dash_indent;
 3355|  17.2k|                     ctx.sequence_item_value_context = true;
 3356|  17.2k|                     ctx.sequence_dash_indent = dash_col;
 3357|  17.2k|                     from<YAML, value_type>::template op<Opts>(element, ctx, it, end);
 3358|  17.2k|                     ctx.sequence_dash_indent = prev_sequence_dash_indent;
 3359|  17.2k|                     ctx.sequence_item_value_context = prev_sequence_item_value_context;
 3360|  17.2k|                     ctx.pop_indent();
 3361|  17.2k|                  }
 3362|       |                  // else: empty element (default constructed)
 3363|  38.5k|               }
 3364|       |
 3365|  73.0k|               if (has_pending_item_anchor && !bool(ctx.error)) {
  ------------------
  |  Branch (3365:20): [True: 7.62k, False: 65.4k]
  |  Branch (3365:47): [True: 7.59k, False: 39]
  ------------------
 3366|  7.59k|                  const char* element_end = (it != end) ? &*it : element_start;
  ------------------
  |  Branch (3366:45): [True: 6.54k, False: 1.04k]
  ------------------
 3367|  7.59k|                  ctx.anchors[std::move(pending_item_anchor_name)] = {element_start, element_end,
 3368|  7.59k|                                                                      pending_item_anchor_indent};
 3369|  7.59k|                  has_pending_item_anchor = false;
 3370|  7.59k|               }
 3371|  73.0k|            };
_ZN3glz29parse_block_mapping_or_stringINSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEETnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_RNSI_12yaml_contextERPKcSO_EEvOT1_OT2_OT3_T4_:
 5423|   167k|   {
 5424|       |      if constexpr (yaml::check_flow_context(Opts)) {
 5425|       |         // In flow context, only treat plain content as an implicit "key: value"
 5426|       |         // when a mapping separator appears before the next top-level flow delimiter.
 5427|       |         auto could_be_implicit_flow_pair = [&](auto pos) {
 5428|       |            // Bounded by the longest implicit key the spec allows: unbounded, this probe runs
 5429|       |            // once per entry per nesting level over the whole remaining flow collection.
 5430|       |            const auto stop = yaml::implicit_key_scan_end(pos, end);
 5431|       |            int depth = 0;
 5432|       |            while (pos != stop) {
 5433|       |               const char c = *pos;
 5434|       |               if (c == '"' || c == '\'') {
 5435|       |                  const char quote = c;
 5436|       |                  ++pos;
 5437|       |                  while (pos != stop && *pos != quote) {
 5438|       |                     if (*pos == '\\' && quote == '"') {
 5439|       |                        ++pos;
 5440|       |                        if (pos != stop) ++pos;
 5441|       |                     }
 5442|       |                     else {
 5443|       |                        ++pos;
 5444|       |                     }
 5445|       |                  }
 5446|       |                  if (pos != stop) ++pos;
 5447|       |                  continue;
 5448|       |               }
 5449|       |               if (c == '[' || c == '{') {
 5450|       |                  ++depth;
 5451|       |                  ++pos;
 5452|       |                  continue;
 5453|       |               }
 5454|       |               if (c == ']' || c == '}') {
 5455|       |                  if (depth == 0) return false;
 5456|       |                  --depth;
 5457|       |                  ++pos;
 5458|       |                  continue;
 5459|       |               }
 5460|       |               if (c == ',' && depth == 0) return false;
 5461|       |               if (c == ':' && depth == 0) {
 5462|       |                  auto next = pos + 1;
 5463|       |                  return next == end || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
 5464|       |               }
 5465|       |               ++pos;
 5466|       |            }
 5467|       |            return false;
 5468|       |         };
 5469|       |
 5470|       |         if (could_be_implicit_flow_pair(it) || line_could_be_flow_mapping(it, end)) {
 5471|       |            if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
 5472|       |               return;
 5473|       |            }
 5474|       |            if (bool(ctx.error)) {
 5475|       |               return;
 5476|       |            }
 5477|       |         }
 5478|       |
 5479|       |         process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5480|       |         return;
 5481|       |      }
 5482|       |
 5483|   167k|      if (try_parse_block_mapping_into_variant<Variant, Opts>(value, ctx, it, end)) {
  ------------------
  |  Branch (5483:11): [True: 83.6k, False: 84.1k]
  ------------------
 5484|  83.6k|         return;
 5485|  83.6k|      }
 5486|       |      // If an error was set (e.g., malformed flow collection in value), don't try to parse as string
 5487|  84.1k|      if (bool(ctx.error)) {
  ------------------
  |  Branch (5487:11): [True: 5.65k, False: 78.5k]
  ------------------
 5488|  5.65k|         return;
 5489|  5.65k|      }
 5490|  78.5k|      process_yaml_variant_alternatives<Variant, is_yaml_variant_str>::template op<Opts>(value, ctx, it, end);
 5491|  78.5k|   }
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E0_clISN_EEDaSZ_:
 5848|  15.9k|            auto is_word_boundary = [&](const auto ptr) {
 5849|  15.9k|               if (ptr == end) {
  ------------------
  |  Branch (5849:20): [True: 359, False: 15.5k]
  ------------------
 5850|    359|                  return true;
 5851|    359|               }
 5852|  15.5k|               if (*ptr == ':') {
  ------------------
  |  Branch (5852:20): [True: 10.0k, False: 5.46k]
  ------------------
 5853|  10.0k|                  auto next = ptr + 1;
 5854|  10.0k|                  return (next == end) || *next == ' ' || *next == '\t' || *next == '\n' || *next == '\r';
  ------------------
  |  Branch (5854:26): [True: 654, False: 9.42k]
  |  Branch (5854:43): [True: 6.99k, False: 2.42k]
  |  Branch (5854:59): [True: 1.05k, False: 1.37k]
  |  Branch (5854:76): [True: 633, False: 741]
  |  Branch (5854:93): [True: 462, False: 279]
  ------------------
 5855|  10.0k|               }
 5856|  5.46k|               return is_plain_scalar_boundary(*ptr);
 5857|  15.5k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlcE_clEc:
 5774|  5.46k|            auto is_plain_scalar_boundary = [](const char ch) {
 5775|  5.46k|               switch (ch) {
 5776|    312|               case ' ':
  ------------------
  |  Branch (5776:16): [True: 312, False: 5.15k]
  ------------------
 5777|    695|               case '\t':
  ------------------
  |  Branch (5777:16): [True: 383, False: 5.08k]
  ------------------
 5778|  2.43k|               case '\n':
  ------------------
  |  Branch (5778:16): [True: 1.74k, False: 3.72k]
  ------------------
 5779|  4.51k|               case '\r':
  ------------------
  |  Branch (5779:16): [True: 2.07k, False: 3.39k]
  ------------------
 5780|  4.51k|               case ',':
  ------------------
  |  Branch (5780:16): [True: 4, False: 5.46k]
  ------------------
 5781|  4.52k|               case ']':
  ------------------
  |  Branch (5781:16): [True: 12, False: 5.45k]
  ------------------
 5782|  4.53k|               case '}':
  ------------------
  |  Branch (5782:16): [True: 11, False: 5.45k]
  ------------------
 5783|  4.53k|                  return true;
 5784|    928|               default:
  ------------------
  |  Branch (5784:16): [True: 928, False: 4.53k]
  ------------------
 5785|    928|                  return false;
 5786|  5.46k|               }
 5787|  5.46k|            };
_ZZN3glz4fromILj450ENSt3__17variantIJDndNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbNS1_6vectorINS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEENS6_ISD_EEEENSC_ISD_EEEEEE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERPKcRSH_TkNS_10is_contextERNSK_12yaml_contextESN_EEvOT1_OT2_OT0_T3_ENKUlT_E_clISN_EEDaSZ_:
 5789|  14.6k|            auto has_indented_block_continuation = [&](auto word_end) {
 5790|       |               if constexpr (yaml::check_flow_context(Opts)) {
 5791|       |                  return false;
 5792|       |               }
 5793|  14.6k|               if (ctx.current_indent() < 0) {
  ------------------
  |  Branch (5793:20): [True: 688, False: 14.0k]
  ------------------
 5794|    688|                  return false;
 5795|    688|               }
 5796|  14.0k|               if (word_end == end || (*word_end != '\n' && *word_end != '\r')) {
  ------------------
  |  Branch (5796:20): [True: 284, False: 13.7k]
  |  Branch (5796:40): [True: 11.9k, False: 1.73k]
  |  Branch (5796:61): [True: 9.91k, False: 2.06k]
  ------------------
 5797|  10.2k|                  return false;
 5798|  10.2k|               }
 5799|       |
 5800|  3.80k|               auto look = word_end;
 5801|  3.80k|               yaml::skip_newline(look, end);
 5802|  13.0k|               while (look != end) {
  ------------------
  |  Branch (5802:23): [True: 12.3k, False: 693]
  ------------------
 5803|  12.3k|                  int32_t line_indent = 0;
 5804|  18.7k|                  while (look != end && *look == ' ') {
  ------------------
  |  Branch (5804:26): [True: 18.6k, False: 41]
  |  Branch (5804:41): [True: 6.31k, False: 12.3k]
  ------------------
 5805|  6.31k|                     ++line_indent;
 5806|  6.31k|                     ++look;
 5807|  6.31k|                  }
 5808|  12.3k|                  if (look != end && *look == '\t') {
  ------------------
  |  Branch (5808:23): [True: 12.3k, False: 41]
  |  Branch (5808:38): [True: 372, False: 11.9k]
  ------------------
 5809|    372|                     return false;
 5810|    372|                  }
 5811|  12.0k|                  if (look == end || *look == '\n' || *look == '\r') {
  ------------------
  |  Branch (5811:23): [True: 41, False: 11.9k]
  |  Branch (5811:38): [True: 1.31k, False: 10.6k]
  |  Branch (5811:55): [True: 3.96k, False: 6.70k]
  ------------------
 5812|  5.31k|                     if (look != end) {
  ------------------
  |  Branch (5812:26): [True: 5.27k, False: 41]
  ------------------
 5813|  5.27k|                        yaml::skip_newline(look, end);
 5814|  5.27k|                        continue;
 5815|  5.27k|                     }
 5816|     41|                     return false;
 5817|  5.31k|                  }
 5818|  6.70k|                  if (*look == '#') {
  ------------------
  |  Branch (5818:23): [True: 4.02k, False: 2.68k]
  ------------------
 5819|  4.02k|                     yaml::skip_comment(look, end);
 5820|  4.02k|                     if (look != end && (*look == '\n' || *look == '\r')) {
  ------------------
  |  Branch (5820:26): [True: 4.00k, False: 12]
  |  Branch (5820:42): [True: 3.04k, False: 962]
  |  Branch (5820:59): [True: 962, False: 0]
  ------------------
 5821|  4.00k|                        yaml::skip_newline(look, end);
 5822|  4.00k|                        continue;
 5823|  4.00k|                     }
 5824|     12|                     return false;
 5825|  4.02k|                  }
 5826|       |
 5827|       |                  // If the next non-empty line is an implicit mapping entry,
 5828|       |                  // don't treat it as scalar continuation for auto-deduced
 5829|       |                  // booleans/nulls.
 5830|  2.68k|                  {
 5831|  2.68k|                     auto scan = look;
 5832|   276k|                     while (scan != end && *scan != '\n' && *scan != '\r') {
  ------------------
  |  Branch (5832:29): [True: 276k, False: 118]
  |  Branch (5832:44): [True: 276k, False: 225]
  |  Branch (5832:61): [True: 276k, False: 155]
  ------------------
 5833|   276k|                        if (*scan == ':') {
  ------------------
  |  Branch (5833:29): [True: 9.83k, False: 266k]
  ------------------
 5834|  9.83k|                           auto after_colon = scan + 1;
 5835|  9.83k|                           if (after_colon == end || *after_colon == ' ' || *after_colon == '\t' ||
  ------------------
  |  Branch (5835:32): [True: 18, False: 9.81k]
  |  Branch (5835:54): [True: 1.14k, False: 8.67k]
  |  Branch (5835:77): [True: 446, False: 8.22k]
  ------------------
 5836|  8.22k|                               *after_colon == '\n' || *after_colon == '\r') {
  ------------------
  |  Branch (5836:32): [True: 119, False: 8.10k]
  |  Branch (5836:56): [True: 467, False: 7.64k]
  ------------------
 5837|  2.19k|                              return false;
 5838|  2.19k|                           }
 5839|  9.83k|                        }
 5840|   273k|                        ++scan;
 5841|   273k|                     }
 5842|  2.68k|                  }
 5843|       |
 5844|    498|                  return line_indent > ctx.current_indent();
 5845|  2.68k|               }
 5846|    693|               return false;
 5847|  3.80k|            };
_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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_:
 5377|   206k|   {
 5378|   206k|      using counts = yaml_variant_type_count<Variant>;
 5379|       |      if constexpr (counts::n_object == 0) {
 5380|       |         return false;
 5381|       |      }
 5382|   206k|      else {
 5383|       |         // Quick check: if no viable mapping separator in the current span,
 5384|       |         // avoid expensive speculative parse.
 5385|   206k|         const bool could_be_mapping = [&] {
 5386|   206k|            if constexpr (yaml::check_flow_context(Opts)) {
 5387|   206k|               return line_could_be_flow_mapping(it, end);
 5388|   206k|            }
 5389|   206k|            else {
 5390|   206k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   206k|            }
 5392|   206k|         }();
 5393|   206k|         if (!could_be_mapping) {
  ------------------
  |  Branch (5393:14): [True: 86.3k, False: 120k]
  ------------------
 5394|  86.3k|            return false;
 5395|  86.3k|         }
 5396|       |         // Full parse attempt - use a temporary context that inherits indent from parent
 5397|   120k|         auto temp_ctx = ctx.make_speculative();
 5398|   120k|         process_yaml_variant_alternatives<Variant, is_yaml_variant_object>::template op<Opts>(value, temp_ctx, it,
 5399|   120k|                                                                                               end);
 5400|   120k|         ctx.alias_expansion_budget = temp_ctx.alias_expansion_budget; // charged even if rejected
 5401|   120k|         ctx.key_expansion_budget = temp_ctx.key_expansion_budget;
 5402|   120k|         if (!bool(temp_ctx.error)) {
  ------------------
  |  Branch (5402:14): [True: 109k, False: 10.4k]
  ------------------
 5403|   109k|            ctx.anchors = std::move(temp_ctx.anchors);
 5404|   109k|            return true;
 5405|   109k|         }
 5406|       |         // The line matched "key: value" pattern but parsing failed.
 5407|       |         // This indicates malformed content (e.g., unclosed flow collection),
 5408|       |         // so propagate the error rather than silently falling back to string.
 5409|  10.4k|         ctx.error = temp_ctx.error;
 5410|  10.4k|         ctx.custom_error_message = temp_ctx.custom_error_message;
 5411|  10.4k|         return false;
 5412|   120k|      }
 5413|   206k|   }
_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_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERSH_RNSI_12yaml_contextERPKcSO_EEbOT1_OT2_OT3_T4_ENKUlvE_clEv:
 5385|   206k|         const bool could_be_mapping = [&] {
 5386|       |            if constexpr (yaml::check_flow_context(Opts)) {
 5387|       |               return line_could_be_flow_mapping(it, end);
 5388|       |            }
 5389|   206k|            else {
 5390|   206k|               return yaml::line_could_be_block_mapping(it, end);
 5391|   206k|            }
 5392|   206k|         }();
_ZZN3glz5parseILj450EE2opITnDaXtlNS_4yaml9yaml_optsELj450ELb1ELb0ELb1ELh2ELb0ELj32EEERNS_12generic_jsonILNS_8num_modeE0ENS_17ordered_small_mapEEETkNS_10is_contextERNS3_12yaml_contextERPKcSD_EEvOT0_OT1_OT2_T3_ENKUlT_E_clISD_EEDaSM_:
  145|    520|               auto is_document_start = [&](auto pos) {
  146|    520|                  if (end - pos >= 3 && pos[0] == '-' && pos[1] == '-' && pos[2] == '-') {
  ------------------
  |  Branch (146:23): [True: 313, False: 207]
  |  Branch (146:41): [True: 123, False: 190]
  |  Branch (146:58): [True: 107, False: 16]
  |  Branch (146:75): [True: 101, False: 6]
  ------------------
  147|    101|                     auto after = pos + 3;
  148|    101|                     return after == end || *after == ' ' || *after == '\t' || *after == '\n' || *after == '\r' ||
  ------------------
  |  Branch (148:29): [True: 0, False: 101]
  |  Branch (148:45): [True: 25, False: 76]
  |  Branch (148:62): [True: 47, False: 29]
  |  Branch (148:80): [True: 15, False: 14]
  |  Branch (148:98): [True: 11, False: 3]
  ------------------
  149|      3|                            *after == '#';
  ------------------
  |  Branch (149:29): [True: 1, False: 2]
  ------------------
  150|    101|                  }
  151|    419|                  return false;
  152|    520|               };

